diff --git a/lib/services/networkManagement2/LICENSE.txt b/lib/services/networkManagement2/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/networkManagement2/LICENSE.txt +++ b/lib/services/networkManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/networkManagement2/lib/LICENSE.txt b/lib/services/networkManagement2/lib/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/networkManagement2/lib/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/networkManagement2/lib/lib/models/addressSpace.js b/lib/services/networkManagement2/lib/lib/models/addressSpace.js new file mode 100644 index 0000000000..d52191738d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/addressSpace.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + * + */ +class AddressSpace { + /** + * Create a AddressSpace. + * @member {array} [addressPrefixes] A list of address blocks reserved for + * this virtual network in CIDR notation. + */ + constructor() { + } + + /** + * Defines the metadata of AddressSpace + * + * @returns {object} metadata of AddressSpace + * + */ + mapper() { + return { + required: false, + serializedName: 'AddressSpace', + type: { + name: 'Composite', + className: 'AddressSpace', + modelProperties: { + addressPrefixes: { + required: false, + serializedName: 'addressPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AddressSpace; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGateway.js b/lib/services/networkManagement2/lib/lib/models/applicationGateway.js new file mode 100644 index 0000000000..47ddea3f90 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGateway.js @@ -0,0 +1,407 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application gateway resource + * + * @extends models['Resource'] + */ +class ApplicationGateway extends models['Resource'] { + /** + * Create a ApplicationGateway. + * @member {object} [sku] SKU of the application gateway resource. + * @member {string} [sku.name] Name of an application gateway SKU. Possible + * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + * 'WAF_Medium', 'WAF_Large' + * @member {string} [sku.tier] Tier of an application gateway. Possible + * values include: 'Standard', 'WAF' + * @member {number} [sku.capacity] Capacity (instance count) of an + * application gateway. + * @member {object} [sslPolicy] SSL policy of the application gateway + * resource. + * @member {array} [sslPolicy.disabledSslProtocols] Ssl protocols to be + * disabled on application gateway. + * @member {string} [sslPolicy.policyType] Type of Ssl Policy. Possible + * values include: 'Predefined', 'Custom' + * @member {string} [sslPolicy.policyName] Name of Ssl predefined policy. + * Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * @member {array} [sslPolicy.cipherSuites] Ssl cipher suites to be enabled + * in the specified order to application gateway. + * @member {string} [sslPolicy.minProtocolVersion] Minimum version of Ssl + * protocol to be supported on application gateway. Possible values include: + * 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * @member {string} [operationalState] Operational state of the application + * gateway resource. Possible values include: 'Stopped', 'Starting', + * 'Running', 'Stopping' + * @member {array} [gatewayIPConfigurations] Subnets of application the + * gateway resource. + * @member {array} [authenticationCertificates] Authentication certificates + * of the application gateway resource. + * @member {array} [sslCertificates] SSL certificates of the application + * gateway resource. + * @member {array} [frontendIPConfigurations] Frontend IP addresses of the + * application gateway resource. + * @member {array} [frontendPorts] Frontend ports of the application gateway + * resource. + * @member {array} [probes] Probes of the application gateway resource. + * @member {array} [backendAddressPools] Backend address pool of the + * application gateway resource. + * @member {array} [backendHttpSettingsCollection] Backend http settings of + * the application gateway resource. + * @member {array} [httpListeners] Http listeners of the application gateway + * resource. + * @member {array} [urlPathMaps] URL path map of the application gateway + * resource. + * @member {array} [requestRoutingRules] Request routing rules of the + * application gateway resource. + * @member {array} [redirectConfigurations] Redirect configurations of the + * application gateway resource. + * @member {object} [webApplicationFirewallConfiguration] Web application + * firewall configuration. + * @member {boolean} [webApplicationFirewallConfiguration.enabled] Whether + * the web application firewall is enabled or not. + * @member {string} [webApplicationFirewallConfiguration.firewallMode] Web + * application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * @member {string} [webApplicationFirewallConfiguration.ruleSetType] The + * type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * @member {string} [webApplicationFirewallConfiguration.ruleSetVersion] The + * version of the rule set type. + * @member {array} [webApplicationFirewallConfiguration.disabledRuleGroups] + * The disabled rule groups. + * @member {boolean} [webApplicationFirewallConfiguration.requestBodyCheck] + * Whether allow WAF to check request Body. + * @member {number} [webApplicationFirewallConfiguration.maxRequestBodySize] + * Maxium request body size for WAF. + * @member {boolean} [enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * @member {string} [resourceGuid] Resource GUID property of the application + * gateway resource. + * @member {string} [provisioningState] Provisioning state of the application + * gateway resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGateway + * + * @returns {object} metadata of ApplicationGateway + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGateway', + type: { + name: 'Composite', + className: 'ApplicationGateway', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'ApplicationGatewaySku' + } + }, + sslPolicy: { + required: false, + serializedName: 'properties.sslPolicy', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslPolicy' + } + }, + operationalState: { + required: false, + readOnly: true, + serializedName: 'properties.operationalState', + type: { + name: 'String' + } + }, + gatewayIPConfigurations: { + required: false, + serializedName: 'properties.gatewayIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayIPConfigurationElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayIPConfiguration' + } + } + } + }, + authenticationCertificates: { + required: false, + serializedName: 'properties.authenticationCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayAuthenticationCertificateElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayAuthenticationCertificate' + } + } + } + }, + sslCertificates: { + required: false, + serializedName: 'properties.sslCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewaySslCertificateElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslCertificate' + } + } + } + }, + frontendIPConfigurations: { + required: false, + serializedName: 'properties.frontendIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFrontendIPConfigurationElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFrontendIPConfiguration' + } + } + } + }, + frontendPorts: { + required: false, + serializedName: 'properties.frontendPorts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFrontendPortElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFrontendPort' + } + } + } + }, + probes: { + required: false, + serializedName: 'properties.probes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayProbeElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayProbe' + } + } + } + }, + backendAddressPools: { + required: false, + serializedName: 'properties.backendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendAddressPoolElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddressPool' + } + } + } + }, + backendHttpSettingsCollection: { + required: false, + serializedName: 'properties.backendHttpSettingsCollection', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendHttpSettingsElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHttpSettings' + } + } + } + }, + httpListeners: { + required: false, + serializedName: 'properties.httpListeners', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayHttpListenerElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayHttpListener' + } + } + } + }, + urlPathMaps: { + required: false, + serializedName: 'properties.urlPathMaps', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayUrlPathMapElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayUrlPathMap' + } + } + } + }, + requestRoutingRules: { + required: false, + serializedName: 'properties.requestRoutingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayRequestRoutingRuleElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayRequestRoutingRule' + } + } + } + }, + redirectConfigurations: { + required: false, + serializedName: 'properties.redirectConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayRedirectConfigurationElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayRedirectConfiguration' + } + } + } + }, + webApplicationFirewallConfiguration: { + required: false, + serializedName: 'properties.webApplicationFirewallConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayWebApplicationFirewallConfiguration' + } + }, + enableHttp2: { + required: false, + serializedName: 'properties.enableHttp2', + type: { + name: 'Boolean' + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGateway; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayAuthenticationCertificate.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAuthenticationCertificate.js new file mode 100644 index 0000000000..14cb3e2832 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAuthenticationCertificate.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Authentication certificates of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayAuthenticationCertificate extends models['SubResource'] { + /** + * Create a ApplicationGatewayAuthenticationCertificate. + * @member {string} [data] Certificate public data. + * @member {string} [provisioningState] Provisioning state of the + * authentication certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayAuthenticationCertificate + * + * @returns {object} metadata of ApplicationGatewayAuthenticationCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAuthenticationCertificate', + type: { + name: 'Composite', + className: 'ApplicationGatewayAuthenticationCertificate', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + data: { + required: false, + serializedName: 'properties.data', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAuthenticationCertificate; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslOptions.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslOptions.js new file mode 100644 index 0000000000..0d2c74fe8d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslOptions.js @@ -0,0 +1,151 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + * + * @extends models['Resource'] + */ +class ApplicationGatewayAvailableSslOptions extends models['Resource'] { + /** + * Create a ApplicationGatewayAvailableSslOptions. + * @member {array} [predefinedPolicies] List of available Ssl predefined + * policy. + * @member {string} [defaultPolicy] Name of the Ssl predefined policy applied + * by default to application gateway. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S' + * @member {array} [availableCipherSuites] List of available Ssl cipher + * suites. + * @member {array} [availableProtocols] List of available Ssl protocols. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayAvailableSslOptions + * + * @returns {object} metadata of ApplicationGatewayAvailableSslOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAvailableSslOptions', + type: { + name: 'Composite', + className: 'ApplicationGatewayAvailableSslOptions', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + predefinedPolicies: { + required: false, + serializedName: 'properties.predefinedPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + defaultPolicy: { + required: false, + serializedName: 'properties.defaultPolicy', + type: { + name: 'String' + } + }, + availableCipherSuites: { + required: false, + serializedName: 'properties.availableCipherSuites', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + availableProtocols: { + required: false, + serializedName: 'properties.availableProtocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAvailableSslOptions; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js new file mode 100644 index 0000000000..5b1ac67da0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +class ApplicationGatewayAvailableSslPredefinedPolicies extends Array { + /** + * Create a ApplicationGatewayAvailableSslPredefinedPolicies. + * @member {string} [nextLink] URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayAvailableSslPredefinedPolicies + * + * @returns {object} metadata of ApplicationGatewayAvailableSslPredefinedPolicies + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAvailableSslPredefinedPolicies', + type: { + name: 'Composite', + className: 'ApplicationGatewayAvailableSslPredefinedPolicies', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewaySslPredefinedPolicyElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslPredefinedPolicy' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAvailableSslPredefinedPolicies; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableWafRuleSetsResult.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableWafRuleSetsResult.js new file mode 100644 index 0000000000..f9d3324627 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableWafRuleSetsResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + * + */ +class ApplicationGatewayAvailableWafRuleSetsResult { + /** + * Create a ApplicationGatewayAvailableWafRuleSetsResult. + * @member {array} [value] The list of application gateway rule sets. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayAvailableWafRuleSetsResult + * + * @returns {object} metadata of ApplicationGatewayAvailableWafRuleSetsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAvailableWafRuleSetsResult', + type: { + name: 'Composite', + className: 'ApplicationGatewayAvailableWafRuleSetsResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFirewallRuleSetElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRuleSet' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAvailableWafRuleSetsResult; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddress.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddress.js new file mode 100644 index 0000000000..9efa6a4200 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddress.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'; + +/** + * Backend address of an application gateway. + * + */ +class ApplicationGatewayBackendAddress { + /** + * Create a ApplicationGatewayBackendAddress. + * @member {string} [fqdn] Fully qualified domain name (FQDN). + * @member {string} [ipAddress] IP address + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayBackendAddress + * + * @returns {object} metadata of ApplicationGatewayBackendAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendAddress', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddress', + modelProperties: { + fqdn: { + required: false, + serializedName: 'fqdn', + type: { + name: 'String' + } + }, + ipAddress: { + required: false, + serializedName: 'ipAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendAddress; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddressPool.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddressPool.js new file mode 100644 index 0000000000..54daf5779f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddressPool.js @@ -0,0 +1,124 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Backend Address Pool of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayBackendAddressPool extends models['SubResource'] { + /** + * Create a ApplicationGatewayBackendAddressPool. + * @member {array} [backendIPConfigurations] Collection of references to IPs + * defined in network interfaces. + * @member {array} [backendAddresses] Backend addresses + * @member {string} [provisioningState] Provisioning state of the backend + * address pool resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Resource that is unique within a resource group. + * This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayBackendAddressPool + * + * @returns {object} metadata of ApplicationGatewayBackendAddressPool + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendAddressPool', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddressPool', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + backendIPConfigurations: { + required: false, + serializedName: 'properties.backendIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceIPConfigurationElementType', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + } + } + }, + backendAddresses: { + required: false, + serializedName: 'properties.backendAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendAddressElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddress' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendAddressPool; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealth.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealth.js new file mode 100644 index 0000000000..cb06b4e6e1 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealth.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of ApplicationGatewayBackendHealthPool resources. + * + */ +class ApplicationGatewayBackendHealth { + /** + * Create a ApplicationGatewayBackendHealth. + * @member {array} [backendAddressPools] + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayBackendHealth + * + * @returns {object} metadata of ApplicationGatewayBackendHealth + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendHealth', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealth', + modelProperties: { + backendAddressPools: { + required: false, + serializedName: 'backendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendHealthPoolElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthPool' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendHealth; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthHttpSettings.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthHttpSettings.js new file mode 100644 index 0000000000..082f243482 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthHttpSettings.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application gateway BackendHealthHttp settings. + * + */ +class ApplicationGatewayBackendHealthHttpSettings { + /** + * Create a ApplicationGatewayBackendHealthHttpSettings. + * @member {object} [backendHttpSettings] Reference of an + * ApplicationGatewayBackendHttpSettings resource. + * @member {number} [backendHttpSettings.port] Port + * @member {string} [backendHttpSettings.protocol] Protocol. Possible values + * include: 'Http', 'Https' + * @member {string} [backendHttpSettings.cookieBasedAffinity] Cookie based + * affinity. Possible values include: 'Enabled', 'Disabled' + * @member {number} [backendHttpSettings.requestTimeout] Request timeout in + * seconds. Application Gateway will fail the request if response is not + * received within RequestTimeout. Acceptable values are from 1 second to + * 86400 seconds. + * @member {object} [backendHttpSettings.probe] Probe resource of an + * application gateway. + * @member {string} [backendHttpSettings.probe.id] Resource ID. + * @member {array} [backendHttpSettings.authenticationCertificates] Array of + * references to application gateway authentication certificates. + * @member {object} [backendHttpSettings.connectionDraining] Connection + * draining of the backend http settings resource. + * @member {boolean} [backendHttpSettings.connectionDraining.enabled] Whether + * connection draining is enabled or not. + * @member {number} + * [backendHttpSettings.connectionDraining.drainTimeoutInSec] The number of + * seconds connection draining is active. Acceptable values are from 1 second + * to 3600 seconds. + * @member {string} [backendHttpSettings.hostName] Host header to be sent to + * the backend servers. + * @member {boolean} [backendHttpSettings.pickHostNameFromBackendAddress] + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + * @member {string} [backendHttpSettings.affinityCookieName] Cookie name to + * use for the affinity cookie. + * @member {boolean} [backendHttpSettings.probeEnabled] Whether the probe is + * enabled. Default value is false. + * @member {string} [backendHttpSettings.path] Path which should be used as a + * prefix for all HTTP requests. Null means no path will be prefixed. Default + * value is null. + * @member {string} [backendHttpSettings.provisioningState] Provisioning + * state of the backend http settings resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendHttpSettings.name] Name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [backendHttpSettings.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [backendHttpSettings.type] Type of the resource. + * @member {array} [servers] List of ApplicationGatewayBackendHealthServer + * resources. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayBackendHealthHttpSettings + * + * @returns {object} metadata of ApplicationGatewayBackendHealthHttpSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendHealthHttpSettings', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthHttpSettings', + modelProperties: { + backendHttpSettings: { + required: false, + serializedName: 'backendHttpSettings', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHttpSettings' + } + }, + servers: { + required: false, + serializedName: 'servers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendHealthServerElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthServer' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendHealthHttpSettings; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthPool.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthPool.js new file mode 100644 index 0000000000..15cdacf101 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthPool.js @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application gateway BackendHealth pool. + * + */ +class ApplicationGatewayBackendHealthPool { + /** + * Create a ApplicationGatewayBackendHealthPool. + * @member {object} [backendAddressPool] Reference of an + * ApplicationGatewayBackendAddressPool resource. + * @member {array} [backendAddressPool.backendIPConfigurations] Collection of + * references to IPs defined in network interfaces. + * @member {array} [backendAddressPool.backendAddresses] Backend addresses + * @member {string} [backendAddressPool.provisioningState] Provisioning state + * of the backend address pool resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [backendAddressPool.name] Resource that is unique within + * a resource group. This name can be used to access the resource. + * @member {string} [backendAddressPool.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [backendAddressPool.type] Type of the resource. + * @member {array} [backendHttpSettingsCollection] List of + * ApplicationGatewayBackendHealthHttpSettings resources. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayBackendHealthPool + * + * @returns {object} metadata of ApplicationGatewayBackendHealthPool + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendHealthPool', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthPool', + modelProperties: { + backendAddressPool: { + required: false, + serializedName: 'backendAddressPool', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddressPool' + } + }, + backendHttpSettingsCollection: { + required: false, + serializedName: 'backendHttpSettingsCollection', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendHealthHttpSettingsElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthHttpSettings' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendHealthPool; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthServer.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthServer.js new file mode 100644 index 0000000000..1c0b56e51c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthServer.js @@ -0,0 +1,292 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application gateway backendhealth http settings. + * + */ +class ApplicationGatewayBackendHealthServer { + /** + * Create a ApplicationGatewayBackendHealthServer. + * @member {string} [address] IP address or FQDN of backend server. + * @member {object} [ipConfiguration] Reference of IP configuration of + * backend server. + * @member {array} [ipConfiguration.applicationGatewayBackendAddressPools] + * The reference of ApplicationGatewayBackendAddressPool resource. + * @member {array} [ipConfiguration.loadBalancerBackendAddressPools] The + * reference of LoadBalancerBackendAddressPool resource. + * @member {array} [ipConfiguration.loadBalancerInboundNatRules] A list of + * references of LoadBalancerInboundNatRules. + * @member {string} [ipConfiguration.privateIPAddress] Private IP address of + * the IP configuration. + * @member {string} [ipConfiguration.privateIPAllocationMethod] Defines how a + * private IP address is assigned. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {string} [ipConfiguration.privateIPAddressVersion] Available from + * Api-Version 2016-03-30 onwards, it represents whether the specific + * ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + * values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {object} [ipConfiguration.subnet] Subnet bound to the IP + * configuration. + * @member {string} [ipConfiguration.subnet.addressPrefix] The address prefix + * for the subnet. + * @member {object} [ipConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.subnet.routeTable] The reference of the + * RouteTable resource. + * @member {array} [ipConfiguration.subnet.routeTable.routes] Collection of + * routes contained within a route table. + * @member {array} [ipConfiguration.subnet.routeTable.subnets] A collection + * of references to subnets. + * @member {boolean} + * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} [ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of + * service endpoints. + * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of + * references to the network interface IP configurations using subnet. + * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [ipConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [ipConfiguration.subnet.name] The name of the resource + * that is unique within a resource group. This name can be used to access + * the resource. + * @member {string} [ipConfiguration.subnet.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {boolean} [ipConfiguration.primary] Gets whether this is a primary + * customer address on the network interface. + * @member {object} [ipConfiguration.publicIPAddress] Public IP address bound + * to the IP configuration. + * @member {object} [ipConfiguration.publicIPAddress.sku] The public IP + * address SKU. + * @member {string} [ipConfiguration.publicIPAddress.sku.name] Name of a + * public IP address SKU. Possible values include: 'Basic', 'Standard' + * @member {string} + * [ipConfiguration.publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [ipConfiguration.publicIPAddress.publicIPAddressVersion] + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6' + * @member {object} [ipConfiguration.publicIPAddress.ipConfiguration] The IP + * configuration associated with the public IP address. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} [ipConfiguration.publicIPAddress.ipConfiguration.subnet] + * The reference of the subnet resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] The + * address prefix for the subnet. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] + * The reference of the NetworkSecurityGroup resource. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] + * A collection of references to subnets. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] + * A unique read-only string that changes whenever the resource is updated. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] + * An array of service endpoints. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations + * using subnet. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] + * Gets an array of references to the external resources using subnet. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.provisioningState] Gets + * the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.publicIPAddress.ipConfiguration.name] + * The name of the resource that is unique within a resource group. This name + * can be used to access the resource. + * @member {string} [ipConfiguration.publicIPAddress.ipConfiguration.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.publicIPAddress.dnsSettings] The FQDN of + * the DNS record associated with the public IP address. + * @member {string} + * [ipConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or sets + * the Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [ipConfiguration.publicIPAddress.dnsSettings.fqdn] Gets + * the FQDN, Fully qualified domain name of the A DNS record associated with + * the public IP. This is the concatenation of the domainNameLabel and the + * regionalized DNS zone. + * @member {string} [ipConfiguration.publicIPAddress.dnsSettings.reverseFqdn] + * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name + * that resolves to this public IP address. If the reverseFqdn is specified, + * then a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [ipConfiguration.publicIPAddress.ipTags] The list of tags + * associated with the public IP address. + * @member {string} [ipConfiguration.publicIPAddress.ipAddress] The IP + * address associated with the public IP address resource. + * @member {number} [ipConfiguration.publicIPAddress.idleTimeoutInMinutes] + * The idle timeout of the public IP address. + * @member {string} [ipConfiguration.publicIPAddress.resourceGuid] The + * resource GUID property of the public IP resource. + * @member {string} [ipConfiguration.publicIPAddress.provisioningState] The + * provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.publicIPAddress.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.publicIPAddress.zones] A list of + * availability zones denoting the IP allocated for the resource needs to + * come from. + * @member {array} [ipConfiguration.applicationSecurityGroups] Application + * security groups in which the IP configuration is included. + * @member {string} [ipConfiguration.provisioningState] The provisioning + * state of the network interface IP configuration. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [health] Health of backend server. Possible values + * include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayBackendHealthServer + * + * @returns {object} metadata of ApplicationGatewayBackendHealthServer + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendHealthServer', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHealthServer', + modelProperties: { + address: { + required: false, + serializedName: 'address', + type: { + name: 'String' + } + }, + ipConfiguration: { + required: false, + serializedName: 'ipConfiguration', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + }, + health: { + required: false, + serializedName: 'health', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendHealthServer; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHttpSettings.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHttpSettings.js new file mode 100644 index 0000000000..5d294aaa9c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHttpSettings.js @@ -0,0 +1,214 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Backend address pool settings of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayBackendHttpSettings extends models['SubResource'] { + /** + * Create a ApplicationGatewayBackendHttpSettings. + * @member {number} [port] Port + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [cookieBasedAffinity] Cookie based affinity. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [requestTimeout] Request timeout in seconds. Application + * Gateway will fail the request if response is not received within + * RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * @member {object} [probe] Probe resource of an application gateway. + * @member {string} [probe.id] Resource ID. + * @member {array} [authenticationCertificates] Array of references to + * application gateway authentication certificates. + * @member {object} [connectionDraining] Connection draining of the backend + * http settings resource. + * @member {boolean} [connectionDraining.enabled] Whether connection draining + * is enabled or not. + * @member {number} [connectionDraining.drainTimeoutInSec] The number of + * seconds connection draining is active. Acceptable values are from 1 second + * to 3600 seconds. + * @member {string} [hostName] Host header to be sent to the backend servers. + * @member {boolean} [pickHostNameFromBackendAddress] Whether to pick host + * header should be picked from the host name of the backend server. Default + * value is false. + * @member {string} [affinityCookieName] Cookie name to use for the affinity + * cookie. + * @member {boolean} [probeEnabled] Whether the probe is enabled. Default + * value is false. + * @member {string} [path] Path which should be used as a prefix for all HTTP + * requests. Null means no path will be prefixed. Default value is null. + * @member {string} [provisioningState] Provisioning state of the backend + * http settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayBackendHttpSettings + * + * @returns {object} metadata of ApplicationGatewayBackendHttpSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayBackendHttpSettings', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendHttpSettings', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + protocol: { + required: false, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + cookieBasedAffinity: { + required: false, + serializedName: 'properties.cookieBasedAffinity', + type: { + name: 'String' + } + }, + requestTimeout: { + required: false, + serializedName: 'properties.requestTimeout', + type: { + name: 'Number' + } + }, + probe: { + required: false, + serializedName: 'properties.probe', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + authenticationCertificates: { + required: false, + serializedName: 'properties.authenticationCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + connectionDraining: { + required: false, + serializedName: 'properties.connectionDraining', + type: { + name: 'Composite', + className: 'ApplicationGatewayConnectionDraining' + } + }, + hostName: { + required: false, + serializedName: 'properties.hostName', + type: { + name: 'String' + } + }, + pickHostNameFromBackendAddress: { + required: false, + serializedName: 'properties.pickHostNameFromBackendAddress', + type: { + name: 'Boolean' + } + }, + affinityCookieName: { + required: false, + serializedName: 'properties.affinityCookieName', + type: { + name: 'String' + } + }, + probeEnabled: { + required: false, + serializedName: 'properties.probeEnabled', + type: { + name: 'Boolean' + } + }, + path: { + required: false, + serializedName: 'properties.path', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayBackendHttpSettings; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayConnectionDraining.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayConnectionDraining.js new file mode 100644 index 0000000000..657dfbc1ce --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayConnectionDraining.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Connection draining allows open connections to a backend server to be active + * for a specified time after the backend server got removed from the + * configuration. + * + */ +class ApplicationGatewayConnectionDraining { + /** + * Create a ApplicationGatewayConnectionDraining. + * @member {boolean} enabled Whether connection draining is enabled or not. + * @member {number} drainTimeoutInSec The number of seconds connection + * draining is active. Acceptable values are from 1 second to 3600 seconds. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayConnectionDraining + * + * @returns {object} metadata of ApplicationGatewayConnectionDraining + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayConnectionDraining', + type: { + name: 'Composite', + className: 'ApplicationGatewayConnectionDraining', + modelProperties: { + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + drainTimeoutInSec: { + required: true, + serializedName: 'drainTimeoutInSec', + constraints: { + InclusiveMaximum: 3600, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayConnectionDraining; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallDisabledRuleGroup.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallDisabledRuleGroup.js new file mode 100644 index 0000000000..fac27dfd71 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallDisabledRuleGroup.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Allows to disable rules within a rule group or an entire rule group. + * + */ +class ApplicationGatewayFirewallDisabledRuleGroup { + /** + * Create a ApplicationGatewayFirewallDisabledRuleGroup. + * @member {string} ruleGroupName The name of the rule group that will be + * disabled. + * @member {array} [rules] The list of rules that will be disabled. If null, + * all rules of the rule group will be disabled. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayFirewallDisabledRuleGroup + * + * @returns {object} metadata of ApplicationGatewayFirewallDisabledRuleGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFirewallDisabledRuleGroup', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallDisabledRuleGroup', + modelProperties: { + ruleGroupName: { + required: true, + serializedName: 'ruleGroupName', + type: { + name: 'String' + } + }, + rules: { + required: false, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFirewallDisabledRuleGroup; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRule.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRule.js new file mode 100644 index 0000000000..73c4850657 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRule.js @@ -0,0 +1,62 @@ +/* + * 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 web application firewall rule. + * + */ +class ApplicationGatewayFirewallRule { + /** + * Create a ApplicationGatewayFirewallRule. + * @member {number} ruleId The identifier of the web application firewall + * rule. + * @member {string} [description] The description of the web application + * firewall rule. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayFirewallRule + * + * @returns {object} metadata of ApplicationGatewayFirewallRule + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFirewallRule', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRule', + modelProperties: { + ruleId: { + required: true, + serializedName: 'ruleId', + type: { + name: 'Number' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFirewallRule; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleGroup.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleGroup.js new file mode 100644 index 0000000000..c359c16068 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleGroup.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A web application firewall rule group. + * + */ +class ApplicationGatewayFirewallRuleGroup { + /** + * Create a ApplicationGatewayFirewallRuleGroup. + * @member {string} ruleGroupName The name of the web application firewall + * rule group. + * @member {string} [description] The description of the web application + * firewall rule group. + * @member {array} rules The rules of the web application firewall rule + * group. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayFirewallRuleGroup + * + * @returns {object} metadata of ApplicationGatewayFirewallRuleGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFirewallRuleGroup', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRuleGroup', + modelProperties: { + ruleGroupName: { + required: true, + serializedName: 'ruleGroupName', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + rules: { + required: true, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFirewallRuleElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRule' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFirewallRuleGroup; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleSet.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleSet.js new file mode 100644 index 0000000000..d33762e006 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleSet.js @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A web application firewall rule set. + * + * @extends models['Resource'] + */ +class ApplicationGatewayFirewallRuleSet extends models['Resource'] { + /** + * Create a ApplicationGatewayFirewallRuleSet. + * @member {string} [provisioningState] The provisioning state of the web + * application firewall rule set. + * @member {string} ruleSetType The type of the web application firewall rule + * set. + * @member {string} ruleSetVersion The version of the web application + * firewall rule set type. + * @member {array} ruleGroups The rule groups of the web application firewall + * rule set. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayFirewallRuleSet + * + * @returns {object} metadata of ApplicationGatewayFirewallRuleSet + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFirewallRuleSet', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRuleSet', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + ruleSetType: { + required: true, + serializedName: 'properties.ruleSetType', + type: { + name: 'String' + } + }, + ruleSetVersion: { + required: true, + serializedName: 'properties.ruleSetVersion', + type: { + name: 'String' + } + }, + ruleGroups: { + required: true, + serializedName: 'properties.ruleGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFirewallRuleGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallRuleGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFirewallRuleSet; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendIPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendIPConfiguration.js new file mode 100644 index 0000000000..36c3964d12 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendIPConfiguration.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Frontend IP configuration of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayFrontendIPConfiguration extends models['SubResource'] { + /** + * Create a ApplicationGatewayFrontendIPConfiguration. + * @member {string} [privateIPAddress] PrivateIPAddress of the network + * interface IP Configuration. + * @member {string} [privateIPAllocationMethod] PrivateIP allocation method. + * Possible values include: 'Static', 'Dynamic' + * @member {object} [subnet] Reference of the subnet resource. + * @member {string} [subnet.id] Resource ID. + * @member {object} [publicIPAddress] Reference of the PublicIP resource. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayFrontendIPConfiguration + * + * @returns {object} metadata of ApplicationGatewayFrontendIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFrontendIPConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayFrontendIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + privateIPAddress: { + required: false, + serializedName: 'properties.privateIPAddress', + type: { + name: 'String' + } + }, + privateIPAllocationMethod: { + required: false, + serializedName: 'properties.privateIPAllocationMethod', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFrontendIPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendPort.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendPort.js new file mode 100644 index 0000000000..1eff4ee554 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendPort.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Frontend port of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayFrontendPort extends models['SubResource'] { + /** + * Create a ApplicationGatewayFrontendPort. + * @member {number} [port] Frontend port + * @member {string} [provisioningState] Provisioning state of the frontend + * port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayFrontendPort + * + * @returns {object} metadata of ApplicationGatewayFrontendPort + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayFrontendPort', + type: { + name: 'Composite', + className: 'ApplicationGatewayFrontendPort', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayFrontendPort; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayHttpListener.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayHttpListener.js new file mode 100644 index 0000000000..edd2db76d3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayHttpListener.js @@ -0,0 +1,150 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Http listener of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayHttpListener extends models['SubResource'] { + /** + * Create a ApplicationGatewayHttpListener. + * @member {object} [frontendIPConfiguration] Frontend IP configuration + * resource of an application gateway. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [frontendPort] Frontend port resource of an application + * gateway. + * @member {string} [frontendPort.id] Resource ID. + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [hostName] Host name of HTTP listener. + * @member {object} [sslCertificate] SSL certificate resource of an + * application gateway. + * @member {string} [sslCertificate.id] Resource ID. + * @member {boolean} [requireServerNameIndication] Applicable only if + * protocol is https. Enables SNI for multi-hosting. + * @member {string} [provisioningState] Provisioning state of the HTTP + * listener resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayHttpListener + * + * @returns {object} metadata of ApplicationGatewayHttpListener + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayHttpListener', + type: { + name: 'Composite', + className: 'ApplicationGatewayHttpListener', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + frontendIPConfiguration: { + required: false, + serializedName: 'properties.frontendIPConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + frontendPort: { + required: false, + serializedName: 'properties.frontendPort', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + protocol: { + required: false, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + hostName: { + required: false, + serializedName: 'properties.hostName', + type: { + name: 'String' + } + }, + sslCertificate: { + required: false, + serializedName: 'properties.sslCertificate', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + requireServerNameIndication: { + required: false, + serializedName: 'properties.requireServerNameIndication', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayHttpListener; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayIPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayIPConfiguration.js new file mode 100644 index 0000000000..6e170ed225 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayIPConfiguration.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayIPConfiguration extends models['SubResource'] { + /** + * Create a ApplicationGatewayIPConfiguration. + * @member {object} [subnet] Reference of the subnet resource. A subnet from + * where application gateway gets its private address. + * @member {string} [subnet.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the application + * gateway subnet resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayIPConfiguration + * + * @returns {object} metadata of ApplicationGatewayIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayIPConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayIPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayListResult.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayListResult.js new file mode 100644 index 0000000000..faba3912d9 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ListApplicationGateways API service call. + */ +class ApplicationGatewayListResult extends Array { + /** + * Create a ApplicationGatewayListResult. + * @member {string} [nextLink] URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayListResult + * + * @returns {object} metadata of ApplicationGatewayListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayListResult', + type: { + name: 'Composite', + className: 'ApplicationGatewayListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayElementType', + type: { + name: 'Composite', + className: 'ApplicationGateway' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayPathRule.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayPathRule.js new file mode 100644 index 0000000000..7f52241d11 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayPathRule.js @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Path rule of URL path map of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayPathRule extends models['SubResource'] { + /** + * Create a ApplicationGatewayPathRule. + * @member {array} [paths] Path rules of URL path map. + * @member {object} [backendAddressPool] Backend address pool resource of URL + * path map path rule. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [backendHttpSettings] Backend http settings resource of + * URL path map path rule. + * @member {string} [backendHttpSettings.id] Resource ID. + * @member {object} [redirectConfiguration] Redirect configuration resource + * of URL path map path rule. + * @member {string} [redirectConfiguration.id] Resource ID. + * @member {string} [provisioningState] Path rule of URL path map resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayPathRule + * + * @returns {object} metadata of ApplicationGatewayPathRule + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayPathRule', + type: { + name: 'Composite', + className: 'ApplicationGatewayPathRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + paths: { + required: false, + serializedName: 'properties.paths', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + backendAddressPool: { + required: false, + serializedName: 'properties.backendAddressPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + backendHttpSettings: { + required: false, + serializedName: 'properties.backendHttpSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + redirectConfiguration: { + required: false, + serializedName: 'properties.redirectConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayPathRule; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbe.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbe.js new file mode 100644 index 0000000000..78e535c3b8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbe.js @@ -0,0 +1,180 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Probe of the application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayProbe extends models['SubResource'] { + /** + * Create a ApplicationGatewayProbe. + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [host] Host name to send the probe to. + * @member {string} [path] Relative path of probe. Valid path starts from + * '/'. Probe is sent to ://: + * @member {number} [interval] The probing interval in seconds. This is the + * time interval between two consecutive probes. Acceptable values are from 1 + * second to 86400 seconds. + * @member {number} [timeout] the probe timeout in seconds. Probe marked as + * failed if valid response is not received with this timeout period. + * Acceptable values are from 1 second to 86400 seconds. + * @member {number} [unhealthyThreshold] The probe retry count. Backend + * server is marked down after consecutive probe failure count reaches + * UnhealthyThreshold. Acceptable values are from 1 second to 20. + * @member {boolean} [pickHostNameFromBackendHttpSettings] Whether the host + * header should be picked from the backend http settings. Default value is + * false. + * @member {number} [minServers] Minimum number of servers that are always + * marked healthy. Default value is 0. + * @member {object} [match] Criterion for classifying a healthy probe + * response. + * @member {string} [match.body] Body that must be contained in the health + * response. Default value is empty. + * @member {array} [match.statusCodes] Allowed ranges of healthy status + * codes. Default range of healthy status codes is 200-399. + * @member {string} [provisioningState] Provisioning state of the backend + * http settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayProbe + * + * @returns {object} metadata of ApplicationGatewayProbe + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayProbe', + type: { + name: 'Composite', + className: 'ApplicationGatewayProbe', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + protocol: { + required: false, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + host: { + required: false, + serializedName: 'properties.host', + type: { + name: 'String' + } + }, + path: { + required: false, + serializedName: 'properties.path', + type: { + name: 'String' + } + }, + interval: { + required: false, + serializedName: 'properties.interval', + type: { + name: 'Number' + } + }, + timeout: { + required: false, + serializedName: 'properties.timeout', + type: { + name: 'Number' + } + }, + unhealthyThreshold: { + required: false, + serializedName: 'properties.unhealthyThreshold', + type: { + name: 'Number' + } + }, + pickHostNameFromBackendHttpSettings: { + required: false, + serializedName: 'properties.pickHostNameFromBackendHttpSettings', + type: { + name: 'Boolean' + } + }, + minServers: { + required: false, + serializedName: 'properties.minServers', + type: { + name: 'Number' + } + }, + match: { + required: false, + serializedName: 'properties.match', + type: { + name: 'Composite', + className: 'ApplicationGatewayProbeHealthResponseMatch' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayProbe; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbeHealthResponseMatch.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbeHealthResponseMatch.js new file mode 100644 index 0000000000..75068ec857 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayProbeHealthResponseMatch.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Application gateway probe health response match + * + */ +class ApplicationGatewayProbeHealthResponseMatch { + /** + * Create a ApplicationGatewayProbeHealthResponseMatch. + * @member {string} [body] Body that must be contained in the health + * response. Default value is empty. + * @member {array} [statusCodes] Allowed ranges of healthy status codes. + * Default range of healthy status codes is 200-399. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayProbeHealthResponseMatch + * + * @returns {object} metadata of ApplicationGatewayProbeHealthResponseMatch + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayProbeHealthResponseMatch', + type: { + name: 'Composite', + className: 'ApplicationGatewayProbeHealthResponseMatch', + modelProperties: { + body: { + required: false, + serializedName: 'body', + type: { + name: 'String' + } + }, + statusCodes: { + required: false, + serializedName: 'statusCodes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayProbeHealthResponseMatch; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayRedirectConfiguration.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayRedirectConfiguration.js new file mode 100644 index 0000000000..9e1947b563 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayRedirectConfiguration.js @@ -0,0 +1,177 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Redirect configuration of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayRedirectConfiguration extends models['SubResource'] { + /** + * Create a ApplicationGatewayRedirectConfiguration. + * @member {string} [redirectType] Supported http redirection types - + * Permanent, Temporary, Found, SeeOther. Possible values include: + * 'Permanent', 'Found', 'SeeOther', 'Temporary' + * @member {object} [targetListener] Reference to a listener to redirect the + * request to. + * @member {string} [targetListener.id] Resource ID. + * @member {string} [targetUrl] Url to redirect the request to. + * @member {boolean} [includePath] Include path in the redirected url. + * @member {boolean} [includeQueryString] Include query string in the + * redirected url. + * @member {array} [requestRoutingRules] Request routing specifying redirect + * configuration. + * @member {array} [urlPathMaps] Url path maps specifying default redirect + * configuration. + * @member {array} [pathRules] Path rules specifying redirect configuration. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayRedirectConfiguration + * + * @returns {object} metadata of ApplicationGatewayRedirectConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayRedirectConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayRedirectConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + redirectType: { + required: false, + serializedName: 'properties.redirectType', + type: { + name: 'String' + } + }, + targetListener: { + required: false, + serializedName: 'properties.targetListener', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + targetUrl: { + required: false, + serializedName: 'properties.targetUrl', + type: { + name: 'String' + } + }, + includePath: { + required: false, + serializedName: 'properties.includePath', + type: { + name: 'Boolean' + } + }, + includeQueryString: { + required: false, + serializedName: 'properties.includeQueryString', + type: { + name: 'Boolean' + } + }, + requestRoutingRules: { + required: false, + serializedName: 'properties.requestRoutingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + urlPathMaps: { + required: false, + serializedName: 'properties.urlPathMaps', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + pathRules: { + required: false, + serializedName: 'properties.pathRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayRedirectConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayRequestRoutingRule.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayRequestRoutingRule.js new file mode 100644 index 0000000000..22878d6912 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayRequestRoutingRule.js @@ -0,0 +1,155 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Request routing rule of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayRequestRoutingRule extends models['SubResource'] { + /** + * Create a ApplicationGatewayRequestRoutingRule. + * @member {string} [ruleType] Rule type. Possible values include: 'Basic', + * 'PathBasedRouting' + * @member {object} [backendAddressPool] Backend address pool resource of the + * application gateway. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [backendHttpSettings] Frontend port resource of the + * application gateway. + * @member {string} [backendHttpSettings.id] Resource ID. + * @member {object} [httpListener] Http listener resource of the application + * gateway. + * @member {string} [httpListener.id] Resource ID. + * @member {object} [urlPathMap] URL path map resource of the application + * gateway. + * @member {string} [urlPathMap.id] Resource ID. + * @member {object} [redirectConfiguration] Redirect configuration resource + * of the application gateway. + * @member {string} [redirectConfiguration.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the request + * routing rule resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayRequestRoutingRule + * + * @returns {object} metadata of ApplicationGatewayRequestRoutingRule + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayRequestRoutingRule', + type: { + name: 'Composite', + className: 'ApplicationGatewayRequestRoutingRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + ruleType: { + required: false, + serializedName: 'properties.ruleType', + type: { + name: 'String' + } + }, + backendAddressPool: { + required: false, + serializedName: 'properties.backendAddressPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + backendHttpSettings: { + required: false, + serializedName: 'properties.backendHttpSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + httpListener: { + required: false, + serializedName: 'properties.httpListener', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + urlPathMap: { + required: false, + serializedName: 'properties.urlPathMap', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + redirectConfiguration: { + required: false, + serializedName: 'properties.redirectConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayRequestRoutingRule; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewaySku.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySku.js new file mode 100644 index 0000000000..2bf5af52f6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySku.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * SKU of an application gateway + * + */ +class ApplicationGatewaySku { + /** + * Create a ApplicationGatewaySku. + * @member {string} [name] Name of an application gateway SKU. Possible + * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + * 'WAF_Medium', 'WAF_Large' + * @member {string} [tier] Tier of an application gateway. Possible values + * include: 'Standard', 'WAF' + * @member {number} [capacity] Capacity (instance count) of an application + * gateway. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewaySku + * + * @returns {object} metadata of ApplicationGatewaySku + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewaySku', + type: { + name: 'Composite', + className: 'ApplicationGatewaySku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewaySku; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslCertificate.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslCertificate.js new file mode 100644 index 0000000000..0c13a53284 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslCertificate.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * SSL certificates of an application gateway. + * + * @extends models['SubResource'] + */ +class ApplicationGatewaySslCertificate extends models['SubResource'] { + /** + * Create a ApplicationGatewaySslCertificate. + * @member {string} [data] Base-64 encoded pfx certificate. Only applicable + * in PUT Request. + * @member {string} [password] Password for the pfx file specified in data. + * Only applicable in PUT request. + * @member {string} [publicCertData] Base-64 encoded Public cert data + * corresponding to pfx specified in data. Only applicable in GET request. + * @member {string} [provisioningState] Provisioning state of the SSL + * certificate resource Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewaySslCertificate + * + * @returns {object} metadata of ApplicationGatewaySslCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewaySslCertificate', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslCertificate', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + data: { + required: false, + serializedName: 'properties.data', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'properties.password', + type: { + name: 'String' + } + }, + publicCertData: { + required: false, + serializedName: 'properties.publicCertData', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewaySslCertificate; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPolicy.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPolicy.js new file mode 100644 index 0000000000..1d1e7bdd49 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPolicy.js @@ -0,0 +1,105 @@ +/* + * 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'; + +/** + * Application Gateway Ssl policy. + * + */ +class ApplicationGatewaySslPolicy { + /** + * Create a ApplicationGatewaySslPolicy. + * @member {array} [disabledSslProtocols] Ssl protocols to be disabled on + * application gateway. + * @member {string} [policyType] Type of Ssl Policy. Possible values include: + * 'Predefined', 'Custom' + * @member {string} [policyName] Name of Ssl predefined policy. Possible + * values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S' + * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the + * specified order to application gateway. + * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to + * be supported on application gateway. Possible values include: 'TLSv1_0', + * 'TLSv1_1', 'TLSv1_2' + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewaySslPolicy + * + * @returns {object} metadata of ApplicationGatewaySslPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewaySslPolicy', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslPolicy', + modelProperties: { + disabledSslProtocols: { + required: false, + serializedName: 'disabledSslProtocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + policyType: { + required: false, + serializedName: 'policyType', + type: { + name: 'String' + } + }, + policyName: { + required: false, + serializedName: 'policyName', + type: { + name: 'String' + } + }, + cipherSuites: { + required: false, + serializedName: 'cipherSuites', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + minProtocolVersion: { + required: false, + serializedName: 'minProtocolVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewaySslPolicy; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPredefinedPolicy.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPredefinedPolicy.js new file mode 100644 index 0000000000..8c522f4c52 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPredefinedPolicy.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An Ssl predefined policy + * + * @extends models['SubResource'] + */ +class ApplicationGatewaySslPredefinedPolicy extends models['SubResource'] { + /** + * Create a ApplicationGatewaySslPredefinedPolicy. + * @member {string} [name] Name of Ssl predefined policy. + * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the + * specified order for application gateway. + * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to + * be supported on application gateway. Possible values include: 'TLSv1_0', + * 'TLSv1_1', 'TLSv1_2' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewaySslPredefinedPolicy + * + * @returns {object} metadata of ApplicationGatewaySslPredefinedPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewaySslPredefinedPolicy', + type: { + name: 'Composite', + className: 'ApplicationGatewaySslPredefinedPolicy', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + cipherSuites: { + required: false, + serializedName: 'properties.cipherSuites', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + minProtocolVersion: { + required: false, + serializedName: 'properties.minProtocolVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewaySslPredefinedPolicy; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayUrlPathMap.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayUrlPathMap.js new file mode 100644 index 0000000000..c49cf43292 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayUrlPathMap.js @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + * + * @extends models['SubResource'] + */ +class ApplicationGatewayUrlPathMap extends models['SubResource'] { + /** + * Create a ApplicationGatewayUrlPathMap. + * @member {object} [defaultBackendAddressPool] Default backend address pool + * resource of URL path map. + * @member {string} [defaultBackendAddressPool.id] Resource ID. + * @member {object} [defaultBackendHttpSettings] Default backend http + * settings resource of URL path map. + * @member {string} [defaultBackendHttpSettings.id] Resource ID. + * @member {object} [defaultRedirectConfiguration] Default redirect + * configuration resource of URL path map. + * @member {string} [defaultRedirectConfiguration.id] Resource ID. + * @member {array} [pathRules] Path rule of URL path map resource. + * @member {string} [provisioningState] Provisioning state of the backend + * http settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Type of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationGatewayUrlPathMap + * + * @returns {object} metadata of ApplicationGatewayUrlPathMap + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayUrlPathMap', + type: { + name: 'Composite', + className: 'ApplicationGatewayUrlPathMap', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + defaultBackendAddressPool: { + required: false, + serializedName: 'properties.defaultBackendAddressPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + defaultBackendHttpSettings: { + required: false, + serializedName: 'properties.defaultBackendHttpSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + defaultRedirectConfiguration: { + required: false, + serializedName: 'properties.defaultRedirectConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + pathRules: { + required: false, + serializedName: 'properties.pathRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayPathRuleElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayPathRule' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayUrlPathMap; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js b/lib/services/networkManagement2/lib/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js new file mode 100644 index 0000000000..188a421193 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application gateway web application firewall configuration. + * + */ +class ApplicationGatewayWebApplicationFirewallConfiguration { + /** + * Create a ApplicationGatewayWebApplicationFirewallConfiguration. + * @member {boolean} enabled Whether the web application firewall is enabled + * or not. + * @member {string} firewallMode Web application firewall mode. Possible + * values include: 'Detection', 'Prevention' + * @member {string} ruleSetType The type of the web application firewall rule + * set. Possible values are: 'OWASP'. + * @member {string} ruleSetVersion The version of the rule set type. + * @member {array} [disabledRuleGroups] The disabled rule groups. + * @member {boolean} [requestBodyCheck] Whether allow WAF to check request + * Body. + * @member {number} [maxRequestBodySize] Maxium request body size for WAF. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayWebApplicationFirewallConfiguration + * + * @returns {object} metadata of ApplicationGatewayWebApplicationFirewallConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayWebApplicationFirewallConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayWebApplicationFirewallConfiguration', + modelProperties: { + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + firewallMode: { + required: true, + serializedName: 'firewallMode', + type: { + name: 'String' + } + }, + ruleSetType: { + required: true, + serializedName: 'ruleSetType', + type: { + name: 'String' + } + }, + ruleSetVersion: { + required: true, + serializedName: 'ruleSetVersion', + type: { + name: 'String' + } + }, + disabledRuleGroups: { + required: false, + serializedName: 'disabledRuleGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayFirewallDisabledRuleGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayFirewallDisabledRuleGroup' + } + } + } + }, + requestBodyCheck: { + required: false, + serializedName: 'requestBodyCheck', + type: { + name: 'Boolean' + } + }, + maxRequestBodySize: { + required: false, + serializedName: 'maxRequestBodySize', + constraints: { + InclusiveMaximum: 128, + InclusiveMinimum: 8 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayWebApplicationFirewallConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroup.js b/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroup.js new file mode 100644 index 0000000000..ee4bd13679 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroup.js @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An application security group in a resource group. + * + * @extends models['Resource'] + */ +class ApplicationSecurityGroup extends models['Resource'] { + /** + * Create a ApplicationSecurityGroup. + * @member {string} [resourceGuid] The resource GUID property of the + * application security group resource. It uniquely identifies a resource, + * even if the user changes its name or migrate the resource across + * subscriptions or resource groups. + * @member {string} [provisioningState] The provisioning state of the + * application security group resource. Possible values are: 'Succeeded', + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationSecurityGroup + * + * @returns {object} metadata of ApplicationSecurityGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationSecurityGroup', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroup', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resourceGuid: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationSecurityGroup; diff --git a/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroupListResult.js b/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroupListResult.js new file mode 100644 index 0000000000..0d6190e83a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/applicationSecurityGroupListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of application security groups. + */ +class ApplicationSecurityGroupListResult extends Array { + /** + * Create a ApplicationSecurityGroupListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationSecurityGroupListResult + * + * @returns {object} metadata of ApplicationSecurityGroupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationSecurityGroupListResult', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroupListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationSecurityGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/authorizationListResult.js b/lib/services/networkManagement2/lib/lib/models/authorizationListResult.js new file mode 100644 index 0000000000..187e7c18d8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/authorizationListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListAuthorizations API service call retrieves all + * authorizations that belongs to an ExpressRouteCircuit. + */ +class AuthorizationListResult extends Array { + /** + * Create a AuthorizationListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AuthorizationListResult + * + * @returns {object} metadata of AuthorizationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AuthorizationListResult', + type: { + name: 'Composite', + className: 'AuthorizationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitAuthorizationElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitAuthorization' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AuthorizationListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/availability.js b/lib/services/networkManagement2/lib/lib/models/availability.js new file mode 100644 index 0000000000..87dab9ec37 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availability.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Availability of the metric. + * + */ +class Availability { + /** + * Create a Availability. + * @member {string} [timeGrain] The time grain of the availability. + * @member {string} [retention] The retention of the availability. + * @member {string} [blobDuration] Duration of the availability blob. + */ + constructor() { + } + + /** + * Defines the metadata of Availability + * + * @returns {object} metadata of Availability + * + */ + mapper() { + return { + required: false, + serializedName: 'Availability', + type: { + name: 'Composite', + className: 'Availability', + modelProperties: { + timeGrain: { + required: false, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + required: false, + serializedName: 'retention', + type: { + name: 'String' + } + }, + blobDuration: { + required: false, + serializedName: 'blobDuration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Availability; diff --git a/lib/services/networkManagement2/lib/lib/models/availableProvidersList.js b/lib/services/networkManagement2/lib/lib/models/availableProvidersList.js new file mode 100644 index 0000000000..194eb44d45 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availableProvidersList.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of available countries with details. + * + */ +class AvailableProvidersList { + /** + * Create a AvailableProvidersList. + * @member {array} countries List of available countries. + */ + constructor() { + } + + /** + * Defines the metadata of AvailableProvidersList + * + * @returns {object} metadata of AvailableProvidersList + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableProvidersList', + type: { + name: 'Composite', + className: 'AvailableProvidersList', + modelProperties: { + countries: { + required: true, + serializedName: 'countries', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailableProvidersListCountryElementType', + type: { + name: 'Composite', + className: 'AvailableProvidersListCountry' + } + } + } + } + } + } + }; + } +} + +module.exports = AvailableProvidersList; diff --git a/lib/services/networkManagement2/lib/lib/models/availableProvidersListCity.js b/lib/services/networkManagement2/lib/lib/models/availableProvidersListCity.js new file mode 100644 index 0000000000..24cc8393a9 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availableProvidersListCity.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * City or town details. + * + */ +class AvailableProvidersListCity { + /** + * Create a AvailableProvidersListCity. + * @member {string} [cityName] The city or town name. + * @member {array} [providers] A list of Internet service providers. + */ + constructor() { + } + + /** + * Defines the metadata of AvailableProvidersListCity + * + * @returns {object} metadata of AvailableProvidersListCity + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableProvidersListCity', + type: { + name: 'Composite', + className: 'AvailableProvidersListCity', + modelProperties: { + cityName: { + required: false, + serializedName: 'cityName', + type: { + name: 'String' + } + }, + providers: { + required: false, + serializedName: 'providers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AvailableProvidersListCity; diff --git a/lib/services/networkManagement2/lib/lib/models/availableProvidersListCountry.js b/lib/services/networkManagement2/lib/lib/models/availableProvidersListCountry.js new file mode 100644 index 0000000000..e0377fb0f9 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availableProvidersListCountry.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Country details. + * + */ +class AvailableProvidersListCountry { + /** + * Create a AvailableProvidersListCountry. + * @member {string} [countryName] The country name. + * @member {array} [providers] A list of Internet service providers. + * @member {array} [states] List of available states in the country. + */ + constructor() { + } + + /** + * Defines the metadata of AvailableProvidersListCountry + * + * @returns {object} metadata of AvailableProvidersListCountry + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableProvidersListCountry', + type: { + name: 'Composite', + className: 'AvailableProvidersListCountry', + modelProperties: { + countryName: { + required: false, + serializedName: 'countryName', + type: { + name: 'String' + } + }, + providers: { + required: false, + serializedName: 'providers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + states: { + required: false, + serializedName: 'states', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailableProvidersListStateElementType', + type: { + name: 'Composite', + className: 'AvailableProvidersListState' + } + } + } + } + } + } + }; + } +} + +module.exports = AvailableProvidersListCountry; diff --git a/lib/services/networkManagement2/lib/lib/models/availableProvidersListParameters.js b/lib/services/networkManagement2/lib/lib/models/availableProvidersListParameters.js new file mode 100644 index 0000000000..e3faef0eeb --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availableProvidersListParameters.js @@ -0,0 +1,83 @@ +/* + * 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'; + +/** + * Constraints that determine the list of available Internet service providers. + * + */ +class AvailableProvidersListParameters { + /** + * Create a AvailableProvidersListParameters. + * @member {array} [azureLocations] A list of Azure regions. + * @member {string} [country] The country for available providers list. + * @member {string} [state] The state for available providers list. + * @member {string} [city] The city or town for available providers list. + */ + constructor() { + } + + /** + * Defines the metadata of AvailableProvidersListParameters + * + * @returns {object} metadata of AvailableProvidersListParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableProvidersListParameters', + type: { + name: 'Composite', + className: 'AvailableProvidersListParameters', + modelProperties: { + azureLocations: { + required: false, + serializedName: 'azureLocations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + country: { + required: false, + serializedName: 'country', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + }, + city: { + required: false, + serializedName: 'city', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableProvidersListParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/availableProvidersListState.js b/lib/services/networkManagement2/lib/lib/models/availableProvidersListState.js new file mode 100644 index 0000000000..238f7faf9e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/availableProvidersListState.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * State details. + * + */ +class AvailableProvidersListState { + /** + * Create a AvailableProvidersListState. + * @member {string} [stateName] The state name. + * @member {array} [providers] A list of Internet service providers. + * @member {array} [cities] List of available cities or towns in the state. + */ + constructor() { + } + + /** + * Defines the metadata of AvailableProvidersListState + * + * @returns {object} metadata of AvailableProvidersListState + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableProvidersListState', + type: { + name: 'Composite', + className: 'AvailableProvidersListState', + modelProperties: { + stateName: { + required: false, + serializedName: 'stateName', + type: { + name: 'String' + } + }, + providers: { + required: false, + serializedName: 'providers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + cities: { + required: false, + serializedName: 'cities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailableProvidersListCityElementType', + type: { + name: 'Composite', + className: 'AvailableProvidersListCity' + } + } + } + } + } + } + }; + } +} + +module.exports = AvailableProvidersListState; diff --git a/lib/services/networkManagement2/lib/lib/models/azureAsyncOperationResult.js b/lib/services/networkManagement2/lib/lib/models/azureAsyncOperationResult.js new file mode 100644 index 0000000000..1552f7dda1 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureAsyncOperationResult.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + * + */ +class AzureAsyncOperationResult { + /** + * Create a AzureAsyncOperationResult. + * @member {string} [status] Status of the Azure async operation. Possible + * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + * include: 'InProgress', 'Succeeded', 'Failed' + * @member {object} [error] + * @member {string} [error.code] + * @member {string} [error.message] + * @member {string} [error.target] + * @member {array} [error.details] + * @member {string} [error.innerError] + */ + constructor() { + } + + /** + * Defines the metadata of AzureAsyncOperationResult + * + * @returns {object} metadata of AzureAsyncOperationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureAsyncOperationResult', + type: { + name: 'Composite', + className: 'AzureAsyncOperationResult', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + } + } + } + }; + } +} + +module.exports = AzureAsyncOperationResult; diff --git a/lib/services/networkManagement2/lib/lib/models/azureReachabilityReport.js b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReport.js new file mode 100644 index 0000000000..9519e3683c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReport.js @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Azure reachability report details. + * + */ +class AzureReachabilityReport { + /** + * Create a AzureReachabilityReport. + * @member {string} aggregationLevel The aggregation level of Azure + * reachability report. Can be Country, State or City. + * @member {object} providerLocation + * @member {string} [providerLocation.country] The name of the country. + * @member {string} [providerLocation.state] The name of the state. + * @member {string} [providerLocation.city] The name of the city or town. + * @member {array} reachabilityReport List of Azure reachability report + * items. + */ + constructor() { + } + + /** + * Defines the metadata of AzureReachabilityReport + * + * @returns {object} metadata of AzureReachabilityReport + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureReachabilityReport', + type: { + name: 'Composite', + className: 'AzureReachabilityReport', + modelProperties: { + aggregationLevel: { + required: true, + serializedName: 'aggregationLevel', + type: { + name: 'String' + } + }, + providerLocation: { + required: true, + serializedName: 'providerLocation', + type: { + name: 'Composite', + className: 'AzureReachabilityReportLocation' + } + }, + reachabilityReport: { + required: true, + serializedName: 'reachabilityReport', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureReachabilityReportItemElementType', + type: { + name: 'Composite', + className: 'AzureReachabilityReportItem' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureReachabilityReport; diff --git a/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportItem.js b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportItem.js new file mode 100644 index 0000000000..292f5f26b1 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportItem.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Azure reachability report details for a given provider location. + * + */ +class AzureReachabilityReportItem { + /** + * Create a AzureReachabilityReportItem. + * @member {string} [provider] The Internet service provider. + * @member {string} [azureLocation] The Azure region. + * @member {array} [latencies] List of latency details for each of the time + * series. + */ + constructor() { + } + + /** + * Defines the metadata of AzureReachabilityReportItem + * + * @returns {object} metadata of AzureReachabilityReportItem + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureReachabilityReportItem', + type: { + name: 'Composite', + className: 'AzureReachabilityReportItem', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + azureLocation: { + required: false, + serializedName: 'azureLocation', + type: { + name: 'String' + } + }, + latencies: { + required: false, + serializedName: 'latencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureReachabilityReportLatencyInfoElementType', + type: { + name: 'Composite', + className: 'AzureReachabilityReportLatencyInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureReachabilityReportItem; diff --git a/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLatencyInfo.js b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLatencyInfo.js new file mode 100644 index 0000000000..48dab9ab63 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLatencyInfo.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details on latency for a time series. + * + */ +class AzureReachabilityReportLatencyInfo { + /** + * Create a AzureReachabilityReportLatencyInfo. + * @member {date} [timeStamp] The time stamp. + * @member {number} [score] The relative latency score between 1 and 100, + * higher values indicating a faster connection. + */ + constructor() { + } + + /** + * Defines the metadata of AzureReachabilityReportLatencyInfo + * + * @returns {object} metadata of AzureReachabilityReportLatencyInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureReachabilityReportLatencyInfo', + type: { + name: 'Composite', + className: 'AzureReachabilityReportLatencyInfo', + modelProperties: { + timeStamp: { + required: false, + serializedName: 'timeStamp', + type: { + name: 'DateTime' + } + }, + score: { + required: false, + serializedName: 'score', + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AzureReachabilityReportLatencyInfo; diff --git a/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLocation.js b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLocation.js new file mode 100644 index 0000000000..07582ba250 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLocation.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Parameters that define a geographic location. + * + */ +class AzureReachabilityReportLocation { + /** + * Create a AzureReachabilityReportLocation. + * @member {string} country The name of the country. + * @member {string} [state] The name of the state. + * @member {string} [city] The name of the city or town. + */ + constructor() { + } + + /** + * Defines the metadata of AzureReachabilityReportLocation + * + * @returns {object} metadata of AzureReachabilityReportLocation + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureReachabilityReportLocation', + type: { + name: 'Composite', + className: 'AzureReachabilityReportLocation', + modelProperties: { + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + }, + city: { + required: false, + serializedName: 'city', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureReachabilityReportLocation; diff --git a/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportParameters.js b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportParameters.js new file mode 100644 index 0000000000..c9c96c1a94 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/azureReachabilityReportParameters.js @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Geographic and time constraints for Azure reachability report. + * + */ +class AzureReachabilityReportParameters { + /** + * Create a AzureReachabilityReportParameters. + * @member {object} providerLocation + * @member {string} [providerLocation.country] The name of the country. + * @member {string} [providerLocation.state] The name of the state. + * @member {string} [providerLocation.city] The name of the city or town. + * @member {array} [providers] List of Internet service providers. + * @member {array} [azureLocations] Optional Azure regions to scope the query + * to. + * @member {date} startTime The start time for the Azure reachability report. + * @member {date} endTime The end time for the Azure reachability report. + */ + constructor() { + } + + /** + * Defines the metadata of AzureReachabilityReportParameters + * + * @returns {object} metadata of AzureReachabilityReportParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureReachabilityReportParameters', + type: { + name: 'Composite', + className: 'AzureReachabilityReportParameters', + modelProperties: { + providerLocation: { + required: true, + serializedName: 'providerLocation', + type: { + name: 'Composite', + className: 'AzureReachabilityReportLocation' + } + }, + providers: { + required: false, + serializedName: 'providers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + azureLocations: { + required: false, + serializedName: 'azureLocations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + startTime: { + required: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = AzureReachabilityReportParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/bGPCommunity.js b/lib/services/networkManagement2/lib/lib/models/bGPCommunity.js new file mode 100644 index 0000000000..aba7366bf6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bGPCommunity.js @@ -0,0 +1,106 @@ +/* + * 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'; + +/** + * Contains bgp community information offered in Service Community resources. + * + */ +class BGPCommunity { + /** + * Create a BGPCommunity. + * @member {string} [serviceSupportedRegion] The region which the service + * support. e.g. For O365, region is Global. + * @member {string} [communityName] The name of the bgp community. e.g. + * Skype. + * @member {string} [communityValue] The value of the bgp community. For more + * information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * @member {array} [communityPrefixes] The prefixes that the bgp community + * contains. + * @member {boolean} [isAuthorizedToUse] Customer is authorized to use bgp + * community or not. + * @member {string} [serviceGroup] The service group of the bgp community + * contains. + */ + constructor() { + } + + /** + * Defines the metadata of BGPCommunity + * + * @returns {object} metadata of BGPCommunity + * + */ + mapper() { + return { + required: false, + serializedName: 'BGPCommunity', + type: { + name: 'Composite', + className: 'BGPCommunity', + modelProperties: { + serviceSupportedRegion: { + required: false, + serializedName: 'serviceSupportedRegion', + type: { + name: 'String' + } + }, + communityName: { + required: false, + serializedName: 'communityName', + type: { + name: 'String' + } + }, + communityValue: { + required: false, + serializedName: 'communityValue', + type: { + name: 'String' + } + }, + communityPrefixes: { + required: false, + serializedName: 'communityPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isAuthorizedToUse: { + required: false, + serializedName: 'isAuthorizedToUse', + type: { + name: 'Boolean' + } + }, + serviceGroup: { + required: false, + serializedName: 'serviceGroup', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BGPCommunity; diff --git a/lib/services/networkManagement2/lib/lib/models/backendAddressPool.js b/lib/services/networkManagement2/lib/lib/models/backendAddressPool.js new file mode 100644 index 0000000000..5311a4e163 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/backendAddressPool.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Pool of backend IP addresses. + * + * @extends models['SubResource'] + */ +class BackendAddressPool extends models['SubResource'] { + /** + * Create a BackendAddressPool. + * @member {array} [backendIPConfigurations] Gets collection of references to + * IP addresses defined in network interfaces. + * @member {array} [loadBalancingRules] Gets load balancing rules that use + * this backend address pool. + * @member {object} [outboundNatRule] Gets outbound rules that use this + * backend address pool. + * @member {string} [outboundNatRule.id] Resource ID. + * @member {string} [provisioningState] Get provisioning state of the public + * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackendAddressPool + * + * @returns {object} metadata of BackendAddressPool + * + */ + mapper() { + return { + required: false, + serializedName: 'BackendAddressPool', + type: { + name: 'Composite', + className: 'BackendAddressPool', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + backendIPConfigurations: { + required: false, + readOnly: true, + serializedName: 'properties.backendIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceIPConfigurationElementType', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + } + } + }, + loadBalancingRules: { + required: false, + readOnly: true, + serializedName: 'properties.loadBalancingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + outboundNatRule: { + required: false, + readOnly: true, + serializedName: 'properties.outboundNatRule', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackendAddressPool; diff --git a/lib/services/networkManagement2/lib/lib/models/bgpPeerStatus.js b/lib/services/networkManagement2/lib/lib/models/bgpPeerStatus.js new file mode 100644 index 0000000000..1bd7bbb91b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bgpPeerStatus.js @@ -0,0 +1,119 @@ +/* + * 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'; + +/** + * BGP peer status details + * + */ +class BgpPeerStatus { + /** + * Create a BgpPeerStatus. + * @member {string} [localAddress] The virtual network gateway's local + * address + * @member {string} [neighbor] The remote BGP peer + * @member {number} [asn] The autonomous system number of the remote BGP peer + * @member {string} [state] The BGP peer state. Possible values include: + * 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' + * @member {string} [connectedDuration] For how long the peering has been up + * @member {number} [routesReceived] The number of routes learned from this + * peer + * @member {number} [messagesSent] The number of BGP messages sent + * @member {number} [messagesReceived] The number of BGP messages received + */ + constructor() { + } + + /** + * Defines the metadata of BgpPeerStatus + * + * @returns {object} metadata of BgpPeerStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'BgpPeerStatus', + type: { + name: 'Composite', + className: 'BgpPeerStatus', + modelProperties: { + localAddress: { + required: false, + readOnly: true, + serializedName: 'localAddress', + type: { + name: 'String' + } + }, + neighbor: { + required: false, + readOnly: true, + serializedName: 'neighbor', + type: { + name: 'String' + } + }, + asn: { + required: false, + readOnly: true, + serializedName: 'asn', + type: { + name: 'Number' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + connectedDuration: { + required: false, + readOnly: true, + serializedName: 'connectedDuration', + type: { + name: 'String' + } + }, + routesReceived: { + required: false, + readOnly: true, + serializedName: 'routesReceived', + type: { + name: 'Number' + } + }, + messagesSent: { + required: false, + readOnly: true, + serializedName: 'messagesSent', + type: { + name: 'Number' + } + }, + messagesReceived: { + required: false, + readOnly: true, + serializedName: 'messagesReceived', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = BgpPeerStatus; diff --git a/lib/services/networkManagement2/lib/lib/models/bgpPeerStatusListResult.js b/lib/services/networkManagement2/lib/lib/models/bgpPeerStatusListResult.js new file mode 100644 index 0000000000..ef14531f3f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bgpPeerStatusListResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for list BGP peer status API service call + * + */ +class BgpPeerStatusListResult { + /** + * Create a BgpPeerStatusListResult. + * @member {array} [value] List of BGP peers + */ + constructor() { + } + + /** + * Defines the metadata of BgpPeerStatusListResult + * + * @returns {object} metadata of BgpPeerStatusListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BgpPeerStatusListResult', + type: { + name: 'Composite', + className: 'BgpPeerStatusListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BgpPeerStatusElementType', + type: { + name: 'Composite', + className: 'BgpPeerStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = BgpPeerStatusListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunity.js b/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunity.js new file mode 100644 index 0000000000..4a174fe080 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunity.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Service Community Properties. + * + * @extends models['Resource'] + */ +class BgpServiceCommunity extends models['Resource'] { + /** + * Create a BgpServiceCommunity. + * @member {string} [serviceName] The name of the bgp community. e.g. Skype. + * @member {array} [bgpCommunities] Get a list of bgp communities. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BgpServiceCommunity + * + * @returns {object} metadata of BgpServiceCommunity + * + */ + mapper() { + return { + required: false, + serializedName: 'BgpServiceCommunity', + type: { + name: 'Composite', + className: 'BgpServiceCommunity', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + serviceName: { + required: false, + serializedName: 'properties.serviceName', + type: { + name: 'String' + } + }, + bgpCommunities: { + required: false, + serializedName: 'properties.bgpCommunities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BGPCommunityElementType', + type: { + name: 'Composite', + className: 'BGPCommunity' + } + } + } + } + } + } + }; + } +} + +module.exports = BgpServiceCommunity; diff --git a/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunityListResult.js b/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunityListResult.js new file mode 100644 index 0000000000..7db298d442 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bgpServiceCommunityListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListServiceCommunity API service call. + */ +class BgpServiceCommunityListResult extends Array { + /** + * Create a BgpServiceCommunityListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BgpServiceCommunityListResult + * + * @returns {object} metadata of BgpServiceCommunityListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BgpServiceCommunityListResult', + type: { + name: 'Composite', + className: 'BgpServiceCommunityListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BgpServiceCommunityElementType', + type: { + name: 'Composite', + className: 'BgpServiceCommunity' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BgpServiceCommunityListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/bgpSettings.js b/lib/services/networkManagement2/lib/lib/models/bgpSettings.js new file mode 100644 index 0000000000..dca7b0f07c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/bgpSettings.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * BGP settings details + * + */ +class BgpSettings { + /** + * Create a BgpSettings. + * @member {number} [asn] The BGP speaker's ASN. + * @member {string} [bgpPeeringAddress] The BGP peering address and BGP + * identifier of this BGP speaker. + * @member {number} [peerWeight] The weight added to routes learned from this + * BGP speaker. + */ + constructor() { + } + + /** + * Defines the metadata of BgpSettings + * + * @returns {object} metadata of BgpSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'BgpSettings', + type: { + name: 'Composite', + className: 'BgpSettings', + modelProperties: { + asn: { + required: false, + serializedName: 'asn', + type: { + name: 'Number' + } + }, + bgpPeeringAddress: { + required: false, + serializedName: 'bgpPeeringAddress', + type: { + name: 'String' + } + }, + peerWeight: { + required: false, + serializedName: 'peerWeight', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = BgpSettings; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitor.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitor.js new file mode 100644 index 0000000000..d690fcf86d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitor.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the operation to create a connection monitor. + * + */ +class ConnectionMonitor { + /** + * Create a ConnectionMonitor. + * @member {string} [location] Connection monitor location. + * @member {object} [tags] Connection monitor tags. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as + * the destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by + * connection monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitor + * + * @returns {object} metadata of ConnectionMonitor + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitor', + type: { + name: 'Composite', + className: 'ConnectionMonitor', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + source: { + required: true, + serializedName: 'properties.source', + type: { + name: 'Composite', + className: 'ConnectionMonitorSource' + } + }, + destination: { + required: true, + serializedName: 'properties.destination', + type: { + name: 'Composite', + className: 'ConnectionMonitorDestination' + } + }, + autoStart: { + required: false, + serializedName: 'properties.autoStart', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + monitoringIntervalInSeconds: { + required: false, + serializedName: 'properties.monitoringIntervalInSeconds', + defaultValue: 60, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitor; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorDestination.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorDestination.js new file mode 100644 index 0000000000..063b721c85 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorDestination.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Describes the destination of connection monitor. + * + */ +class ConnectionMonitorDestination { + /** + * Create a ConnectionMonitorDestination. + * @member {string} [resourceId] The ID of the resource used as the + * destination by connection monitor. + * @member {string} [address] Address of the connection monitor destination + * (IP or domain name). + * @member {number} [port] The destination port used by connection monitor. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitorDestination + * + * @returns {object} metadata of ConnectionMonitorDestination + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorDestination', + type: { + name: 'Composite', + className: 'ConnectionMonitorDestination', + modelProperties: { + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + address: { + required: false, + serializedName: 'address', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorDestination; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorListResult.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorListResult.js new file mode 100644 index 0000000000..d9a476a324 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorListResult.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * List of connection monitors. + */ +class ConnectionMonitorListResult extends Array { + /** + * Create a ConnectionMonitorListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectionMonitorListResult + * + * @returns {object} metadata of ConnectionMonitorListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorListResult', + type: { + name: 'Composite', + className: 'ConnectionMonitorListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectionMonitorResultElementType', + type: { + name: 'Composite', + className: 'ConnectionMonitorResult' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorParameters.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorParameters.js new file mode 100644 index 0000000000..513f5d6b79 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorParameters.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the operation to create a connection monitor. + * + */ +class ConnectionMonitorParameters { + /** + * Create a ConnectionMonitorParameters. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as + * the destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by + * connection monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitorParameters + * + * @returns {object} metadata of ConnectionMonitorParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorParameters', + type: { + name: 'Composite', + className: 'ConnectionMonitorParameters', + modelProperties: { + source: { + required: true, + serializedName: 'source', + type: { + name: 'Composite', + className: 'ConnectionMonitorSource' + } + }, + destination: { + required: true, + serializedName: 'destination', + type: { + name: 'Composite', + className: 'ConnectionMonitorDestination' + } + }, + autoStart: { + required: false, + serializedName: 'autoStart', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + monitoringIntervalInSeconds: { + required: false, + serializedName: 'monitoringIntervalInSeconds', + defaultValue: 60, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorQueryResult.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorQueryResult.js new file mode 100644 index 0000000000..8b78a35d32 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorQueryResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of connection states snaphots. + * + */ +class ConnectionMonitorQueryResult { + /** + * Create a ConnectionMonitorQueryResult. + * @member {array} [states] Information about connection states. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitorQueryResult + * + * @returns {object} metadata of ConnectionMonitorQueryResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorQueryResult', + type: { + name: 'Composite', + className: 'ConnectionMonitorQueryResult', + modelProperties: { + states: { + required: false, + serializedName: 'states', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectionStateSnapshotElementType', + type: { + name: 'Composite', + className: 'ConnectionStateSnapshot' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorQueryResult; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorResult.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorResult.js new file mode 100644 index 0000000000..a26ce4b8f8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorResult.js @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information about the connection monitor. + * + * @extends models['BaseResource'] + */ +class ConnectionMonitorResult extends models['BaseResource'] { + /** + * Create a ConnectionMonitorResult. + * @member {string} [name] Name of the connection monitor. + * @member {string} [id] ID of the connection monitor. + * @member {string} [etag] Default value: 'A unique read-only string that + * changes whenever the resource is updated.' . + * @member {string} [type] Connection monitor type. + * @member {string} [location] Connection monitor location. + * @member {object} [tags] Connection monitor tags. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as + * the destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by + * connection monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + * @member {string} [provisioningState] The provisioning state of the + * connection monitor. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * @member {date} [startTime] The date and time when the connection monitor + * was started. + * @member {string} [monitoringStatus] The monitoring status of the + * connection monitor. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectionMonitorResult + * + * @returns {object} metadata of ConnectionMonitorResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorResult', + type: { + name: 'Composite', + className: 'ConnectionMonitorResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + defaultValue: 'A unique read-only string that changes whenever the resource is updated.', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + source: { + required: true, + serializedName: 'properties.source', + type: { + name: 'Composite', + className: 'ConnectionMonitorSource' + } + }, + destination: { + required: true, + serializedName: 'properties.destination', + type: { + name: 'Composite', + className: 'ConnectionMonitorDestination' + } + }, + autoStart: { + required: false, + serializedName: 'properties.autoStart', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + monitoringIntervalInSeconds: { + required: false, + serializedName: 'properties.monitoringIntervalInSeconds', + defaultValue: 60, + type: { + name: 'Number' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + monitoringStatus: { + required: false, + serializedName: 'properties.monitoringStatus', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorResult; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionMonitorSource.js b/lib/services/networkManagement2/lib/lib/models/connectionMonitorSource.js new file mode 100644 index 0000000000..135c604d84 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionMonitorSource.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the source of connection monitor. + * + */ +class ConnectionMonitorSource { + /** + * Create a ConnectionMonitorSource. + * @member {string} resourceId The ID of the resource used as the source by + * connection monitor. + * @member {number} [port] The source port used by connection monitor. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitorSource + * + * @returns {object} metadata of ConnectionMonitorSource + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorSource', + type: { + name: 'Composite', + className: 'ConnectionMonitorSource', + modelProperties: { + resourceId: { + required: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorSource; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionResetSharedKey.js b/lib/services/networkManagement2/lib/lib/models/connectionResetSharedKey.js new file mode 100644 index 0000000000..1e6a955c42 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionResetSharedKey.js @@ -0,0 +1,57 @@ +/* + * 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'; + +/** + * The virtual network connection reset shared key + * + */ +class ConnectionResetSharedKey { + /** + * Create a ConnectionResetSharedKey. + * @member {number} keyLength The virtual network connection reset shared key + * length, should between 1 and 128. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionResetSharedKey + * + * @returns {object} metadata of ConnectionResetSharedKey + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionResetSharedKey', + type: { + name: 'Composite', + className: 'ConnectionResetSharedKey', + modelProperties: { + keyLength: { + required: true, + serializedName: 'keyLength', + constraints: { + InclusiveMaximum: 128, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectionResetSharedKey; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionSharedKey.js b/lib/services/networkManagement2/lib/lib/models/connectionSharedKey.js new file mode 100644 index 0000000000..a74b9eeeca --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionSharedKey.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Response for GetConnectionSharedKey API service call + * + */ +class ConnectionSharedKey { + /** + * Create a ConnectionSharedKey. + * @member {string} value The virtual network connection shared key value. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionSharedKey + * + * @returns {object} metadata of ConnectionSharedKey + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionSharedKey', + type: { + name: 'Composite', + className: 'ConnectionSharedKey', + modelProperties: { + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectionSharedKey; diff --git a/lib/services/networkManagement2/lib/lib/models/connectionStateSnapshot.js b/lib/services/networkManagement2/lib/lib/models/connectionStateSnapshot.js new file mode 100644 index 0000000000..ccf3aeec06 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectionStateSnapshot.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Connection state snapshot. + * + */ +class ConnectionStateSnapshot { + /** + * Create a ConnectionStateSnapshot. + * @member {string} [connectionState] The connection state. Possible values + * include: 'Reachable', 'Unreachable', 'Unknown' + * @member {date} [startTime] The start time of the connection snapshot. + * @member {date} [endTime] The end time of the connection snapshot. + * @member {string} [evaluationState] Connectivity analysis evaluation state. + * Possible values include: 'NotStarted', 'InProgress', 'Completed' + * @member {array} [hops] List of hops between the source and the + * destination. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionStateSnapshot + * + * @returns {object} metadata of ConnectionStateSnapshot + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionStateSnapshot', + type: { + name: 'Composite', + className: 'ConnectionStateSnapshot', + modelProperties: { + connectionState: { + required: false, + serializedName: 'connectionState', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + evaluationState: { + required: false, + serializedName: 'evaluationState', + type: { + name: 'String' + } + }, + hops: { + required: false, + readOnly: true, + serializedName: 'hops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectivityHopElementType', + type: { + name: 'Composite', + className: 'ConnectivityHop' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectionStateSnapshot; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivityDestination.js b/lib/services/networkManagement2/lib/lib/models/connectivityDestination.js new file mode 100644 index 0000000000..e5fa257881 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivityDestination.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Parameters that define destination of connection. + * + */ +class ConnectivityDestination { + /** + * Create a ConnectivityDestination. + * @member {string} [resourceId] The ID of the resource to which a connection + * attempt will be made. + * @member {string} [address] The IP address or URI the resource to which a + * connection attempt will be made. + * @member {number} [port] Port on which check connectivity will be + * performed. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivityDestination + * + * @returns {object} metadata of ConnectivityDestination + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivityDestination', + type: { + name: 'Composite', + className: 'ConnectivityDestination', + modelProperties: { + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + address: { + required: false, + serializedName: 'address', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectivityDestination; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivityHop.js b/lib/services/networkManagement2/lib/lib/models/connectivityHop.js new file mode 100644 index 0000000000..dd478e4963 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivityHop.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information about a hop between the source and the destination. + * + */ +class ConnectivityHop { + /** + * Create a ConnectivityHop. + * @member {string} [type] The type of the hop. + * @member {string} [id] The ID of the hop. + * @member {string} [address] The IP address of the hop. + * @member {string} [resourceId] The ID of the resource corresponding to this + * hop. + * @member {array} [nextHopIds] List of next hop identifiers. + * @member {array} [issues] List of issues. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivityHop + * + * @returns {object} metadata of ConnectivityHop + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivityHop', + type: { + name: 'Composite', + className: 'ConnectivityHop', + modelProperties: { + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + address: { + required: false, + readOnly: true, + serializedName: 'address', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + nextHopIds: { + required: false, + readOnly: true, + serializedName: 'nextHopIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + issues: { + required: false, + readOnly: true, + serializedName: 'issues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectivityIssueElementType', + type: { + name: 'Composite', + className: 'ConnectivityIssue' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectivityHop; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivityInformation.js b/lib/services/networkManagement2/lib/lib/models/connectivityInformation.js new file mode 100644 index 0000000000..4f238a8b0d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivityInformation.js @@ -0,0 +1,119 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information on the connectivity status. + * + */ +class ConnectivityInformation { + /** + * Create a ConnectivityInformation. + * @member {array} [hops] List of hops between the source and the + * destination. + * @member {string} [connectionStatus] The connection status. Possible values + * include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' + * @member {number} [avgLatencyInMs] Average latency in milliseconds. + * @member {number} [minLatencyInMs] Minimum latency in milliseconds. + * @member {number} [maxLatencyInMs] Maximum latency in milliseconds. + * @member {number} [probesSent] Total number of probes sent. + * @member {number} [probesFailed] Number of failed probes. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivityInformation + * + * @returns {object} metadata of ConnectivityInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivityInformation', + type: { + name: 'Composite', + className: 'ConnectivityInformation', + modelProperties: { + hops: { + required: false, + readOnly: true, + serializedName: 'hops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectivityHopElementType', + type: { + name: 'Composite', + className: 'ConnectivityHop' + } + } + } + }, + connectionStatus: { + required: false, + readOnly: true, + serializedName: 'connectionStatus', + type: { + name: 'String' + } + }, + avgLatencyInMs: { + required: false, + readOnly: true, + serializedName: 'avgLatencyInMs', + type: { + name: 'Number' + } + }, + minLatencyInMs: { + required: false, + readOnly: true, + serializedName: 'minLatencyInMs', + type: { + name: 'Number' + } + }, + maxLatencyInMs: { + required: false, + readOnly: true, + serializedName: 'maxLatencyInMs', + type: { + name: 'Number' + } + }, + probesSent: { + required: false, + readOnly: true, + serializedName: 'probesSent', + type: { + name: 'Number' + } + }, + probesFailed: { + required: false, + readOnly: true, + serializedName: 'probesFailed', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectivityInformation; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivityIssue.js b/lib/services/networkManagement2/lib/lib/models/connectivityIssue.js new file mode 100644 index 0000000000..573c4f2c17 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivityIssue.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Information about an issue encountered in the process of checking for + * connectivity. + * + */ +class ConnectivityIssue { + /** + * Create a ConnectivityIssue. + * @member {string} [origin] The origin of the issue. Possible values + * include: 'Local', 'Inbound', 'Outbound' + * @member {string} [severity] The severity of the issue. Possible values + * include: 'Error', 'Warning' + * @member {string} [type] The type of issue. Possible values include: + * 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + * 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + * @member {array} [context] Provides additional context on the issue. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivityIssue + * + * @returns {object} metadata of ConnectivityIssue + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivityIssue', + type: { + name: 'Composite', + className: 'ConnectivityIssue', + modelProperties: { + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + }, + severity: { + required: false, + readOnly: true, + serializedName: 'severity', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + context: { + required: false, + readOnly: true, + serializedName: 'context', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectivityIssue; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivityParameters.js b/lib/services/networkManagement2/lib/lib/models/connectivityParameters.js new file mode 100644 index 0000000000..28edbba72a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivityParameters.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that determine how the connectivity check will be performed. + * + */ +class ConnectivityParameters { + /** + * Create a ConnectivityParameters. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource from which a + * connectivity check will be initiated. + * @member {number} [source.port] The source port from which a connectivity + * check will be performed. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource to which + * a connection attempt will be made. + * @member {string} [destination.address] The IP address or URI the resource + * to which a connection attempt will be made. + * @member {number} [destination.port] Port on which check connectivity will + * be performed. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivityParameters + * + * @returns {object} metadata of ConnectivityParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivityParameters', + type: { + name: 'Composite', + className: 'ConnectivityParameters', + modelProperties: { + source: { + required: true, + serializedName: 'source', + type: { + name: 'Composite', + className: 'ConnectivitySource' + } + }, + destination: { + required: true, + serializedName: 'destination', + type: { + name: 'Composite', + className: 'ConnectivityDestination' + } + } + } + } + }; + } +} + +module.exports = ConnectivityParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/connectivitySource.js b/lib/services/networkManagement2/lib/lib/models/connectivitySource.js new file mode 100644 index 0000000000..a27b2ab62e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/connectivitySource.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Parameters that define the source of the connection. + * + */ +class ConnectivitySource { + /** + * Create a ConnectivitySource. + * @member {string} resourceId The ID of the resource from which a + * connectivity check will be initiated. + * @member {number} [port] The source port from which a connectivity check + * will be performed. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectivitySource + * + * @returns {object} metadata of ConnectivitySource + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectivitySource', + type: { + name: 'Composite', + className: 'ConnectivitySource', + modelProperties: { + resourceId: { + required: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ConnectivitySource; diff --git a/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlan.js b/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlan.js new file mode 100644 index 0000000000..d246e24d1f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlan.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A DDoS protection plan in a resource group. + * + * @extends models['Resource'] + */ +class DdosProtectionPlan extends models['Resource'] { + /** + * Create a DdosProtectionPlan. + * @member {string} [resourceGuid] The resource GUID property of the DDoS + * protection plan resource. It uniquely identifies the resource, even if the + * user changes its name or migrate the resource across subscriptions or + * resource groups. + * @member {string} [provisioningState] The provisioning state of the DDoS + * protection plan resource. Possible values are: 'Succeeded', 'Updating', + * 'Deleting', and 'Failed'. + * @member {array} [virtualNetworks] The list of virtual networks associated + * with the DDoS protection plan resource. This list is read-only. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DdosProtectionPlan + * + * @returns {object} metadata of DdosProtectionPlan + * + */ + mapper() { + return { + required: false, + serializedName: 'DdosProtectionPlan', + type: { + name: 'Composite', + className: 'DdosProtectionPlan', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resourceGuid: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + virtualNetworks: { + required: false, + readOnly: true, + serializedName: 'properties.virtualNetworks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DdosProtectionPlan; diff --git a/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlanListResult.js b/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlanListResult.js new file mode 100644 index 0000000000..076979f5cd --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/ddosProtectionPlanListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of DDoS protection plans. + */ +class DdosProtectionPlanListResult extends Array { + /** + * Create a DdosProtectionPlanListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DdosProtectionPlanListResult + * + * @returns {object} metadata of DdosProtectionPlanListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DdosProtectionPlanListResult', + type: { + name: 'Composite', + className: 'DdosProtectionPlanListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DdosProtectionPlanElementType', + type: { + name: 'Composite', + className: 'DdosProtectionPlan' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DdosProtectionPlanListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/dhcpOptions.js b/lib/services/networkManagement2/lib/lib/models/dhcpOptions.js new file mode 100644 index 0000000000..a610247325 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/dhcpOptions.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in + * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + * options. + * + */ +class DhcpOptions { + /** + * Create a DhcpOptions. + * @member {array} [dnsServers] The list of DNS servers IP addresses. + */ + constructor() { + } + + /** + * Defines the metadata of DhcpOptions + * + * @returns {object} metadata of DhcpOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'DhcpOptions', + type: { + name: 'Composite', + className: 'DhcpOptions', + modelProperties: { + dnsServers: { + required: false, + serializedName: 'dnsServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DhcpOptions; diff --git a/lib/services/networkManagement2/lib/lib/models/dimension.js b/lib/services/networkManagement2/lib/lib/models/dimension.js new file mode 100644 index 0000000000..2f79fd6dd3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/dimension.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Dimension of the metric. + * + */ +class Dimension { + /** + * Create a Dimension. + * @member {string} [name] The name of the dimension. + * @member {string} [displayName] The display name of the dimension. + * @member {string} [internalName] The internal name of the dimension. + */ + constructor() { + } + + /** + * Defines the metadata of Dimension + * + * @returns {object} metadata of Dimension + * + */ + mapper() { + return { + required: false, + serializedName: 'Dimension', + type: { + name: 'Composite', + className: 'Dimension', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + internalName: { + required: false, + serializedName: 'internalName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Dimension; diff --git a/lib/services/networkManagement2/lib/lib/models/dnsNameAvailabilityResult.js b/lib/services/networkManagement2/lib/lib/models/dnsNameAvailabilityResult.js new file mode 100644 index 0000000000..4e6553cf7c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/dnsNameAvailabilityResult.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Response for the CheckDnsNameAvailability API service call. + * + */ +class DnsNameAvailabilityResult { + /** + * Create a DnsNameAvailabilityResult. + * @member {boolean} [available] Domain availability (True/False). + */ + constructor() { + } + + /** + * Defines the metadata of DnsNameAvailabilityResult + * + * @returns {object} metadata of DnsNameAvailabilityResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DnsNameAvailabilityResult', + type: { + name: 'Composite', + className: 'DnsNameAvailabilityResult', + modelProperties: { + available: { + required: false, + serializedName: 'available', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DnsNameAvailabilityResult; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroup.js b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroup.js new file mode 100644 index 0000000000..67708def1f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroup.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Effective network security group. + * + */ +class EffectiveNetworkSecurityGroup { + /** + * Create a EffectiveNetworkSecurityGroup. + * @member {object} [networkSecurityGroup] The ID of network security group + * that is applied. + * @member {string} [networkSecurityGroup.id] Resource ID. + * @member {object} [association] Associated resources. + * @member {object} [association.subnet] The ID of the subnet if assigned. + * @member {string} [association.subnet.id] Resource ID. + * @member {object} [association.networkInterface] The ID of the network + * interface if assigned. + * @member {string} [association.networkInterface.id] Resource ID. + * @member {array} [effectiveSecurityRules] A collection of effective + * security rules. + * @member {object} [tagMap] Mapping of tags to list of IP Addresses included + * within the tag. + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveNetworkSecurityGroup + * + * @returns {object} metadata of EffectiveNetworkSecurityGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveNetworkSecurityGroup', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroup', + modelProperties: { + networkSecurityGroup: { + required: false, + serializedName: 'networkSecurityGroup', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + association: { + required: false, + serializedName: 'association', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroupAssociation' + } + }, + effectiveSecurityRules: { + required: false, + serializedName: 'effectiveSecurityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EffectiveNetworkSecurityRuleElementType', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityRule' + } + } + } + }, + tagMap: { + required: false, + serializedName: 'tagMap', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + } + }; + } +} + +module.exports = EffectiveNetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupAssociation.js b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupAssociation.js new file mode 100644 index 0000000000..cf0fce59e3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupAssociation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The effective network security group association. + * + */ +class EffectiveNetworkSecurityGroupAssociation { + /** + * Create a EffectiveNetworkSecurityGroupAssociation. + * @member {object} [subnet] The ID of the subnet if assigned. + * @member {string} [subnet.id] Resource ID. + * @member {object} [networkInterface] The ID of the network interface if + * assigned. + * @member {string} [networkInterface.id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveNetworkSecurityGroupAssociation + * + * @returns {object} metadata of EffectiveNetworkSecurityGroupAssociation + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveNetworkSecurityGroupAssociation', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroupAssociation', + modelProperties: { + subnet: { + required: false, + serializedName: 'subnet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + networkInterface: { + required: false, + serializedName: 'networkInterface', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + }; + } +} + +module.exports = EffectiveNetworkSecurityGroupAssociation; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupListResult.js b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupListResult.js new file mode 100644 index 0000000000..08511ae7c1 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupListResult.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for list effective network security groups API service call. + * + */ +class EffectiveNetworkSecurityGroupListResult { + /** + * Create a EffectiveNetworkSecurityGroupListResult. + * @member {array} [value] A list of effective network security groups. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveNetworkSecurityGroupListResult + * + * @returns {object} metadata of EffectiveNetworkSecurityGroupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveNetworkSecurityGroupListResult', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroupListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EffectiveNetworkSecurityGroupElementType', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EffectiveNetworkSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityRule.js b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityRule.js new file mode 100644 index 0000000000..736aa984d6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityRule.js @@ -0,0 +1,225 @@ +/* + * 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'; + +/** + * Effective network security rules. + * + */ +class EffectiveNetworkSecurityRule { + /** + * Create a EffectiveNetworkSecurityRule. + * @member {string} [name] The name of the security rule specified by the + * user (if created by the user). + * @member {string} [protocol] The network protocol this rule applies to. + * Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: + * 'Tcp', 'Udp', 'All' + * @member {string} [sourcePortRange] The source port or range. + * @member {string} [destinationPortRange] The destination port or range. + * @member {array} [sourcePortRanges] The source port ranges. Expected values + * include a single integer between 0 and 65535, a range using '-' as + * seperator (e.g. 100-400), or an asterix (*) + * @member {array} [destinationPortRanges] The destination port ranges. + * Expected values include a single integer between 0 and 65535, a range + * using '-' as seperator (e.g. 100-400), or an asterix (*) + * @member {string} [sourceAddressPrefix] The source address prefix. + * @member {string} [destinationAddressPrefix] The destination address + * prefix. + * @member {array} [sourceAddressPrefixes] The source address prefixes. + * Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AureLoadBalancer, Internet), System Tags, and the asterix (*). + * @member {array} [destinationAddressPrefixes] The destination address + * prefixes. Expected values include CIDR IP ranges, Default Tags + * (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix + * (*). + * @member {array} [expandedSourceAddressPrefix] The expanded source address + * prefix. + * @member {array} [expandedDestinationAddressPrefix] Expanded destination + * address prefix. + * @member {string} [access] Whether network traffic is allowed or denied. + * Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + * 'Deny' + * @member {number} [priority] The priority of the rule. + * @member {string} [direction] The direction of the rule. Possible values + * are: 'Inbound and Outbound'. Possible values include: 'Inbound', + * 'Outbound' + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveNetworkSecurityRule + * + * @returns {object} metadata of EffectiveNetworkSecurityRule + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveNetworkSecurityRule', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityRule', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + protocol: { + required: false, + serializedName: 'protocol', + type: { + name: 'String' + } + }, + sourcePortRange: { + required: false, + serializedName: 'sourcePortRange', + type: { + name: 'String' + } + }, + destinationPortRange: { + required: false, + serializedName: 'destinationPortRange', + type: { + name: 'String' + } + }, + sourcePortRanges: { + required: false, + serializedName: 'sourcePortRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationPortRanges: { + required: false, + serializedName: 'destinationPortRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceAddressPrefix: { + required: false, + serializedName: 'sourceAddressPrefix', + type: { + name: 'String' + } + }, + destinationAddressPrefix: { + required: false, + serializedName: 'destinationAddressPrefix', + type: { + name: 'String' + } + }, + sourceAddressPrefixes: { + required: false, + serializedName: 'sourceAddressPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationAddressPrefixes: { + required: false, + serializedName: 'destinationAddressPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expandedSourceAddressPrefix: { + required: false, + serializedName: 'expandedSourceAddressPrefix', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expandedDestinationAddressPrefix: { + required: false, + serializedName: 'expandedDestinationAddressPrefix', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + access: { + required: false, + serializedName: 'access', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + direction: { + required: false, + serializedName: 'direction', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EffectiveNetworkSecurityRule; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveRoute.js b/lib/services/networkManagement2/lib/lib/models/effectiveRoute.js new file mode 100644 index 0000000000..88fde6a540 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveRoute.js @@ -0,0 +1,116 @@ +/* + * 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'; + +/** + * Effective Route + * + */ +class EffectiveRoute { + /** + * Create a EffectiveRoute. + * @member {string} [name] The name of the user defined route. This is + * optional. + * @member {string} [source] Who created the route. Possible values are: + * 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values + * include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + * @member {string} [state] The value of effective route. Possible values + * are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' + * @member {array} [addressPrefix] The address prefixes of the effective + * routes in CIDR notation. + * @member {array} [nextHopIpAddress] The IP address of the next hop of the + * effective route. + * @member {string} [nextHopType] The type of Azure hop the packet should be + * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * 'None' + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveRoute + * + * @returns {object} metadata of EffectiveRoute + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveRoute', + type: { + name: 'Composite', + className: 'EffectiveRoute', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + source: { + required: false, + serializedName: 'source', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + }, + addressPrefix: { + required: false, + serializedName: 'addressPrefix', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nextHopIpAddress: { + required: false, + serializedName: 'nextHopIpAddress', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nextHopType: { + required: false, + serializedName: 'nextHopType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EffectiveRoute; diff --git a/lib/services/networkManagement2/lib/lib/models/effectiveRouteListResult.js b/lib/services/networkManagement2/lib/lib/models/effectiveRouteListResult.js new file mode 100644 index 0000000000..a28ac9989d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/effectiveRouteListResult.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for list effective route API service call. + * + */ +class EffectiveRouteListResult { + /** + * Create a EffectiveRouteListResult. + * @member {array} [value] A list of effective routes. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveRouteListResult + * + * @returns {object} metadata of EffectiveRouteListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveRouteListResult', + type: { + name: 'Composite', + className: 'EffectiveRouteListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EffectiveRouteElementType', + type: { + name: 'Composite', + className: 'EffectiveRoute' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EffectiveRouteListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/endpointServiceResult.js b/lib/services/networkManagement2/lib/lib/models/endpointServiceResult.js new file mode 100644 index 0000000000..eb6b4da846 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/endpointServiceResult.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Endpoint service. + * + * @extends models['SubResource'] + */ +class EndpointServiceResult extends models['SubResource'] { + /** + * Create a EndpointServiceResult. + * @member {string} [name] Name of the endpoint service. + * @member {string} [type] Type of the endpoint service. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EndpointServiceResult + * + * @returns {object} metadata of EndpointServiceResult + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointServiceResult', + type: { + name: 'Composite', + className: 'EndpointServiceResult', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EndpointServiceResult; diff --git a/lib/services/networkManagement2/lib/lib/models/endpointServicesListResult.js b/lib/services/networkManagement2/lib/lib/models/endpointServicesListResult.js new file mode 100644 index 0000000000..4817adf490 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/endpointServicesListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListAvailableEndpointServices API service call. + */ +class EndpointServicesListResult extends Array { + /** + * Create a EndpointServicesListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EndpointServicesListResult + * + * @returns {object} metadata of EndpointServicesListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointServicesListResult', + type: { + name: 'Composite', + className: 'EndpointServicesListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EndpointServiceResultElementType', + type: { + name: 'Composite', + className: 'EndpointServiceResult' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EndpointServicesListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/errorDetails.js b/lib/services/networkManagement2/lib/lib/models/errorDetails.js new file mode 100644 index 0000000000..fcac88503a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/errorDetails.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Class representing a ErrorDetails. + */ +class ErrorDetails { + /** + * Create a ErrorDetails. + * @member {string} [code] + * @member {string} [target] + * @member {string} [message] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorDetails + * + * @returns {object} metadata of ErrorDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorDetails', + type: { + name: 'Composite', + className: 'ErrorDetails', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorDetails; diff --git a/lib/services/networkManagement2/lib/lib/models/errorModel.js b/lib/services/networkManagement2/lib/lib/models/errorModel.js new file mode 100644 index 0000000000..67d76db59f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/errorModel.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a ErrorModel. + */ +class ErrorModel { + /** + * Create a ErrorModel. + * @member {string} [code] + * @member {string} [message] + * @member {string} [target] + * @member {array} [details] + * @member {string} [innerError] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ + mapper() { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorDetailsElementType', + type: { + name: 'Composite', + className: 'ErrorDetails' + } + } + } + }, + innerError: { + required: false, + serializedName: 'innerError', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorModel; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuit.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuit.js new file mode 100644 index 0000000000..f80a5f3555 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuit.js @@ -0,0 +1,228 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ExpressRouteCircuit resource + * + * @extends models['Resource'] + */ +class ExpressRouteCircuit extends models['Resource'] { + /** + * Create a ExpressRouteCircuit. + * @member {object} [sku] The SKU. + * @member {string} [sku.name] The name of the SKU. + * @member {string} [sku.tier] The tier of the SKU. Possible values are + * 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @member {string} [sku.family] The family of the SKU. Possible values are: + * 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * @member {boolean} [allowClassicOperations] Allow classic operations + * @member {string} [circuitProvisioningState] The CircuitProvisioningState + * state of the resource. + * @member {string} [serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values + * are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * @member {array} [authorizations] The list of authorizations. + * @member {array} [peerings] The list of peerings. + * @member {string} [serviceKey] The ServiceKey. + * @member {string} [serviceProviderNotes] The ServiceProviderNotes. + * @member {object} [serviceProviderProperties] The + * ServiceProviderProperties. + * @member {string} [serviceProviderProperties.serviceProviderName] The + * serviceProviderName. + * @member {string} [serviceProviderProperties.peeringLocation] The peering + * location. + * @member {number} [serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuit + * + * @returns {object} metadata of ExpressRouteCircuit + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuit', + type: { + name: 'Composite', + className: 'ExpressRouteCircuit', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitSku' + } + }, + allowClassicOperations: { + required: false, + serializedName: 'properties.allowClassicOperations', + type: { + name: 'Boolean' + } + }, + circuitProvisioningState: { + required: false, + serializedName: 'properties.circuitProvisioningState', + type: { + name: 'String' + } + }, + serviceProviderProvisioningState: { + required: false, + serializedName: 'properties.serviceProviderProvisioningState', + type: { + name: 'String' + } + }, + authorizations: { + required: false, + serializedName: 'properties.authorizations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitAuthorizationElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitAuthorization' + } + } + } + }, + peerings: { + required: false, + serializedName: 'properties.peerings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeering' + } + } + } + }, + serviceKey: { + required: false, + serializedName: 'properties.serviceKey', + type: { + name: 'String' + } + }, + serviceProviderNotes: { + required: false, + serializedName: 'properties.serviceProviderNotes', + type: { + name: 'String' + } + }, + serviceProviderProperties: { + required: false, + serializedName: 'properties.serviceProviderProperties', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitServiceProviderProperties' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + gatewayManagerEtag: { + required: false, + serializedName: 'properties.gatewayManagerEtag', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuit; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitArpTable.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitArpTable.js new file mode 100644 index 0000000000..5eb3544870 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitArpTable.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * The ARP table associated with the ExpressRouteCircuit. + * + */ +class ExpressRouteCircuitArpTable { + /** + * Create a ExpressRouteCircuitArpTable. + * @member {number} [age] Age + * @member {string} [interfaceProperty] Interface + * @member {string} [ipAddress] The IP address. + * @member {string} [macAddress] The MAC address. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitArpTable + * + * @returns {object} metadata of ExpressRouteCircuitArpTable + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitArpTable', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitArpTable', + modelProperties: { + age: { + required: false, + serializedName: 'age', + type: { + name: 'Number' + } + }, + interfaceProperty: { + required: false, + serializedName: 'interface', + type: { + name: 'String' + } + }, + ipAddress: { + required: false, + serializedName: 'ipAddress', + type: { + name: 'String' + } + }, + macAddress: { + required: false, + serializedName: 'macAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitArpTable; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitAuthorization.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitAuthorization.js new file mode 100644 index 0000000000..84385110c0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitAuthorization.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Authorization in an ExpressRouteCircuit resource. + * + * @extends models['SubResource'] + */ +class ExpressRouteCircuitAuthorization extends models['SubResource'] { + /** + * Create a ExpressRouteCircuitAuthorization. + * @member {string} [authorizationKey] The authorization key. + * @member {string} [authorizationUseStatus] AuthorizationUseStatus. Possible + * values are: 'Available' and 'InUse'. Possible values include: 'Available', + * 'InUse' + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuitAuthorization + * + * @returns {object} metadata of ExpressRouteCircuitAuthorization + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitAuthorization', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitAuthorization', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + authorizationKey: { + required: false, + serializedName: 'properties.authorizationKey', + type: { + name: 'String' + } + }, + authorizationUseStatus: { + required: false, + serializedName: 'properties.authorizationUseStatus', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitAuthorization; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitConnection.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitConnection.js new file mode 100644 index 0000000000..053141896d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitConnection.js @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + * + * @extends models['SubResource'] + */ +class ExpressRouteCircuitConnection extends models['SubResource'] { + /** + * Create a ExpressRouteCircuitConnection. + * @member {object} [expressRouteCircuitPeering] Reference to Express Route + * Circuit Private Peering Resource of the circuit initiating connection. + * @member {string} [expressRouteCircuitPeering.id] Resource ID. + * @member {object} [peerExpressRouteCircuitPeering] Reference to Express + * Route Circuit Private Peering Resource of the peered circuit. + * @member {string} [peerExpressRouteCircuitPeering.id] Resource ID. + * @member {string} [addressPrefix] /29 IP address space to carve out + * Customer addresses for tunnels. + * @member {string} [authorizationKey] The authorization key. + * @member {string} [circuitConnectionStatus] Express Route Circuit + * Connection State. Possible values are: 'Connected' and 'Disconnected'. + * Possible values include: 'Connected', 'Connecting', 'Disconnected' + * @member {string} [provisioningState] Provisioning state of the circuit + * connection resource. Possible values are: 'Succeded', 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuitConnection + * + * @returns {object} metadata of ExpressRouteCircuitConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitConnection', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + expressRouteCircuitPeering: { + required: false, + serializedName: 'properties.expressRouteCircuitPeering', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + peerExpressRouteCircuitPeering: { + required: false, + serializedName: 'properties.peerExpressRouteCircuitPeering', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + addressPrefix: { + required: false, + serializedName: 'properties.addressPrefix', + type: { + name: 'String' + } + }, + authorizationKey: { + required: false, + serializedName: 'properties.authorizationKey', + type: { + name: 'String' + } + }, + circuitConnectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.circuitConnectionStatus', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitConnection; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitListResult.js new file mode 100644 index 0000000000..bc5717df8d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ListExpressRouteCircuit API service call. + */ +class ExpressRouteCircuitListResult extends Array { + /** + * Create a ExpressRouteCircuitListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuitListResult + * + * @returns {object} metadata of ExpressRouteCircuitListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuit' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeering.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeering.js new file mode 100644 index 0000000000..d965a8eb65 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeering.js @@ -0,0 +1,309 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Peering in an ExpressRouteCircuit resource. + * + * @extends models['SubResource'] + */ +class ExpressRouteCircuitPeering extends models['SubResource'] { + /** + * Create a ExpressRouteCircuitPeering. + * @member {string} [peeringType] The peering type. Possible values include: + * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @member {string} [state] The peering state. Possible values include: + * 'Disabled', 'Enabled' + * @member {number} [azureASN] The Azure ASN. + * @member {number} [peerASN] The peer ASN. + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address + * prefix. + * @member {string} [primaryAzurePort] The primary port. + * @member {string} [secondaryAzurePort] The secondary port. + * @member {string} [sharedKey] The shared key. + * @member {number} [vlanId] The VLAN ID. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of + * the peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of + * the peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [stats] Gets peering stats. + * @member {number} [stats.primarybytesIn] Gets BytesIn of the peering. + * @member {number} [stats.primarybytesOut] Gets BytesOut of the peering. + * @member {number} [stats.secondarybytesIn] Gets BytesIn of the peering. + * @member {number} [stats.secondarybytesOut] Gets BytesOut of the peering. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [lastModifiedBy] Gets whether the provider or the + * customer last modified the peering. + * @member {object} [routeFilter] The reference of the RouteFilter resource. + * @member {array} [routeFilter.rules] Collection of RouteFilterRules + * contained within a route filter. + * @member {array} [routeFilter.peerings] A collection of references to + * express route circuit peerings. + * @member {string} [routeFilter.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [routeFilter.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {object} [ipv6PeeringConfig] The IPv6 peering configuration. + * @member {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * @member {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * @member {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft + * peering configuration. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] + * The CustomerASN of the peering. + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [ipv6PeeringConfig.routeFilter] The reference of the + * RouteFilter resource. + * @member {array} [ipv6PeeringConfig.routeFilter.rules] Collection of + * RouteFilterRules contained within a route filter. + * @member {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of + * references to express route circuit peerings. + * @member {string} [ipv6PeeringConfig.routeFilter.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {string} [ipv6PeeringConfig.state] The state of peering. Possible + * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', + * 'Enabled' + * @member {array} [connections] The list of circuit connections associated + * with Azure Private Peering for this circuit. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuitPeering + * + * @returns {object} metadata of ExpressRouteCircuitPeering + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitPeering', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeering', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + peeringType: { + required: false, + serializedName: 'properties.peeringType', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + azureASN: { + required: false, + serializedName: 'properties.azureASN', + type: { + name: 'Number' + } + }, + peerASN: { + required: false, + serializedName: 'properties.peerASN', + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + primaryPeerAddressPrefix: { + required: false, + serializedName: 'properties.primaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + secondaryPeerAddressPrefix: { + required: false, + serializedName: 'properties.secondaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + primaryAzurePort: { + required: false, + serializedName: 'properties.primaryAzurePort', + type: { + name: 'String' + } + }, + secondaryAzurePort: { + required: false, + serializedName: 'properties.secondaryAzurePort', + type: { + name: 'String' + } + }, + sharedKey: { + required: false, + serializedName: 'properties.sharedKey', + type: { + name: 'String' + } + }, + vlanId: { + required: false, + serializedName: 'properties.vlanId', + type: { + name: 'Number' + } + }, + microsoftPeeringConfig: { + required: false, + serializedName: 'properties.microsoftPeeringConfig', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeeringConfig' + } + }, + stats: { + required: false, + serializedName: 'properties.stats', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitStats' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + gatewayManagerEtag: { + required: false, + serializedName: 'properties.gatewayManagerEtag', + type: { + name: 'String' + } + }, + lastModifiedBy: { + required: false, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + }, + routeFilter: { + required: false, + serializedName: 'properties.routeFilter', + type: { + name: 'Composite', + className: 'RouteFilter' + } + }, + ipv6PeeringConfig: { + required: false, + serializedName: 'properties.ipv6PeeringConfig', + type: { + name: 'Composite', + className: 'Ipv6ExpressRouteCircuitPeeringConfig' + } + }, + connections: { + required: false, + serializedName: 'properties.connections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitConnectionElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitConnection' + } + } + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitPeering; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringConfig.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringConfig.js new file mode 100644 index 0000000000..79a97c813e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringConfig.js @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifies the peering configuration. + * + */ +class ExpressRouteCircuitPeeringConfig { + /** + * Create a ExpressRouteCircuitPeeringConfig. + * @member {array} [advertisedPublicPrefixes] The reference of + * AdvertisedPublicPrefixes. + * @member {array} [advertisedCommunities] The communities of bgp peering. + * Spepcified for microsoft peering + * @member {string} [advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [legacyMode] The legacy mode of the peering. + * @member {number} [customerASN] The CustomerASN of the peering. + * @member {string} [routingRegistryName] The RoutingRegistryName of the + * configuration. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitPeeringConfig + * + * @returns {object} metadata of ExpressRouteCircuitPeeringConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitPeeringConfig', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeeringConfig', + modelProperties: { + advertisedPublicPrefixes: { + required: false, + serializedName: 'advertisedPublicPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + advertisedCommunities: { + required: false, + serializedName: 'advertisedCommunities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + advertisedPublicPrefixesState: { + required: false, + serializedName: 'advertisedPublicPrefixesState', + type: { + name: 'String' + } + }, + legacyMode: { + required: false, + serializedName: 'legacyMode', + type: { + name: 'Number' + } + }, + customerASN: { + required: false, + serializedName: 'customerASN', + type: { + name: 'Number' + } + }, + routingRegistryName: { + required: false, + serializedName: 'routingRegistryName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitPeeringConfig; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringListResult.js new file mode 100644 index 0000000000..c8c233ee5e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListPeering API service call retrieves all peerings that belong + * to an ExpressRouteCircuit. + */ +class ExpressRouteCircuitPeeringListResult extends Array { + /** + * Create a ExpressRouteCircuitPeeringListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCircuitPeeringListResult + * + * @returns {object} metadata of ExpressRouteCircuitPeeringListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitPeeringListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeeringListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeering' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitPeeringListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitReference.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitReference.js new file mode 100644 index 0000000000..d7c4e7081c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitReference.js @@ -0,0 +1,51 @@ +/* + * 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'; + +/** + * Class representing a ExpressRouteCircuitReference. + */ +class ExpressRouteCircuitReference { + /** + * Create a ExpressRouteCircuitReference. + * @member {string} [id] Corresponding Express Route Circuit Id. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitReference + * + * @returns {object} metadata of ExpressRouteCircuitReference + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitReference', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitReference', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitReference; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTable.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTable.js new file mode 100644 index 0000000000..d3a4e5f351 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTable.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * The routes table associated with the ExpressRouteCircuit + * + */ +class ExpressRouteCircuitRoutesTable { + /** + * Create a ExpressRouteCircuitRoutesTable. + * @member {string} [network] network + * @member {string} [nextHop] nextHop + * @member {string} [locPrf] locPrf + * @member {number} [weight] weight. + * @member {string} [path] path + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitRoutesTable + * + * @returns {object} metadata of ExpressRouteCircuitRoutesTable + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitRoutesTable', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitRoutesTable', + modelProperties: { + network: { + required: false, + serializedName: 'network', + type: { + name: 'String' + } + }, + nextHop: { + required: false, + serializedName: 'nextHop', + type: { + name: 'String' + } + }, + locPrf: { + required: false, + serializedName: 'locPrf', + type: { + name: 'String' + } + }, + weight: { + required: false, + serializedName: 'weight', + type: { + name: 'Number' + } + }, + path: { + required: false, + serializedName: 'path', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitRoutesTable; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTableSummary.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTableSummary.js new file mode 100644 index 0000000000..9faca22420 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTableSummary.js @@ -0,0 +1,87 @@ +/* + * 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'; + +/** + * The routes table associated with the ExpressRouteCircuit. + * + */ +class ExpressRouteCircuitRoutesTableSummary { + /** + * Create a ExpressRouteCircuitRoutesTableSummary. + * @member {string} [neighbor] Neighbor + * @member {number} [v] BGP version number spoken to the neighbor. + * @member {number} [as] Autonomous system number. + * @member {string} [upDown] The length of time that the BGP session has been + * in the Established state, or the current status if not in the Established + * state. + * @member {string} [statePfxRcd] Current state of the BGP session, and the + * number of prefixes that have been received from a neighbor or peer group. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitRoutesTableSummary + * + * @returns {object} metadata of ExpressRouteCircuitRoutesTableSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitRoutesTableSummary', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitRoutesTableSummary', + modelProperties: { + neighbor: { + required: false, + serializedName: 'neighbor', + type: { + name: 'String' + } + }, + v: { + required: false, + serializedName: 'v', + type: { + name: 'Number' + } + }, + as: { + required: false, + serializedName: 'as', + type: { + name: 'Number' + } + }, + upDown: { + required: false, + serializedName: 'upDown', + type: { + name: 'String' + } + }, + statePfxRcd: { + required: false, + serializedName: 'statePfxRcd', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitRoutesTableSummary; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitServiceProviderProperties.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitServiceProviderProperties.js new file mode 100644 index 0000000000..66a96d4d72 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitServiceProviderProperties.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + * + */ +class ExpressRouteCircuitServiceProviderProperties { + /** + * Create a ExpressRouteCircuitServiceProviderProperties. + * @member {string} [serviceProviderName] The serviceProviderName. + * @member {string} [peeringLocation] The peering location. + * @member {number} [bandwidthInMbps] The BandwidthInMbps. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitServiceProviderProperties + * + * @returns {object} metadata of ExpressRouteCircuitServiceProviderProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitServiceProviderProperties', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitServiceProviderProperties', + modelProperties: { + serviceProviderName: { + required: false, + serializedName: 'serviceProviderName', + type: { + name: 'String' + } + }, + peeringLocation: { + required: false, + serializedName: 'peeringLocation', + type: { + name: 'String' + } + }, + bandwidthInMbps: { + required: false, + serializedName: 'bandwidthInMbps', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitServiceProviderProperties; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitSku.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitSku.js new file mode 100644 index 0000000000..3fc69adc76 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitSku.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Contains SKU in an ExpressRouteCircuit. + * + */ +class ExpressRouteCircuitSku { + /** + * Create a ExpressRouteCircuitSku. + * @member {string} [name] The name of the SKU. + * @member {string} [tier] The tier of the SKU. Possible values are + * 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @member {string} [family] The family of the SKU. Possible values are: + * 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitSku + * + * @returns {object} metadata of ExpressRouteCircuitSku + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitSku', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitSku; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitStats.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitStats.js new file mode 100644 index 0000000000..f2eda96ec4 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitStats.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * Contains stats associated with the peering. + * + */ +class ExpressRouteCircuitStats { + /** + * Create a ExpressRouteCircuitStats. + * @member {number} [primarybytesIn] Gets BytesIn of the peering. + * @member {number} [primarybytesOut] Gets BytesOut of the peering. + * @member {number} [secondarybytesIn] Gets BytesIn of the peering. + * @member {number} [secondarybytesOut] Gets BytesOut of the peering. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitStats + * + * @returns {object} metadata of ExpressRouteCircuitStats + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitStats', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitStats', + modelProperties: { + primarybytesIn: { + required: false, + serializedName: 'primarybytesIn', + type: { + name: 'Number' + } + }, + primarybytesOut: { + required: false, + serializedName: 'primarybytesOut', + type: { + name: 'Number' + } + }, + secondarybytesIn: { + required: false, + serializedName: 'secondarybytesIn', + type: { + name: 'Number' + } + }, + secondarybytesOut: { + required: false, + serializedName: 'secondarybytesOut', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitStats; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsArpTableListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsArpTableListResult.js new file mode 100644 index 0000000000..8a4e983b53 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsArpTableListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + * + */ +class ExpressRouteCircuitsArpTableListResult { + /** + * Create a ExpressRouteCircuitsArpTableListResult. + * @member {array} [value] Gets list of the ARP table. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitsArpTableListResult + * + * @returns {object} metadata of ExpressRouteCircuitsArpTableListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitsArpTableListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitsArpTableListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitArpTableElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitArpTable' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitsArpTableListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableListResult.js new file mode 100644 index 0000000000..5615578ab3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + * + */ +class ExpressRouteCircuitsRoutesTableListResult { + /** + * Create a ExpressRouteCircuitsRoutesTableListResult. + * @member {array} [value] The list of routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitsRoutesTableListResult + * + * @returns {object} metadata of ExpressRouteCircuitsRoutesTableListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitsRoutesTableListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitsRoutesTableListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitRoutesTableElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitRoutesTable' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitsRoutesTableListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js new file mode 100644 index 0000000000..2f19980efc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + * + */ +class ExpressRouteCircuitsRoutesTableSummaryListResult { + /** + * Create a ExpressRouteCircuitsRoutesTableSummaryListResult. + * @member {array} [value] A list of the routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCircuitsRoutesTableSummaryListResult + * + * @returns {object} metadata of ExpressRouteCircuitsRoutesTableSummaryListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCircuitsRoutesTableSummaryListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitsRoutesTableSummaryListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitRoutesTableSummaryElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitRoutesTableSummary' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCircuitsRoutesTableSummaryListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnection.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnection.js new file mode 100644 index 0000000000..21e3b6f300 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnection.js @@ -0,0 +1,207 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ExpressRouteCrossConnection resource + * + * @extends models['Resource'] + */ +class ExpressRouteCrossConnection extends models['Resource'] { + /** + * Create a ExpressRouteCrossConnection. + * @member {string} [primaryAzurePort] The name of the primary port. + * @member {string} [secondaryAzurePort] The name of the secondary port. + * @member {number} [sTag] The identifier of the circuit traffic. + * @member {string} [peeringLocation] The peering location of the + * ExpressRoute circuit. + * @member {number} [bandwidthInMbps] The circuit bandwidth In Mbps. + * @member {object} [expressRouteCircuit] The ExpressRouteCircuit + * @member {string} [expressRouteCircuit.id] Corresponding Express Route + * Circuit Id. + * @member {string} [serviceProviderProvisioningState] The provisioning state + * of the circuit in the connectivity provider system. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: + * 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @member {string} [serviceProviderNotes] Additional read only notes set by + * the connectivity provider. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {array} [peerings] The list of peerings. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCrossConnection + * + * @returns {object} metadata of ExpressRouteCrossConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnection', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + primaryAzurePort: { + required: false, + readOnly: true, + serializedName: 'properties.primaryAzurePort', + type: { + name: 'String' + } + }, + secondaryAzurePort: { + required: false, + readOnly: true, + serializedName: 'properties.secondaryAzurePort', + type: { + name: 'String' + } + }, + sTag: { + required: false, + readOnly: true, + serializedName: 'properties.sTag', + type: { + name: 'Number' + } + }, + peeringLocation: { + required: false, + readOnly: true, + serializedName: 'properties.peeringLocation', + type: { + name: 'String' + } + }, + bandwidthInMbps: { + required: false, + readOnly: true, + serializedName: 'properties.bandwidthInMbps', + type: { + name: 'Number' + } + }, + expressRouteCircuit: { + required: false, + readOnly: true, + serializedName: 'properties.expressRouteCircuit', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitReference' + } + }, + serviceProviderProvisioningState: { + required: false, + serializedName: 'properties.serviceProviderProvisioningState', + type: { + name: 'String' + } + }, + serviceProviderNotes: { + required: false, + serializedName: 'properties.serviceProviderNotes', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + peerings: { + required: false, + serializedName: 'properties.peerings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCrossConnectionPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionPeering' + } + } + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnection; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionListResult.js new file mode 100644 index 0000000000..b96c2712da --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListExpressRouteCrossConnection API service call. + */ +class ExpressRouteCrossConnectionListResult extends Array { + /** + * Create a ExpressRouteCrossConnectionListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCrossConnectionListResult + * + * @returns {object} metadata of ExpressRouteCrossConnectionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnectionListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCrossConnectionElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnection' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnectionListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeering.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeering.js new file mode 100644 index 0000000000..31abfbf098 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeering.js @@ -0,0 +1,266 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Peering in an ExpressRoute Cross Connection resource. + * + * @extends models['SubResource'] + */ +class ExpressRouteCrossConnectionPeering extends models['SubResource'] { + /** + * Create a ExpressRouteCrossConnectionPeering. + * @member {string} [peeringType] The peering type. Possible values include: + * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @member {string} [state] The peering state. Possible values include: + * 'Disabled', 'Enabled' + * @member {number} [azureASN] The Azure ASN. + * @member {number} [peerASN] The peer ASN. + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address + * prefix. + * @member {string} [primaryAzurePort] The primary port. + * @member {string} [secondaryAzurePort] The secondary port. + * @member {string} [sharedKey] The shared key. + * @member {number} [vlanId] The VLAN ID. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of + * the peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of + * the peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [lastModifiedBy] Gets whether the provider or the + * customer last modified the peering. + * @member {object} [ipv6PeeringConfig] The IPv6 peering configuration. + * @member {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * @member {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * @member {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft + * peering configuration. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] + * The CustomerASN of the peering. + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [ipv6PeeringConfig.routeFilter] The reference of the + * RouteFilter resource. + * @member {array} [ipv6PeeringConfig.routeFilter.rules] Collection of + * RouteFilterRules contained within a route filter. + * @member {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of + * references to express route circuit peerings. + * @member {string} [ipv6PeeringConfig.routeFilter.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {string} [ipv6PeeringConfig.state] The state of peering. Possible + * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', + * 'Enabled' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCrossConnectionPeering + * + * @returns {object} metadata of ExpressRouteCrossConnectionPeering + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnectionPeering', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionPeering', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + peeringType: { + required: false, + serializedName: 'properties.peeringType', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + azureASN: { + required: false, + readOnly: true, + serializedName: 'properties.azureASN', + type: { + name: 'Number' + } + }, + peerASN: { + required: false, + serializedName: 'properties.peerASN', + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + primaryPeerAddressPrefix: { + required: false, + serializedName: 'properties.primaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + secondaryPeerAddressPrefix: { + required: false, + serializedName: 'properties.secondaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + primaryAzurePort: { + required: false, + readOnly: true, + serializedName: 'properties.primaryAzurePort', + type: { + name: 'String' + } + }, + secondaryAzurePort: { + required: false, + readOnly: true, + serializedName: 'properties.secondaryAzurePort', + type: { + name: 'String' + } + }, + sharedKey: { + required: false, + serializedName: 'properties.sharedKey', + type: { + name: 'String' + } + }, + vlanId: { + required: false, + serializedName: 'properties.vlanId', + type: { + name: 'Number' + } + }, + microsoftPeeringConfig: { + required: false, + serializedName: 'properties.microsoftPeeringConfig', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeeringConfig' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + gatewayManagerEtag: { + required: false, + readOnly: true, + serializedName: 'properties.gatewayManagerEtag', + type: { + name: 'String' + } + }, + lastModifiedBy: { + required: false, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + }, + ipv6PeeringConfig: { + required: false, + serializedName: 'properties.ipv6PeeringConfig', + type: { + name: 'Composite', + className: 'Ipv6ExpressRouteCircuitPeeringConfig' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnectionPeering; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeeringList.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeeringList.js new file mode 100644 index 0000000000..5f35071118 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeeringList.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Response for ListPeering API service call retrieves all peerings that belong + * to an ExpressRouteCrossConnection. + */ +class ExpressRouteCrossConnectionPeeringList extends Array { + /** + * Create a ExpressRouteCrossConnectionPeeringList. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteCrossConnectionPeeringList + * + * @returns {object} metadata of ExpressRouteCrossConnectionPeeringList + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnectionPeeringList', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionPeeringList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCrossConnectionPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionPeering' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnectionPeeringList; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionRoutesTableSummary.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionRoutesTableSummary.js new file mode 100644 index 0000000000..20f7e76770 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionRoutesTableSummary.js @@ -0,0 +1,80 @@ +/* + * 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'; + +/** + * The routes table associated with the ExpressRouteCircuit. + * + */ +class ExpressRouteCrossConnectionRoutesTableSummary { + /** + * Create a ExpressRouteCrossConnectionRoutesTableSummary. + * @member {string} [neighbor] IP address of Neighbor router + * @member {number} [asn] Autonomous system number. + * @member {string} [upDown] The length of time that the BGP session has been + * in the Established state, or the current status if not in the Established + * state. + * @member {string} [stateOrPrefixesReceived] Current state of the BGP + * session, and the number of prefixes that have been received from a + * neighbor or peer group. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCrossConnectionRoutesTableSummary + * + * @returns {object} metadata of ExpressRouteCrossConnectionRoutesTableSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnectionRoutesTableSummary', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionRoutesTableSummary', + modelProperties: { + neighbor: { + required: false, + serializedName: 'neighbor', + type: { + name: 'String' + } + }, + asn: { + required: false, + serializedName: 'asn', + type: { + name: 'Number' + } + }, + upDown: { + required: false, + serializedName: 'upDown', + type: { + name: 'String' + } + }, + stateOrPrefixesReceived: { + required: false, + serializedName: 'stateOrPrefixesReceived', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnectionRoutesTableSummary; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js new file mode 100644 index 0000000000..cb01c31a22 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + * + */ +class ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + /** + * Create a ExpressRouteCrossConnectionsRoutesTableSummaryListResult. + * @member {array} [value] A list of the routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteCrossConnectionsRoutesTableSummaryListResult + * + * @returns {object} metadata of ExpressRouteCrossConnectionsRoutesTableSummaryListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteCrossConnectionsRoutesTableSummaryListResult', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionsRoutesTableSummaryListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCrossConnectionRoutesTableSummaryElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCrossConnectionRoutesTableSummary' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteCrossConnectionsRoutesTableSummaryListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProvider.js b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProvider.js new file mode 100644 index 0000000000..43bb5d2474 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProvider.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A ExpressRouteResourceProvider object. + * + * @extends models['Resource'] + */ +class ExpressRouteServiceProvider extends models['Resource'] { + /** + * Create a ExpressRouteServiceProvider. + * @member {array} [peeringLocations] Get a list of peering locations. + * @member {array} [bandwidthsOffered] Gets bandwidths offered. + * @member {string} [provisioningState] Gets the provisioning state of the + * resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteServiceProvider + * + * @returns {object} metadata of ExpressRouteServiceProvider + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteServiceProvider', + type: { + name: 'Composite', + className: 'ExpressRouteServiceProvider', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + peeringLocations: { + required: false, + serializedName: 'properties.peeringLocations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + bandwidthsOffered: { + required: false, + serializedName: 'properties.bandwidthsOffered', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteServiceProviderBandwidthsOfferedElementType', + type: { + name: 'Composite', + className: 'ExpressRouteServiceProviderBandwidthsOffered' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteServiceProvider; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderBandwidthsOffered.js b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderBandwidthsOffered.js new file mode 100644 index 0000000000..5cdb44d2c0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderBandwidthsOffered.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'; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + * + */ +class ExpressRouteServiceProviderBandwidthsOffered { + /** + * Create a ExpressRouteServiceProviderBandwidthsOffered. + * @member {string} [offerName] The OfferName. + * @member {number} [valueInMbps] The ValueInMbps. + */ + constructor() { + } + + /** + * Defines the metadata of ExpressRouteServiceProviderBandwidthsOffered + * + * @returns {object} metadata of ExpressRouteServiceProviderBandwidthsOffered + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteServiceProviderBandwidthsOffered', + type: { + name: 'Composite', + className: 'ExpressRouteServiceProviderBandwidthsOffered', + modelProperties: { + offerName: { + required: false, + serializedName: 'offerName', + type: { + name: 'String' + } + }, + valueInMbps: { + required: false, + serializedName: 'valueInMbps', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteServiceProviderBandwidthsOffered; diff --git a/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderListResult.js b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderListResult.js new file mode 100644 index 0000000000..cf04035185 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListExpressRouteServiceProvider API service call. + */ +class ExpressRouteServiceProviderListResult extends Array { + /** + * Create a ExpressRouteServiceProviderListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExpressRouteServiceProviderListResult + * + * @returns {object} metadata of ExpressRouteServiceProviderListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ExpressRouteServiceProviderListResult', + type: { + name: 'Composite', + className: 'ExpressRouteServiceProviderListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteServiceProviderElementType', + type: { + name: 'Composite', + className: 'ExpressRouteServiceProvider' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExpressRouteServiceProviderListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/flowLogInformation.js b/lib/services/networkManagement2/lib/lib/models/flowLogInformation.js new file mode 100644 index 0000000000..9efb176e4e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/flowLogInformation.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information on the configuration of flow log. + * + */ +class FlowLogInformation { + /** + * Create a FlowLogInformation. + * @member {string} targetResourceId The ID of the resource to configure for + * flow logging. + * @member {string} storageId ID of the storage account which is used to + * store the flow log. + * @member {boolean} enabled Flag to enable/disable flow logging. + * @member {object} [retentionPolicy] + * @member {number} [retentionPolicy.days] Number of days to retain flow log + * records. + * @member {boolean} [retentionPolicy.enabled] Flag to enable/disable + * retention. + */ + constructor() { + } + + /** + * Defines the metadata of FlowLogInformation + * + * @returns {object} metadata of FlowLogInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'FlowLogInformation', + type: { + name: 'Composite', + className: 'FlowLogInformation', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + }, + storageId: { + required: true, + serializedName: 'properties.storageId', + type: { + name: 'String' + } + }, + enabled: { + required: true, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + retentionPolicy: { + required: false, + serializedName: 'properties.retentionPolicy', + type: { + name: 'Composite', + className: 'RetentionPolicyParameters' + } + } + } + } + }; + } +} + +module.exports = FlowLogInformation; diff --git a/lib/services/networkManagement2/lib/lib/models/flowLogStatusParameters.js b/lib/services/networkManagement2/lib/lib/models/flowLogStatusParameters.js new file mode 100644 index 0000000000..0f9221918d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/flowLogStatusParameters.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * Parameters that define a resource to query flow log status. + * + */ +class FlowLogStatusParameters { + /** + * Create a FlowLogStatusParameters. + * @member {string} targetResourceId The target resource where getting the + * flow logging status. + */ + constructor() { + } + + /** + * Defines the metadata of FlowLogStatusParameters + * + * @returns {object} metadata of FlowLogStatusParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'FlowLogStatusParameters', + type: { + name: 'Composite', + className: 'FlowLogStatusParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FlowLogStatusParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/frontendIPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/frontendIPConfiguration.js new file mode 100644 index 0000000000..561dccc025 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/frontendIPConfiguration.js @@ -0,0 +1,374 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Frontend IP address of the load balancer. + * + * @extends models['SubResource'] + */ +class FrontendIPConfiguration extends models['SubResource'] { + /** + * Create a FrontendIPConfiguration. + * @member {array} [inboundNatRules] Read only. Inbound rules URIs that use + * this frontend IP. + * @member {array} [inboundNatPools] Read only. Inbound pools URIs that use + * this frontend IP. + * @member {array} [outboundNatRules] Read only. Outbound rules URIs that use + * this frontend IP. + * @member {array} [loadBalancingRules] Gets load balancing rules URIs that + * use this frontend IP. + * @member {string} [privateIPAddress] The private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] The Private IP allocation + * method. Possible values are: 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to + * the network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {object} [publicIPAddress] The reference of the Public IP + * resource. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address + * SKU. Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} + * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP + * allocation method. Possible values are 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {object} [publicIPAddress.ipConfiguration.subnet] The reference of + * the subnet resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] + * The address prefix for the subnet. + * @member {object} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection + * of references to subnets. + * @member {boolean} + * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] + * An array of service endpoints. + * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations + * using subnet. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} [publicIPAddress.ipConfiguration.provisioningState] Gets + * the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [publicIPAddress.ipConfiguration.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or + * sets the Domain name label.The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets + * the Reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, then + * a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated + * with the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout + * of the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning + * state of the PublicIP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {array} [zones] A list of availability zones denoting the IP + * allocated for the resource needs to come from. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrontendIPConfiguration + * + * @returns {object} metadata of FrontendIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendIPConfiguration', + type: { + name: 'Composite', + className: 'FrontendIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + inboundNatRules: { + required: false, + readOnly: true, + serializedName: 'properties.inboundNatRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + inboundNatPools: { + required: false, + readOnly: true, + serializedName: 'properties.inboundNatPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + outboundNatRules: { + required: false, + readOnly: true, + serializedName: 'properties.outboundNatRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + loadBalancingRules: { + required: false, + readOnly: true, + serializedName: 'properties.loadBalancingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + privateIPAddress: { + required: false, + serializedName: 'properties.privateIPAddress', + type: { + name: 'String' + } + }, + privateIPAllocationMethod: { + required: false, + serializedName: 'properties.privateIPAllocationMethod', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'Subnet' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'PublicIPAddress' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = FrontendIPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js b/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js new file mode 100644 index 0000000000..4f2a9526a6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js @@ -0,0 +1,107 @@ +/* + * 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'; + +/** + * Gateway routing details + * + */ +class GatewayRoute { + /** + * Create a GatewayRoute. + * @member {string} [localAddress] The gateway's local address + * @member {string} [network] The route's network prefix + * @member {string} [nextHop] The route's next hop + * @member {string} [sourcePeer] The peer this route was learned from + * @member {string} [origin] The source this route was learned from + * @member {string} [asPath] The route's AS path sequence + * @member {number} [weight] The route's weight + */ + constructor() { + } + + /** + * Defines the metadata of GatewayRoute + * + * @returns {object} metadata of GatewayRoute + * + */ + mapper() { + return { + required: false, + serializedName: 'GatewayRoute', + type: { + name: 'Composite', + className: 'GatewayRoute', + modelProperties: { + localAddress: { + required: false, + readOnly: true, + serializedName: 'localAddress', + type: { + name: 'String' + } + }, + network: { + required: false, + readOnly: true, + serializedName: 'network', + type: { + name: 'String' + } + }, + nextHop: { + required: false, + readOnly: true, + serializedName: 'nextHop', + type: { + name: 'String' + } + }, + sourcePeer: { + required: false, + readOnly: true, + serializedName: 'sourcePeer', + type: { + name: 'String' + } + }, + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + }, + asPath: { + required: false, + readOnly: true, + serializedName: 'asPath', + type: { + name: 'String' + } + }, + weight: { + required: false, + readOnly: true, + serializedName: 'weight', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = GatewayRoute; diff --git a/lib/services/networkManagement2/lib/lib/models/gatewayRouteListResult.js b/lib/services/networkManagement2/lib/lib/models/gatewayRouteListResult.js new file mode 100644 index 0000000000..55cecfba96 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/gatewayRouteListResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of virtual network gateway routes + * + */ +class GatewayRouteListResult { + /** + * Create a GatewayRouteListResult. + * @member {array} [value] List of gateway routes + */ + constructor() { + } + + /** + * Defines the metadata of GatewayRouteListResult + * + * @returns {object} metadata of GatewayRouteListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'GatewayRouteListResult', + type: { + name: 'Composite', + className: 'GatewayRouteListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GatewayRouteElementType', + type: { + name: 'Composite', + className: 'GatewayRoute' + } + } + } + } + } + } + }; + } +} + +module.exports = GatewayRouteListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/iPAddressAvailabilityResult.js b/lib/services/networkManagement2/lib/lib/models/iPAddressAvailabilityResult.js new file mode 100644 index 0000000000..ceedaeb386 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/iPAddressAvailabilityResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for CheckIPAddressAvailability API service call + * + */ +class IPAddressAvailabilityResult { + /** + * Create a IPAddressAvailabilityResult. + * @member {boolean} [available] Private IP address availability. + * @member {array} [availableIPAddresses] Contains other available private IP + * addresses if the asked for address is taken. + */ + constructor() { + } + + /** + * Defines the metadata of IPAddressAvailabilityResult + * + * @returns {object} metadata of IPAddressAvailabilityResult + * + */ + mapper() { + return { + required: false, + serializedName: 'IPAddressAvailabilityResult', + type: { + name: 'Composite', + className: 'IPAddressAvailabilityResult', + modelProperties: { + available: { + required: false, + serializedName: 'available', + type: { + name: 'Boolean' + } + }, + availableIPAddresses: { + required: false, + serializedName: 'availableIPAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = IPAddressAvailabilityResult; diff --git a/lib/services/networkManagement2/lib/lib/models/iPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/iPConfiguration.js new file mode 100644 index 0000000000..dbdb4959c8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/iPConfiguration.js @@ -0,0 +1,207 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * IP configuration + * + * @extends models['SubResource'] + */ +class IPConfiguration extends models['SubResource'] { + /** + * Create a IPConfiguration. + * @member {string} [privateIPAddress] The private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] The private IP allocation + * method. Possible values are 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to + * the network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {object} [publicIPAddress] The reference of the public IP + * resource. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address + * SKU. Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or + * sets the Domain name label.The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets + * the Reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, then + * a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated + * with the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout + * of the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning + * state of the PublicIP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of IPConfiguration + * + * @returns {object} metadata of IPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'IPConfiguration', + type: { + name: 'Composite', + className: 'IPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + privateIPAddress: { + required: false, + serializedName: 'properties.privateIPAddress', + type: { + name: 'String' + } + }, + privateIPAllocationMethod: { + required: false, + serializedName: 'properties.privateIPAllocationMethod', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'Subnet' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'PublicIPAddress' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/inboundNatPool.js b/lib/services/networkManagement2/lib/lib/models/inboundNatPool.js new file mode 100644 index 0000000000..b8304b9e92 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/inboundNatPool.js @@ -0,0 +1,155 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Inbound NAT pool of the load balancer. + * + * @extends models['SubResource'] + */ +class InboundNatPool extends models['SubResource'] { + /** + * Create a InboundNatPool. + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {string} protocol Possible values include: 'Udp', 'Tcp', 'All' + * @member {number} frontendPortRangeStart The first port number in the range + * of external ports that will be used to provide Inbound Nat to NICs + * associated with a load balancer. Acceptable values range between 1 and + * 65534. + * @member {number} frontendPortRangeEnd The last port number in the range of + * external ports that will be used to provide Inbound Nat to NICs associated + * with a load balancer. Acceptable values range between 1 and 65535. + * @member {number} backendPort The port used for internal connections on the + * endpoint. Acceptable values are between 1 and 65535. + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default + * value is 4 minutes. This element is only used when the protocol is set to + * TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's + * endpoint for the floating IP capability required to configure a SQL + * AlwaysOn Availability Group. This setting is required when using the SQL + * AlwaysOn Availability Groups in SQL server. This setting can't be changed + * after you create the endpoint. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InboundNatPool + * + * @returns {object} metadata of InboundNatPool + * + */ + mapper() { + return { + required: false, + serializedName: 'InboundNatPool', + type: { + name: 'Composite', + className: 'InboundNatPool', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + frontendIPConfiguration: { + required: false, + serializedName: 'properties.frontendIPConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + protocol: { + required: true, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + frontendPortRangeStart: { + required: true, + serializedName: 'properties.frontendPortRangeStart', + type: { + name: 'Number' + } + }, + frontendPortRangeEnd: { + required: true, + serializedName: 'properties.frontendPortRangeEnd', + type: { + name: 'Number' + } + }, + backendPort: { + required: true, + serializedName: 'properties.backendPort', + type: { + name: 'Number' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + enableFloatingIP: { + required: false, + serializedName: 'properties.enableFloatingIP', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InboundNatPool; diff --git a/lib/services/networkManagement2/lib/lib/models/inboundNatRule.js b/lib/services/networkManagement2/lib/lib/models/inboundNatRule.js new file mode 100644 index 0000000000..09299a448c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/inboundNatRule.js @@ -0,0 +1,389 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Inbound NAT rule of the load balancer. + * + * @extends models['SubResource'] + */ +class InboundNatRule extends models['SubResource'] { + /** + * Create a InboundNatRule. + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [backendIPConfiguration] A reference to a private IP + * address defined on a network interface of a VM. Traffic sent to the + * frontend port of each of the frontend IP configurations is forwarded to + * the backend IP. + * @member {array} + * [backendIPConfiguration.applicationGatewayBackendAddressPools] The + * reference of ApplicationGatewayBackendAddressPool resource. + * @member {array} [backendIPConfiguration.loadBalancerBackendAddressPools] + * The reference of LoadBalancerBackendAddressPool resource. + * @member {array} [backendIPConfiguration.loadBalancerInboundNatRules] A + * list of references of LoadBalancerInboundNatRules. + * @member {string} [backendIPConfiguration.privateIPAddress] Private IP + * address of the IP configuration. + * @member {string} [backendIPConfiguration.privateIPAllocationMethod] + * Defines how a private IP address is assigned. Possible values are: + * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {string} [backendIPConfiguration.privateIPAddressVersion] + * Available from Api-Version 2016-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6' + * @member {object} [backendIPConfiguration.subnet] Subnet bound to the IP + * configuration. + * @member {string} [backendIPConfiguration.subnet.addressPrefix] The address + * prefix for the subnet. + * @member {object} [backendIPConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.subnets] A collection + * of references to subnets. + * @member {string} + * [backendIPConfiguration.subnet.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * @member {string} + * [backendIPConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.subnet.networkSecurityGroup.etag] + * A unique read-only string that changes whenever the resource is updated. + * @member {object} [backendIPConfiguration.subnet.routeTable] The reference + * of the RouteTable resource. + * @member {array} [backendIPConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} [backendIPConfiguration.subnet.routeTable.subnets] A + * collection of references to subnets. + * @member {boolean} + * [backendIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets + * or sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} + * [backendIPConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.subnet.routeTable.etag] Gets a + * unique read-only string that changes whenever the resource is updated. + * @member {array} [backendIPConfiguration.subnet.serviceEndpoints] An array + * of service endpoints. + * @member {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an + * array of references to the network interface IP configurations using + * subnet. + * @member {array} [backendIPConfiguration.subnet.resourceNavigationLinks] + * Gets an array of references to the external resources using subnet. + * @member {string} [backendIPConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [backendIPConfiguration.subnet.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [backendIPConfiguration.subnet.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {boolean} [backendIPConfiguration.primary] Gets whether this is a + * primary customer address on the network interface. + * @member {object} [backendIPConfiguration.publicIPAddress] Public IP + * address bound to the IP configuration. + * @member {object} [backendIPConfiguration.publicIPAddress.sku] The public + * IP address SKU. + * @member {string} [backendIPConfiguration.publicIPAddress.sku.name] Name of + * a public IP address SKU. Possible values include: 'Basic', 'Standard' + * @member {string} + * [backendIPConfiguration.publicIPAddress.publicIPAllocationMethod] The + * public IP allocation method. Possible values are: 'Static' and 'Dynamic'. + * Possible values include: 'Static', 'Dynamic' + * @member {string} + * [backendIPConfiguration.publicIPAddress.publicIPAddressVersion] The public + * IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible + * values include: 'IPv4', 'IPv6' + * @member {object} [backendIPConfiguration.publicIPAddress.ipConfiguration] + * The IP configuration associated with the public IP address. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] + * The private IP address of the IP configuration. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet] The + * reference of the subnet resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] + * The address prefix for the subnet. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] + * The reference of the NetworkSecurityGroup resource. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] + * A collection of references to subnets. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] + * A unique read-only string that changes whenever the resource is updated. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] + * The reference of the RouteTable resource. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] + * An array of service endpoints. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations + * using subnet. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] + * Gets an array of references to the external resources using subnet. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] The + * name of the resource that is unique within a resource group. This name can + * be used to access the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] + * The reference of the public IP resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [backendIPConfiguration.publicIPAddress.dnsSettings] The + * FQDN of the DNS record associated with the public IP address. + * @member {string} + * [backendIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets + * or sets the Domain name label.The concatenation of the domain name label + * and the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + * @member {string} [backendIPConfiguration.publicIPAddress.dnsSettings.fqdn] + * Gets the FQDN, Fully qualified domain name of the A DNS record associated + * with the public IP. This is the concatenation of the domainNameLabel and + * the regionalized DNS zone. + * @member {string} + * [backendIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] Gets or + * Sets the Reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, then + * a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [backendIPConfiguration.publicIPAddress.ipTags] The list + * of tags associated with the public IP address. + * @member {string} [backendIPConfiguration.publicIPAddress.ipAddress] The IP + * address associated with the public IP address resource. + * @member {number} + * [backendIPConfiguration.publicIPAddress.idleTimeoutInMinutes] The idle + * timeout of the public IP address. + * @member {string} [backendIPConfiguration.publicIPAddress.resourceGuid] The + * resource GUID property of the public IP resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.provisioningState] The + * provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.publicIPAddress.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {array} [backendIPConfiguration.publicIPAddress.zones] A list of + * availability zones denoting the IP allocated for the resource needs to + * come from. + * @member {array} [backendIPConfiguration.applicationSecurityGroups] + * Application security groups in which the IP configuration is included. + * @member {string} [backendIPConfiguration.provisioningState] The + * provisioning state of the network interface IP configuration. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.name] The name of the resource + * that is unique within a resource group. This name can be used to access + * the resource. + * @member {string} [backendIPConfiguration.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {string} [protocol] Possible values include: 'Udp', 'Tcp', 'All' + * @member {number} [frontendPort] The port for the external endpoint. Port + * numbers for each rule must be unique within the Load Balancer. Acceptable + * values range from 1 to 65534. + * @member {number} [backendPort] The port used for the internal endpoint. + * Acceptable values range from 1 to 65535. + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default + * value is 4 minutes. This element is only used when the protocol is set to + * TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's + * endpoint for the floating IP capability required to configure a SQL + * AlwaysOn Availability Group. This setting is required when using the SQL + * AlwaysOn Availability Groups in SQL server. This setting can't be changed + * after you create the endpoint. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InboundNatRule + * + * @returns {object} metadata of InboundNatRule + * + */ + mapper() { + return { + required: false, + serializedName: 'InboundNatRule', + type: { + name: 'Composite', + className: 'InboundNatRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + frontendIPConfiguration: { + required: false, + serializedName: 'properties.frontendIPConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + backendIPConfiguration: { + required: false, + readOnly: true, + serializedName: 'properties.backendIPConfiguration', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + }, + protocol: { + required: false, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + frontendPort: { + required: false, + serializedName: 'properties.frontendPort', + type: { + name: 'Number' + } + }, + backendPort: { + required: false, + serializedName: 'properties.backendPort', + type: { + name: 'Number' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + enableFloatingIP: { + required: false, + serializedName: 'properties.enableFloatingIP', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InboundNatRule; diff --git a/lib/services/networkManagement2/lib/lib/models/inboundNatRuleListResult.js b/lib/services/networkManagement2/lib/lib/models/inboundNatRuleListResult.js new file mode 100644 index 0000000000..6bc8468b6d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/inboundNatRuleListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListInboundNatRule API service call. + */ +class InboundNatRuleListResult extends Array { + /** + * Create a InboundNatRuleListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InboundNatRuleListResult + * + * @returns {object} metadata of InboundNatRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'InboundNatRuleListResult', + type: { + name: 'Composite', + className: 'InboundNatRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InboundNatRuleElementType', + type: { + name: 'Composite', + className: 'InboundNatRule' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InboundNatRuleListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/index.d.ts b/lib/services/networkManagement2/lib/lib/models/index.d.ts new file mode 100644 index 0000000000..57f6af7873 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/index.d.ts @@ -0,0 +1,6789 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the SubResource class. + * @constructor + * Reference to another subresource. + * + * @member {string} [id] Resource ID. + */ +export interface SubResource extends BaseResource { + id?: string; +} + +/** + * @class + * Initializes a new instance of the BackendAddressPool class. + * @constructor + * Pool of backend IP addresses. + * + * @member {array} [backendIPConfigurations] Gets collection of references to + * IP addresses defined in network interfaces. + * @member {array} [loadBalancingRules] Gets load balancing rules that use this + * backend address pool. + * @member {object} [outboundNatRule] Gets outbound rules that use this backend + * address pool. + * @member {string} [outboundNatRule.id] Resource ID. + * @member {string} [provisioningState] Get provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface BackendAddressPool extends SubResource { + readonly backendIPConfigurations?: NetworkInterfaceIPConfiguration[]; + readonly loadBalancingRules?: SubResource[]; + readonly outboundNatRule?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the InboundNatRule class. + * @constructor + * Inbound NAT rule of the load balancer. + * + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [backendIPConfiguration] A reference to a private IP + * address defined on a network interface of a VM. Traffic sent to the frontend + * port of each of the frontend IP configurations is forwarded to the backend + * IP. + * @member {array} + * [backendIPConfiguration.applicationGatewayBackendAddressPools] The reference + * of ApplicationGatewayBackendAddressPool resource. + * @member {array} [backendIPConfiguration.loadBalancerBackendAddressPools] The + * reference of LoadBalancerBackendAddressPool resource. + * @member {array} [backendIPConfiguration.loadBalancerInboundNatRules] A list + * of references of LoadBalancerInboundNatRules. + * @member {string} [backendIPConfiguration.privateIPAddress] Private IP + * address of the IP configuration. + * @member {string} [backendIPConfiguration.privateIPAllocationMethod] Defines + * how a private IP address is assigned. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {string} [backendIPConfiguration.privateIPAddressVersion] Available + * from Api-Version 2016-03-30 onwards, it represents whether the specific + * ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values + * are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {object} [backendIPConfiguration.subnet] Subnet bound to the IP + * configuration. + * @member {string} [backendIPConfiguration.subnet.addressPrefix] The address + * prefix for the subnet. + * @member {object} [backendIPConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [backendIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [backendIPConfiguration.subnet.networkSecurityGroup.subnets] + * A collection of references to subnets. + * @member {string} + * [backendIPConfiguration.subnet.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * @member {string} + * [backendIPConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.subnet.networkSecurityGroup.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [backendIPConfiguration.subnet.routeTable] The reference of + * the RouteTable resource. + * @member {array} [backendIPConfiguration.subnet.routeTable.routes] Collection + * of routes contained within a route table. + * @member {array} [backendIPConfiguration.subnet.routeTable.subnets] A + * collection of references to subnets. + * @member {boolean} + * [backendIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets + * or sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} + * [backendIPConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.subnet.routeTable.etag] Gets a + * unique read-only string that changes whenever the resource is updated. + * @member {array} [backendIPConfiguration.subnet.serviceEndpoints] An array of + * service endpoints. + * @member {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an + * array of references to the network interface IP configurations using subnet. + * @member {array} [backendIPConfiguration.subnet.resourceNavigationLinks] Gets + * an array of references to the external resources using subnet. + * @member {string} [backendIPConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [backendIPConfiguration.subnet.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [backendIPConfiguration.subnet.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {boolean} [backendIPConfiguration.primary] Gets whether this is a + * primary customer address on the network interface. + * @member {object} [backendIPConfiguration.publicIPAddress] Public IP address + * bound to the IP configuration. + * @member {object} [backendIPConfiguration.publicIPAddress.sku] The public IP + * address SKU. + * @member {string} [backendIPConfiguration.publicIPAddress.sku.name] Name of a + * public IP address SKU. Possible values include: 'Basic', 'Standard' + * @member {string} + * [backendIPConfiguration.publicIPAddress.publicIPAllocationMethod] The public + * IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} + * [backendIPConfiguration.publicIPAddress.publicIPAddressVersion] The public + * IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [backendIPConfiguration.publicIPAddress.ipConfiguration] + * The IP configuration associated with the public IP address. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] + * The private IP address of the IP configuration. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet] The + * reference of the subnet resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] + * The address prefix for the subnet. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] + * The reference of the NetworkSecurityGroup resource. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] + * A collection of references to subnets. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] + * A unique read-only string that changes whenever the resource is updated. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] + * The reference of the RouteTable resource. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] + * An array of service endpoints. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations using + * subnet. + * @member {array} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] + * Gets an array of references to the external resources using subnet. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] The + * name of the resource that is unique within a resource group. This name can + * be used to access the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] + * Gets the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} + * [backendIPConfiguration.publicIPAddress.ipConfiguration.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [backendIPConfiguration.publicIPAddress.dnsSettings] The + * FQDN of the DNS record associated with the public IP address. + * @member {string} + * [backendIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or + * sets the Domain name label.The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [backendIPConfiguration.publicIPAddress.dnsSettings.fqdn] + * Gets the FQDN, Fully qualified domain name of the A DNS record associated + * with the public IP. This is the concatenation of the domainNameLabel and the + * regionalized DNS zone. + * @member {string} + * [backendIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] Gets or + * Sets the Reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, then a + * PTR DNS record is created pointing from the IP address in the in-addr.arpa + * domain to the reverse FQDN. + * @member {array} [backendIPConfiguration.publicIPAddress.ipTags] The list of + * tags associated with the public IP address. + * @member {string} [backendIPConfiguration.publicIPAddress.ipAddress] The IP + * address associated with the public IP address resource. + * @member {number} + * [backendIPConfiguration.publicIPAddress.idleTimeoutInMinutes] The idle + * timeout of the public IP address. + * @member {string} [backendIPConfiguration.publicIPAddress.resourceGuid] The + * resource GUID property of the public IP resource. + * @member {string} [backendIPConfiguration.publicIPAddress.provisioningState] + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.publicIPAddress.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {array} [backendIPConfiguration.publicIPAddress.zones] A list of + * availability zones denoting the IP allocated for the resource needs to come + * from. + * @member {array} [backendIPConfiguration.applicationSecurityGroups] + * Application security groups in which the IP configuration is included. + * @member {string} [backendIPConfiguration.provisioningState] The provisioning + * state of the network interface IP configuration. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [backendIPConfiguration.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * @member {string} [backendIPConfiguration.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {string} [protocol] Possible values include: 'Udp', 'Tcp', 'All' + * @member {number} [frontendPort] The port for the external endpoint. Port + * numbers for each rule must be unique within the Load Balancer. Acceptable + * values range from 1 to 65534. + * @member {number} [backendPort] The port used for the internal endpoint. + * Acceptable values range from 1 to 65535. + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default value + * is 4 minutes. This element is only used when the protocol is set to TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's endpoint + * for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you + * create the endpoint. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface InboundNatRule extends SubResource { + frontendIPConfiguration?: SubResource; + readonly backendIPConfiguration?: NetworkInterfaceIPConfiguration; + protocol?: string; + frontendPort?: number; + backendPort?: number; + idleTimeoutInMinutes?: number; + enableFloatingIP?: boolean; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Common resource representation. + * + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + */ +export interface Resource extends BaseResource { + id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ApplicationSecurityGroup class. + * @constructor + * An application security group in a resource group. + * + * @member {string} [resourceGuid] The resource GUID property of the + * application security group resource. It uniquely identifies a resource, even + * if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * @member {string} [provisioningState] The provisioning state of the + * application security group resource. Possible values are: 'Succeeded', + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ApplicationSecurityGroup extends Resource { + readonly resourceGuid?: string; + readonly provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the SecurityRule class. + * @constructor + * Network security rule. + * + * @member {string} [description] A description for this rule. Restricted to + * 140 chars. + * @member {string} protocol Network protocol this rule applies to. Possible + * values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + * @member {string} [sourcePortRange] The source port or range. Integer or + * range between 0 and 65535. Asterix '*' can also be used to match all ports. + * @member {string} [destinationPortRange] The destination port or range. + * Integer or range between 0 and 65535. Asterix '*' can also be used to match + * all ports. + * @member {string} [sourceAddressPrefix] The CIDR or source IP range. Asterix + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @member {array} [sourceAddressPrefixes] The CIDR or source IP ranges. + * @member {array} [sourceApplicationSecurityGroups] The application security + * group specified as source. + * @member {string} [destinationAddressPrefix] The destination address prefix. + * CIDR or destination IP range. Asterix '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + * 'Internet' can also be used. + * @member {array} [destinationAddressPrefixes] The destination address + * prefixes. CIDR or destination IP ranges. + * @member {array} [destinationApplicationSecurityGroups] The application + * security group specified as destination. + * @member {array} [sourcePortRanges] The source port ranges. + * @member {array} [destinationPortRanges] The destination port ranges. + * @member {string} access The network traffic is allowed or denied. Possible + * values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {number} [priority] The priority of the rule. The value can be + * between 100 and 4096. The priority number must be unique for each rule in + * the collection. The lower the priority number, the higher the priority of + * the rule. + * @member {string} direction The direction of the rule. The direction + * specifies if rule will be evaluated on incoming or outcoming traffic. + * Possible values are: 'Inbound' and 'Outbound'. Possible values include: + * 'Inbound', 'Outbound' + * @member {string} [provisioningState] The provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface SecurityRule extends SubResource { + description?: string; + protocol: string; + sourcePortRange?: string; + destinationPortRange?: string; + sourceAddressPrefix?: string; + sourceAddressPrefixes?: string[]; + sourceApplicationSecurityGroups?: ApplicationSecurityGroup[]; + destinationAddressPrefix?: string; + destinationAddressPrefixes?: string[]; + destinationApplicationSecurityGroups?: ApplicationSecurityGroup[]; + sourcePortRanges?: string[]; + destinationPortRanges?: string[]; + access: string; + priority?: number; + direction: string; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceDnsSettings class. + * @constructor + * DNS settings of a network interface. + * + * @member {array} [dnsServers] List of DNS servers IP addresses. Use + * 'AzureProvidedDNS' to switch to azure provided DNS resolution. + * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + * only value in dnsServers collection. + * @member {array} [appliedDnsServers] If the VM that uses this NIC is part of + * an Availability Set, then this list will have the union of all DNS servers + * from all NICs that are part of the Availability Set. This property is what + * is configured on each of those VMs. + * @member {string} [internalDnsNameLabel] Relative DNS name for this NIC used + * for internal communications between VMs in the same virtual network. + * @member {string} [internalFqdn] Fully qualified DNS name supporting internal + * communications between VMs in the same virtual network. + * @member {string} [internalDomainNameSuffix] Even if internalDnsNameLabel is + * not specified, a DNS entry is created for the primary NIC of the VM. This + * DNS name can be constructed by concatenating the VM name with the value of + * internalDomainNameSuffix. + */ +export interface NetworkInterfaceDnsSettings { + dnsServers?: string[]; + appliedDnsServers?: string[]; + internalDnsNameLabel?: string; + internalFqdn?: string; + internalDomainNameSuffix?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterface class. + * @constructor + * A network interface in a resource group. + * + * @member {object} [virtualMachine] The reference of a virtual machine. + * @member {string} [virtualMachine.id] Resource ID. + * @member {object} [networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [networkSecurityGroup.defaultSecurityRules] The default + * security rules of network security group. + * @member {array} [networkSecurityGroup.networkInterfaces] A collection of + * references to network interfaces. + * @member {array} [networkSecurityGroup.subnets] A collection of references to + * subnets. + * @member {string} [networkSecurityGroup.resourceGuid] The resource GUID + * property of the network security group resource. + * @member {string} [networkSecurityGroup.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [networkSecurityGroup.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [ipConfigurations] A list of IPConfigurations of the network + * interface. + * @member {object} [dnsSettings] The DNS settings in network interface. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses. + * Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. + * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + * only value in dnsServers collection. + * @member {array} [dnsSettings.appliedDnsServers] If the VM that uses this NIC + * is part of an Availability Set, then this list will have the union of all + * DNS servers from all NICs that are part of the Availability Set. This + * property is what is configured on each of those VMs. + * @member {string} [dnsSettings.internalDnsNameLabel] Relative DNS name for + * this NIC used for internal communications between VMs in the same virtual + * network. + * @member {string} [dnsSettings.internalFqdn] Fully qualified DNS name + * supporting internal communications between VMs in the same virtual network. + * @member {string} [dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * @member {string} [macAddress] The MAC address of the network interface. + * @member {boolean} [primary] Gets whether this is a primary network interface + * on a virtual machine. + * @member {boolean} [enableAcceleratedNetworking] If the network interface is + * accelerated networking enabled. + * @member {boolean} [enableIPForwarding] Indicates whether IP forwarding is + * enabled on this network interface. + * @member {string} [resourceGuid] The resource GUID property of the network + * interface resource. + * @member {string} [provisioningState] The provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface NetworkInterface extends Resource { + virtualMachine?: SubResource; + networkSecurityGroup?: NetworkSecurityGroup; + ipConfigurations?: NetworkInterfaceIPConfiguration[]; + dnsSettings?: NetworkInterfaceDnsSettings; + macAddress?: string; + primary?: boolean; + enableAcceleratedNetworking?: boolean; + enableIPForwarding?: boolean; + resourceGuid?: string; + provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkSecurityGroup class. + * @constructor + * NetworkSecurityGroup resource. + * + * @member {array} [securityRules] A collection of security rules of the + * network security group. + * @member {array} [defaultSecurityRules] The default security rules of network + * security group. + * @member {array} [networkInterfaces] A collection of references to network + * interfaces. + * @member {array} [subnets] A collection of references to subnets. + * @member {string} [resourceGuid] The resource GUID property of the network + * security group resource. + * @member {string} [provisioningState] The provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface NetworkSecurityGroup extends Resource { + securityRules?: SecurityRule[]; + defaultSecurityRules?: SecurityRule[]; + readonly networkInterfaces?: NetworkInterface[]; + readonly subnets?: Subnet[]; + resourceGuid?: string; + provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the Route class. + * @constructor + * Route resource + * + * @member {string} [addressPrefix] The destination CIDR to which the route + * applies. + * @member {string} nextHopType The type of Azure hop the packet should be sent + * to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', and 'None'. Possible values include: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + * @member {string} [nextHopIpAddress] The IP address packets should be + * forwarded to. Next hop values are only allowed in routes where the next hop + * type is VirtualAppliance. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface Route extends SubResource { + addressPrefix?: string; + nextHopType: string; + nextHopIpAddress?: string; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the RouteTable class. + * @constructor + * Route table resource. + * + * @member {array} [routes] Collection of routes contained within a route + * table. + * @member {array} [subnets] A collection of references to subnets. + * @member {boolean} [disableBgpRoutePropagation] Gets or sets whether to + * disable the routes learned by BGP on that route table. True means disable. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface RouteTable extends Resource { + routes?: Route[]; + readonly subnets?: Subnet[]; + disableBgpRoutePropagation?: boolean; + provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceEndpointPropertiesFormat class. + * @constructor + * The service endpoint properties. + * + * @member {string} [service] The type of the endpoint service. + * @member {array} [locations] A list of locations. + * @member {string} [provisioningState] The provisioning state of the resource. + */ +export interface ServiceEndpointPropertiesFormat { + service?: string; + locations?: string[]; + provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the PublicIPAddressSku class. + * @constructor + * SKU of a public IP address + * + * @member {string} [name] Name of a public IP address SKU. Possible values + * include: 'Basic', 'Standard' + */ +export interface PublicIPAddressSku { + name?: string; +} + +/** + * @class + * Initializes a new instance of the PublicIPAddressDnsSettings class. + * @constructor + * Contains FQDN of the DNS record associated with the public IP address + * + * @member {string} [domainNameLabel] Gets or sets the Domain name label.The + * concatenation of the domain name label and the regionalized DNS zone make up + * the fully qualified domain name associated with the public IP address. If a + * domain name label is specified, an A DNS record is created for the public IP + * in the Microsoft Azure DNS system. + * @member {string} [fqdn] Gets the FQDN, Fully qualified domain name of the A + * DNS record associated with the public IP. This is the concatenation of the + * domainNameLabel and the regionalized DNS zone. + * @member {string} [reverseFqdn] Gets or Sets the Reverse FQDN. A + * user-visible, fully qualified domain name that resolves to this public IP + * address. If the reverseFqdn is specified, then a PTR DNS record is created + * pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + */ +export interface PublicIPAddressDnsSettings { + domainNameLabel?: string; + fqdn?: string; + reverseFqdn?: string; +} + +/** + * @class + * Initializes a new instance of the IpTag class. + * @constructor + * Contains the IpTag associated with the public IP address + * + * @member {string} [ipTagType] Gets or sets the ipTag type: Example + * FirstPartyUsage. + * @member {string} [tag] Gets or sets value of the IpTag associated with the + * public IP. Example SQL, Storage etc + */ +export interface IpTag { + ipTagType?: string; + tag?: string; +} + +/** + * @class + * Initializes a new instance of the PublicIPAddress class. + * @constructor + * Public IP address resource. + * + * @member {object} [sku] The public IP address SKU. + * @member {string} [sku.name] Name of a public IP address SKU. Possible values + * include: 'Basic', 'Standard' + * @member {string} [publicIPAllocationMethod] The public IP allocation method. + * Possible values are: 'Static' and 'Dynamic'. Possible values include: + * 'Static', 'Dynamic' + * @member {string} [publicIPAddressVersion] The public IP address version. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6' + * @member {object} [ipConfiguration] The IP configuration associated with the + * public IP address. + * @member {string} [ipConfiguration.privateIPAddress] The private IP address + * of the IP configuration. + * @member {string} [ipConfiguration.privateIPAllocationMethod] The private IP + * allocation method. Possible values are 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {object} [ipConfiguration.subnet] The reference of the subnet + * resource. + * @member {string} [ipConfiguration.subnet.addressPrefix] The address prefix + * for the subnet. + * @member {object} [ipConfiguration.subnet.networkSecurityGroup] The reference + * of the NetworkSecurityGroup resource. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A collection + * of references to network interfaces. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.subnet.routeTable] The reference of the + * RouteTable resource. + * @member {array} [ipConfiguration.subnet.routeTable.routes] Collection of + * routes contained within a route table. + * @member {array} [ipConfiguration.subnet.routeTable.subnets] A collection of + * references to subnets. + * @member {boolean} + * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * @member {string} [ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of + * service endpoints. + * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of + * references to the network interface IP configurations using subnet. + * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [ipConfiguration.subnet.provisioningState] The provisioning + * state of the resource. + * @member {string} [ipConfiguration.subnet.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.subnet.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {object} [ipConfiguration.publicIPAddress] The reference of the + * public IP resource. + * @member {string} [ipConfiguration.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {object} [dnsSettings] The FQDN of the DNS record associated with + * the public IP address. + * @member {string} [dnsSettings.domainNameLabel] Gets or sets the Domain name + * label.The concatenation of the domain name label and the regionalized DNS + * zone make up the fully qualified domain name associated with the public IP + * address. If a domain name label is specified, an A DNS record is created for + * the public IP in the Microsoft Azure DNS system. + * @member {string} [dnsSettings.fqdn] Gets the FQDN, Fully qualified domain + * name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * @member {string} [dnsSettings.reverseFqdn] Gets or Sets the Reverse FQDN. A + * user-visible, fully qualified domain name that resolves to this public IP + * address. If the reverseFqdn is specified, then a PTR DNS record is created + * pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * @member {array} [ipTags] The list of tags associated with the public IP + * address. + * @member {string} [ipAddress] The IP address associated with the public IP + * address resource. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {string} [resourceGuid] The resource GUID property of the public IP + * resource. + * @member {string} [provisioningState] The provisioning state of the PublicIP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {array} [zones] A list of availability zones denoting the IP + * allocated for the resource needs to come from. + */ +export interface PublicIPAddress extends Resource { + sku?: PublicIPAddressSku; + publicIPAllocationMethod?: string; + publicIPAddressVersion?: string; + readonly ipConfiguration?: IPConfiguration; + dnsSettings?: PublicIPAddressDnsSettings; + ipTags?: IpTag[]; + ipAddress?: string; + idleTimeoutInMinutes?: number; + resourceGuid?: string; + provisioningState?: string; + etag?: string; + zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the IPConfiguration class. + * @constructor + * IP configuration + * + * @member {string} [privateIPAddress] The private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] The private IP allocation + * method. Possible values are 'Static' and 'Dynamic'. Possible values include: + * 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A collection + * of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. True + * means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to the + * network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of references + * to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {object} [publicIPAddress] The reference of the public IP resource. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or sets + * the Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated with + * the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout of + * the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface IPConfiguration extends SubResource { + privateIPAddress?: string; + privateIPAllocationMethod?: string; + subnet?: Subnet; + publicIPAddress?: PublicIPAddress; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceNavigationLink class. + * @constructor + * ResourceNavigationLink resource. + * + * @member {string} [linkedResourceType] Resource type of the linked resource. + * @member {string} [link] Link to the external resource + * @member {string} [provisioningState] Provisioning state of the + * ResourceNavigationLink resource. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ResourceNavigationLink extends SubResource { + linkedResourceType?: string; + link?: string; + readonly provisioningState?: string; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the Subnet class. + * @constructor + * Subnet in a virtual network resource. + * + * @member {string} [addressPrefix] The address prefix for the subnet. + * @member {object} [networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [networkSecurityGroup.defaultSecurityRules] The default + * security rules of network security group. + * @member {array} [networkSecurityGroup.networkInterfaces] A collection of + * references to network interfaces. + * @member {array} [networkSecurityGroup.subnets] A collection of references to + * subnets. + * @member {string} [networkSecurityGroup.resourceGuid] The resource GUID + * property of the network security group resource. + * @member {string} [networkSecurityGroup.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [networkSecurityGroup.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {object} [routeTable] The reference of the RouteTable resource. + * @member {array} [routeTable.routes] Collection of routes contained within a + * route table. + * @member {array} [routeTable.subnets] A collection of references to subnets. + * @member {boolean} [routeTable.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * @member {string} [routeTable.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [routeTable.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {array} [serviceEndpoints] An array of service endpoints. + * @member {array} [ipConfigurations] Gets an array of references to the + * network interface IP configurations using subnet. + * @member {array} [resourceNavigationLinks] Gets an array of references to the + * external resources using subnet. + * @member {string} [provisioningState] The provisioning state of the resource. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface Subnet extends SubResource { + addressPrefix?: string; + networkSecurityGroup?: NetworkSecurityGroup; + routeTable?: RouteTable; + serviceEndpoints?: ServiceEndpointPropertiesFormat[]; + readonly ipConfigurations?: IPConfiguration[]; + resourceNavigationLinks?: ResourceNavigationLink[]; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceIPConfiguration class. + * @constructor + * IPConfiguration in a network interface. + * + * @member {array} [applicationGatewayBackendAddressPools] The reference of + * ApplicationGatewayBackendAddressPool resource. + * @member {array} [loadBalancerBackendAddressPools] The reference of + * LoadBalancerBackendAddressPool resource. + * @member {array} [loadBalancerInboundNatRules] A list of references of + * LoadBalancerInboundNatRules. + * @member {string} [privateIPAddress] Private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] Defines how a private IP + * address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2016-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {object} [subnet] Subnet bound to the IP configuration. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A collection + * of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. True + * means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to the + * network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of references + * to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {boolean} [primary] Gets whether this is a primary customer address + * on the network interface. + * @member {object} [publicIPAddress] Public IP address bound to the IP + * configuration. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} [publicIPAddress.ipConfiguration.subnet] The reference of + * the subnet resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] The + * address prefix for the subnet. + * @member {object} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The reference + * of the NetworkSecurityGroup resource. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An + * array of service endpoints. + * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations using + * subnet. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} [publicIPAddress.ipConfiguration.provisioningState] Gets + * the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [publicIPAddress.ipConfiguration.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or sets + * the Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated with + * the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout of + * the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {array} [applicationSecurityGroups] Application security groups in + * which the IP configuration is included. + * @member {string} [provisioningState] The provisioning state of the network + * interface IP configuration. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface NetworkInterfaceIPConfiguration extends SubResource { + applicationGatewayBackendAddressPools?: ApplicationGatewayBackendAddressPool[]; + loadBalancerBackendAddressPools?: BackendAddressPool[]; + loadBalancerInboundNatRules?: InboundNatRule[]; + privateIPAddress?: string; + privateIPAllocationMethod?: string; + privateIPAddressVersion?: string; + subnet?: Subnet; + primary?: boolean; + publicIPAddress?: PublicIPAddress; + applicationSecurityGroups?: ApplicationSecurityGroup[]; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendAddress class. + * @constructor + * Backend address of an application gateway. + * + * @member {string} [fqdn] Fully qualified domain name (FQDN). + * @member {string} [ipAddress] IP address + */ +export interface ApplicationGatewayBackendAddress { + fqdn?: string; + ipAddress?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendAddressPool class. + * @constructor + * Backend Address Pool of an application gateway. + * + * @member {array} [backendIPConfigurations] Collection of references to IPs + * defined in network interfaces. + * @member {array} [backendAddresses] Backend addresses + * @member {string} [provisioningState] Provisioning state of the backend + * address pool resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Resource that is unique within a resource group. + * This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayBackendAddressPool extends SubResource { + backendIPConfigurations?: NetworkInterfaceIPConfiguration[]; + backendAddresses?: ApplicationGatewayBackendAddress[]; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayConnectionDraining class. + * @constructor + * Connection draining allows open connections to a backend server to be active + * for a specified time after the backend server got removed from the + * configuration. + * + * @member {boolean} enabled Whether connection draining is enabled or not. + * @member {number} drainTimeoutInSec The number of seconds connection draining + * is active. Acceptable values are from 1 second to 3600 seconds. + */ +export interface ApplicationGatewayConnectionDraining { + enabled: boolean; + drainTimeoutInSec: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendHttpSettings class. + * @constructor + * Backend address pool settings of an application gateway. + * + * @member {number} [port] Port + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [cookieBasedAffinity] Cookie based affinity. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [requestTimeout] Request timeout in seconds. Application + * Gateway will fail the request if response is not received within + * RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * @member {object} [probe] Probe resource of an application gateway. + * @member {string} [probe.id] Resource ID. + * @member {array} [authenticationCertificates] Array of references to + * application gateway authentication certificates. + * @member {object} [connectionDraining] Connection draining of the backend + * http settings resource. + * @member {boolean} [connectionDraining.enabled] Whether connection draining + * is enabled or not. + * @member {number} [connectionDraining.drainTimeoutInSec] The number of + * seconds connection draining is active. Acceptable values are from 1 second + * to 3600 seconds. + * @member {string} [hostName] Host header to be sent to the backend servers. + * @member {boolean} [pickHostNameFromBackendAddress] Whether to pick host + * header should be picked from the host name of the backend server. Default + * value is false. + * @member {string} [affinityCookieName] Cookie name to use for the affinity + * cookie. + * @member {boolean} [probeEnabled] Whether the probe is enabled. Default value + * is false. + * @member {string} [path] Path which should be used as a prefix for all HTTP + * requests. Null means no path will be prefixed. Default value is null. + * @member {string} [provisioningState] Provisioning state of the backend http + * settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayBackendHttpSettings extends SubResource { + port?: number; + protocol?: string; + cookieBasedAffinity?: string; + requestTimeout?: number; + probe?: SubResource; + authenticationCertificates?: SubResource[]; + connectionDraining?: ApplicationGatewayConnectionDraining; + hostName?: string; + pickHostNameFromBackendAddress?: boolean; + affinityCookieName?: string; + probeEnabled?: boolean; + path?: string; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendHealthServer class. + * @constructor + * Application gateway backendhealth http settings. + * + * @member {string} [address] IP address or FQDN of backend server. + * @member {object} [ipConfiguration] Reference of IP configuration of backend + * server. + * @member {array} [ipConfiguration.applicationGatewayBackendAddressPools] The + * reference of ApplicationGatewayBackendAddressPool resource. + * @member {array} [ipConfiguration.loadBalancerBackendAddressPools] The + * reference of LoadBalancerBackendAddressPool resource. + * @member {array} [ipConfiguration.loadBalancerInboundNatRules] A list of + * references of LoadBalancerInboundNatRules. + * @member {string} [ipConfiguration.privateIPAddress] Private IP address of + * the IP configuration. + * @member {string} [ipConfiguration.privateIPAllocationMethod] Defines how a + * private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. + * Possible values include: 'Static', 'Dynamic' + * @member {string} [ipConfiguration.privateIPAddressVersion] Available from + * Api-Version 2016-03-30 onwards, it represents whether the specific + * ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values + * are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {object} [ipConfiguration.subnet] Subnet bound to the IP + * configuration. + * @member {string} [ipConfiguration.subnet.addressPrefix] The address prefix + * for the subnet. + * @member {object} [ipConfiguration.subnet.networkSecurityGroup] The reference + * of the NetworkSecurityGroup resource. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A collection + * of references to network interfaces. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.subnet.routeTable] The reference of the + * RouteTable resource. + * @member {array} [ipConfiguration.subnet.routeTable.routes] Collection of + * routes contained within a route table. + * @member {array} [ipConfiguration.subnet.routeTable.subnets] A collection of + * references to subnets. + * @member {boolean} + * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * @member {string} [ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of + * service endpoints. + * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of + * references to the network interface IP configurations using subnet. + * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [ipConfiguration.subnet.provisioningState] The provisioning + * state of the resource. + * @member {string} [ipConfiguration.subnet.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.subnet.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {boolean} [ipConfiguration.primary] Gets whether this is a primary + * customer address on the network interface. + * @member {object} [ipConfiguration.publicIPAddress] Public IP address bound + * to the IP configuration. + * @member {object} [ipConfiguration.publicIPAddress.sku] The public IP address + * SKU. + * @member {string} [ipConfiguration.publicIPAddress.sku.name] Name of a public + * IP address SKU. Possible values include: 'Basic', 'Standard' + * @member {string} [ipConfiguration.publicIPAddress.publicIPAllocationMethod] + * The public IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {string} [ipConfiguration.publicIPAddress.publicIPAddressVersion] + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6' + * @member {object} [ipConfiguration.publicIPAddress.ipConfiguration] The IP + * configuration associated with the public IP address. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} [ipConfiguration.publicIPAddress.ipConfiguration.subnet] + * The reference of the subnet resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] The + * address prefix for the subnet. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] + * The reference of the NetworkSecurityGroup resource. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] + * A collection of references to subnets. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] + * A unique read-only string that changes whenever the resource is updated. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An + * array of service endpoints. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations using + * subnet. + * @member {array} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] + * Gets an array of references to the external resources using subnet. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} + * [ipConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} + * [ipConfiguration.publicIPAddress.ipConfiguration.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.publicIPAddress.ipConfiguration.name] The + * name of the resource that is unique within a resource group. This name can + * be used to access the resource. + * @member {string} [ipConfiguration.publicIPAddress.ipConfiguration.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.publicIPAddress.dnsSettings] The FQDN of + * the DNS record associated with the public IP address. + * @member {string} + * [ipConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or sets + * the Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [ipConfiguration.publicIPAddress.dnsSettings.fqdn] Gets the + * FQDN, Fully qualified domain name of the A DNS record associated with the + * public IP. This is the concatenation of the domainNameLabel and the + * regionalized DNS zone. + * @member {string} [ipConfiguration.publicIPAddress.dnsSettings.reverseFqdn] + * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name + * that resolves to this public IP address. If the reverseFqdn is specified, + * then a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [ipConfiguration.publicIPAddress.ipTags] The list of tags + * associated with the public IP address. + * @member {string} [ipConfiguration.publicIPAddress.ipAddress] The IP address + * associated with the public IP address resource. + * @member {number} [ipConfiguration.publicIPAddress.idleTimeoutInMinutes] The + * idle timeout of the public IP address. + * @member {string} [ipConfiguration.publicIPAddress.resourceGuid] The resource + * GUID property of the public IP resource. + * @member {string} [ipConfiguration.publicIPAddress.provisioningState] The + * provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.publicIPAddress.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.publicIPAddress.zones] A list of + * availability zones denoting the IP allocated for the resource needs to come + * from. + * @member {array} [ipConfiguration.applicationSecurityGroups] Application + * security groups in which the IP configuration is included. + * @member {string} [ipConfiguration.provisioningState] The provisioning state + * of the network interface IP configuration. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [health] Health of backend server. Possible values include: + * 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + */ +export interface ApplicationGatewayBackendHealthServer { + address?: string; + ipConfiguration?: NetworkInterfaceIPConfiguration; + health?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendHealthHttpSettings class. + * @constructor + * Application gateway BackendHealthHttp settings. + * + * @member {object} [backendHttpSettings] Reference of an + * ApplicationGatewayBackendHttpSettings resource. + * @member {number} [backendHttpSettings.port] Port + * @member {string} [backendHttpSettings.protocol] Protocol. Possible values + * include: 'Http', 'Https' + * @member {string} [backendHttpSettings.cookieBasedAffinity] Cookie based + * affinity. Possible values include: 'Enabled', 'Disabled' + * @member {number} [backendHttpSettings.requestTimeout] Request timeout in + * seconds. Application Gateway will fail the request if response is not + * received within RequestTimeout. Acceptable values are from 1 second to 86400 + * seconds. + * @member {object} [backendHttpSettings.probe] Probe resource of an + * application gateway. + * @member {string} [backendHttpSettings.probe.id] Resource ID. + * @member {array} [backendHttpSettings.authenticationCertificates] Array of + * references to application gateway authentication certificates. + * @member {object} [backendHttpSettings.connectionDraining] Connection + * draining of the backend http settings resource. + * @member {boolean} [backendHttpSettings.connectionDraining.enabled] Whether + * connection draining is enabled or not. + * @member {number} [backendHttpSettings.connectionDraining.drainTimeoutInSec] + * The number of seconds connection draining is active. Acceptable values are + * from 1 second to 3600 seconds. + * @member {string} [backendHttpSettings.hostName] Host header to be sent to + * the backend servers. + * @member {boolean} [backendHttpSettings.pickHostNameFromBackendAddress] + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + * @member {string} [backendHttpSettings.affinityCookieName] Cookie name to use + * for the affinity cookie. + * @member {boolean} [backendHttpSettings.probeEnabled] Whether the probe is + * enabled. Default value is false. + * @member {string} [backendHttpSettings.path] Path which should be used as a + * prefix for all HTTP requests. Null means no path will be prefixed. Default + * value is null. + * @member {string} [backendHttpSettings.provisioningState] Provisioning state + * of the backend http settings resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [backendHttpSettings.name] Name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [backendHttpSettings.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [backendHttpSettings.type] Type of the resource. + * @member {array} [servers] List of ApplicationGatewayBackendHealthServer + * resources. + */ +export interface ApplicationGatewayBackendHealthHttpSettings { + backendHttpSettings?: ApplicationGatewayBackendHttpSettings; + servers?: ApplicationGatewayBackendHealthServer[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendHealthPool class. + * @constructor + * Application gateway BackendHealth pool. + * + * @member {object} [backendAddressPool] Reference of an + * ApplicationGatewayBackendAddressPool resource. + * @member {array} [backendAddressPool.backendIPConfigurations] Collection of + * references to IPs defined in network interfaces. + * @member {array} [backendAddressPool.backendAddresses] Backend addresses + * @member {string} [backendAddressPool.provisioningState] Provisioning state + * of the backend address pool resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [backendAddressPool.name] Resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [backendAddressPool.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} [backendAddressPool.type] Type of the resource. + * @member {array} [backendHttpSettingsCollection] List of + * ApplicationGatewayBackendHealthHttpSettings resources. + */ +export interface ApplicationGatewayBackendHealthPool { + backendAddressPool?: ApplicationGatewayBackendAddressPool; + backendHttpSettingsCollection?: ApplicationGatewayBackendHealthHttpSettings[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayBackendHealth class. + * @constructor + * List of ApplicationGatewayBackendHealthPool resources. + * + * @member {array} [backendAddressPools] + */ +export interface ApplicationGatewayBackendHealth { + backendAddressPools?: ApplicationGatewayBackendHealthPool[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewaySku class. + * @constructor + * SKU of an application gateway + * + * @member {string} [name] Name of an application gateway SKU. Possible values + * include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + * 'WAF_Medium', 'WAF_Large' + * @member {string} [tier] Tier of an application gateway. Possible values + * include: 'Standard', 'WAF' + * @member {number} [capacity] Capacity (instance count) of an application + * gateway. + */ +export interface ApplicationGatewaySku { + name?: string; + tier?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewaySslPolicy class. + * @constructor + * Application Gateway Ssl policy. + * + * @member {array} [disabledSslProtocols] Ssl protocols to be disabled on + * application gateway. + * @member {string} [policyType] Type of Ssl Policy. Possible values include: + * 'Predefined', 'Custom' + * @member {string} [policyName] Name of Ssl predefined policy. Possible values + * include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S' + * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the + * specified order to application gateway. + * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to be + * supported on application gateway. Possible values include: 'TLSv1_0', + * 'TLSv1_1', 'TLSv1_2' + */ +export interface ApplicationGatewaySslPolicy { + disabledSslProtocols?: string[]; + policyType?: string; + policyName?: string; + cipherSuites?: string[]; + minProtocolVersion?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayIPConfiguration class. + * @constructor + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + * + * @member {object} [subnet] Reference of the subnet resource. A subnet from + * where application gateway gets its private address. + * @member {string} [subnet.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the application + * gateway subnet resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayIPConfiguration extends SubResource { + subnet?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayAuthenticationCertificate class. + * @constructor + * Authentication certificates of an application gateway. + * + * @member {string} [data] Certificate public data. + * @member {string} [provisioningState] Provisioning state of the + * authentication certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayAuthenticationCertificate extends SubResource { + data?: string; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewaySslCertificate class. + * @constructor + * SSL certificates of an application gateway. + * + * @member {string} [data] Base-64 encoded pfx certificate. Only applicable in + * PUT Request. + * @member {string} [password] Password for the pfx file specified in data. + * Only applicable in PUT request. + * @member {string} [publicCertData] Base-64 encoded Public cert data + * corresponding to pfx specified in data. Only applicable in GET request. + * @member {string} [provisioningState] Provisioning state of the SSL + * certificate resource Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewaySslCertificate extends SubResource { + data?: string; + password?: string; + publicCertData?: string; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFrontendIPConfiguration class. + * @constructor + * Frontend IP configuration of an application gateway. + * + * @member {string} [privateIPAddress] PrivateIPAddress of the network + * interface IP Configuration. + * @member {string} [privateIPAllocationMethod] PrivateIP allocation method. + * Possible values include: 'Static', 'Dynamic' + * @member {object} [subnet] Reference of the subnet resource. + * @member {string} [subnet.id] Resource ID. + * @member {object} [publicIPAddress] Reference of the PublicIP resource. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayFrontendIPConfiguration extends SubResource { + privateIPAddress?: string; + privateIPAllocationMethod?: string; + subnet?: SubResource; + publicIPAddress?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFrontendPort class. + * @constructor + * Frontend port of an application gateway. + * + * @member {number} [port] Frontend port + * @member {string} [provisioningState] Provisioning state of the frontend port + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayFrontendPort extends SubResource { + port?: number; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayHttpListener class. + * @constructor + * Http listener of an application gateway. + * + * @member {object} [frontendIPConfiguration] Frontend IP configuration + * resource of an application gateway. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [frontendPort] Frontend port resource of an application + * gateway. + * @member {string} [frontendPort.id] Resource ID. + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [hostName] Host name of HTTP listener. + * @member {object} [sslCertificate] SSL certificate resource of an application + * gateway. + * @member {string} [sslCertificate.id] Resource ID. + * @member {boolean} [requireServerNameIndication] Applicable only if protocol + * is https. Enables SNI for multi-hosting. + * @member {string} [provisioningState] Provisioning state of the HTTP listener + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayHttpListener extends SubResource { + frontendIPConfiguration?: SubResource; + frontendPort?: SubResource; + protocol?: string; + hostName?: string; + sslCertificate?: SubResource; + requireServerNameIndication?: boolean; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayPathRule class. + * @constructor + * Path rule of URL path map of an application gateway. + * + * @member {array} [paths] Path rules of URL path map. + * @member {object} [backendAddressPool] Backend address pool resource of URL + * path map path rule. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [backendHttpSettings] Backend http settings resource of URL + * path map path rule. + * @member {string} [backendHttpSettings.id] Resource ID. + * @member {object} [redirectConfiguration] Redirect configuration resource of + * URL path map path rule. + * @member {string} [redirectConfiguration.id] Resource ID. + * @member {string} [provisioningState] Path rule of URL path map resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayPathRule extends SubResource { + paths?: string[]; + backendAddressPool?: SubResource; + backendHttpSettings?: SubResource; + redirectConfiguration?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayProbeHealthResponseMatch class. + * @constructor + * Application gateway probe health response match + * + * @member {string} [body] Body that must be contained in the health response. + * Default value is empty. + * @member {array} [statusCodes] Allowed ranges of healthy status codes. + * Default range of healthy status codes is 200-399. + */ +export interface ApplicationGatewayProbeHealthResponseMatch { + body?: string; + statusCodes?: string[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayProbe class. + * @constructor + * Probe of the application gateway. + * + * @member {string} [protocol] Protocol. Possible values include: 'Http', + * 'Https' + * @member {string} [host] Host name to send the probe to. + * @member {string} [path] Relative path of probe. Valid path starts from '/'. + * Probe is sent to ://: + * @member {number} [interval] The probing interval in seconds. This is the + * time interval between two consecutive probes. Acceptable values are from 1 + * second to 86400 seconds. + * @member {number} [timeout] the probe timeout in seconds. Probe marked as + * failed if valid response is not received with this timeout period. + * Acceptable values are from 1 second to 86400 seconds. + * @member {number} [unhealthyThreshold] The probe retry count. Backend server + * is marked down after consecutive probe failure count reaches + * UnhealthyThreshold. Acceptable values are from 1 second to 20. + * @member {boolean} [pickHostNameFromBackendHttpSettings] Whether the host + * header should be picked from the backend http settings. Default value is + * false. + * @member {number} [minServers] Minimum number of servers that are always + * marked healthy. Default value is 0. + * @member {object} [match] Criterion for classifying a healthy probe response. + * @member {string} [match.body] Body that must be contained in the health + * response. Default value is empty. + * @member {array} [match.statusCodes] Allowed ranges of healthy status codes. + * Default range of healthy status codes is 200-399. + * @member {string} [provisioningState] Provisioning state of the backend http + * settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayProbe extends SubResource { + protocol?: string; + host?: string; + path?: string; + interval?: number; + timeout?: number; + unhealthyThreshold?: number; + pickHostNameFromBackendHttpSettings?: boolean; + minServers?: number; + match?: ApplicationGatewayProbeHealthResponseMatch; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayRequestRoutingRule class. + * @constructor + * Request routing rule of an application gateway. + * + * @member {string} [ruleType] Rule type. Possible values include: 'Basic', + * 'PathBasedRouting' + * @member {object} [backendAddressPool] Backend address pool resource of the + * application gateway. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [backendHttpSettings] Frontend port resource of the + * application gateway. + * @member {string} [backendHttpSettings.id] Resource ID. + * @member {object} [httpListener] Http listener resource of the application + * gateway. + * @member {string} [httpListener.id] Resource ID. + * @member {object} [urlPathMap] URL path map resource of the application + * gateway. + * @member {string} [urlPathMap.id] Resource ID. + * @member {object} [redirectConfiguration] Redirect configuration resource of + * the application gateway. + * @member {string} [redirectConfiguration.id] Resource ID. + * @member {string} [provisioningState] Provisioning state of the request + * routing rule resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayRequestRoutingRule extends SubResource { + ruleType?: string; + backendAddressPool?: SubResource; + backendHttpSettings?: SubResource; + httpListener?: SubResource; + urlPathMap?: SubResource; + redirectConfiguration?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayRedirectConfiguration class. + * @constructor + * Redirect configuration of an application gateway. + * + * @member {string} [redirectType] Supported http redirection types - + * Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', + * 'Found', 'SeeOther', 'Temporary' + * @member {object} [targetListener] Reference to a listener to redirect the + * request to. + * @member {string} [targetListener.id] Resource ID. + * @member {string} [targetUrl] Url to redirect the request to. + * @member {boolean} [includePath] Include path in the redirected url. + * @member {boolean} [includeQueryString] Include query string in the + * redirected url. + * @member {array} [requestRoutingRules] Request routing specifying redirect + * configuration. + * @member {array} [urlPathMaps] Url path maps specifying default redirect + * configuration. + * @member {array} [pathRules] Path rules specifying redirect configuration. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayRedirectConfiguration extends SubResource { + redirectType?: string; + targetListener?: SubResource; + targetUrl?: string; + includePath?: boolean; + includeQueryString?: boolean; + requestRoutingRules?: SubResource[]; + urlPathMaps?: SubResource[]; + pathRules?: SubResource[]; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayUrlPathMap class. + * @constructor + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + * + * @member {object} [defaultBackendAddressPool] Default backend address pool + * resource of URL path map. + * @member {string} [defaultBackendAddressPool.id] Resource ID. + * @member {object} [defaultBackendHttpSettings] Default backend http settings + * resource of URL path map. + * @member {string} [defaultBackendHttpSettings.id] Resource ID. + * @member {object} [defaultRedirectConfiguration] Default redirect + * configuration resource of URL path map. + * @member {string} [defaultRedirectConfiguration.id] Resource ID. + * @member {array} [pathRules] Path rule of URL path map resource. + * @member {string} [provisioningState] Provisioning state of the backend http + * settings resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Type of the resource. + */ +export interface ApplicationGatewayUrlPathMap extends SubResource { + defaultBackendAddressPool?: SubResource; + defaultBackendHttpSettings?: SubResource; + defaultRedirectConfiguration?: SubResource; + pathRules?: ApplicationGatewayPathRule[]; + provisioningState?: string; + name?: string; + etag?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFirewallDisabledRuleGroup class. + * @constructor + * Allows to disable rules within a rule group or an entire rule group. + * + * @member {string} ruleGroupName The name of the rule group that will be + * disabled. + * @member {array} [rules] The list of rules that will be disabled. If null, + * all rules of the rule group will be disabled. + */ +export interface ApplicationGatewayFirewallDisabledRuleGroup { + ruleGroupName: string; + rules?: number[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayWebApplicationFirewallConfiguration class. + * @constructor + * Application gateway web application firewall configuration. + * + * @member {boolean} enabled Whether the web application firewall is enabled or + * not. + * @member {string} firewallMode Web application firewall mode. Possible values + * include: 'Detection', 'Prevention' + * @member {string} ruleSetType The type of the web application firewall rule + * set. Possible values are: 'OWASP'. + * @member {string} ruleSetVersion The version of the rule set type. + * @member {array} [disabledRuleGroups] The disabled rule groups. + * @member {boolean} [requestBodyCheck] Whether allow WAF to check request + * Body. + * @member {number} [maxRequestBodySize] Maxium request body size for WAF. + */ +export interface ApplicationGatewayWebApplicationFirewallConfiguration { + enabled: boolean; + firewallMode: string; + ruleSetType: string; + ruleSetVersion: string; + disabledRuleGroups?: ApplicationGatewayFirewallDisabledRuleGroup[]; + requestBodyCheck?: boolean; + maxRequestBodySize?: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationGateway class. + * @constructor + * Application gateway resource + * + * @member {object} [sku] SKU of the application gateway resource. + * @member {string} [sku.name] Name of an application gateway SKU. Possible + * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + * 'WAF_Medium', 'WAF_Large' + * @member {string} [sku.tier] Tier of an application gateway. Possible values + * include: 'Standard', 'WAF' + * @member {number} [sku.capacity] Capacity (instance count) of an application + * gateway. + * @member {object} [sslPolicy] SSL policy of the application gateway resource. + * @member {array} [sslPolicy.disabledSslProtocols] Ssl protocols to be + * disabled on application gateway. + * @member {string} [sslPolicy.policyType] Type of Ssl Policy. Possible values + * include: 'Predefined', 'Custom' + * @member {string} [sslPolicy.policyName] Name of Ssl predefined policy. + * Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S' + * @member {array} [sslPolicy.cipherSuites] Ssl cipher suites to be enabled in + * the specified order to application gateway. + * @member {string} [sslPolicy.minProtocolVersion] Minimum version of Ssl + * protocol to be supported on application gateway. Possible values include: + * 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * @member {string} [operationalState] Operational state of the application + * gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', + * 'Stopping' + * @member {array} [gatewayIPConfigurations] Subnets of application the gateway + * resource. + * @member {array} [authenticationCertificates] Authentication certificates of + * the application gateway resource. + * @member {array} [sslCertificates] SSL certificates of the application + * gateway resource. + * @member {array} [frontendIPConfigurations] Frontend IP addresses of the + * application gateway resource. + * @member {array} [frontendPorts] Frontend ports of the application gateway + * resource. + * @member {array} [probes] Probes of the application gateway resource. + * @member {array} [backendAddressPools] Backend address pool of the + * application gateway resource. + * @member {array} [backendHttpSettingsCollection] Backend http settings of the + * application gateway resource. + * @member {array} [httpListeners] Http listeners of the application gateway + * resource. + * @member {array} [urlPathMaps] URL path map of the application gateway + * resource. + * @member {array} [requestRoutingRules] Request routing rules of the + * application gateway resource. + * @member {array} [redirectConfigurations] Redirect configurations of the + * application gateway resource. + * @member {object} [webApplicationFirewallConfiguration] Web application + * firewall configuration. + * @member {boolean} [webApplicationFirewallConfiguration.enabled] Whether the + * web application firewall is enabled or not. + * @member {string} [webApplicationFirewallConfiguration.firewallMode] Web + * application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * @member {string} [webApplicationFirewallConfiguration.ruleSetType] The type + * of the web application firewall rule set. Possible values are: 'OWASP'. + * @member {string} [webApplicationFirewallConfiguration.ruleSetVersion] The + * version of the rule set type. + * @member {array} [webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * @member {boolean} [webApplicationFirewallConfiguration.requestBodyCheck] + * Whether allow WAF to check request Body. + * @member {number} [webApplicationFirewallConfiguration.maxRequestBodySize] + * Maxium request body size for WAF. + * @member {boolean} [enableHttp2] Whether HTTP2 is enabled on the application + * gateway resource. + * @member {string} [resourceGuid] Resource GUID property of the application + * gateway resource. + * @member {string} [provisioningState] Provisioning state of the application + * gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ApplicationGateway extends Resource { + sku?: ApplicationGatewaySku; + sslPolicy?: ApplicationGatewaySslPolicy; + readonly operationalState?: string; + gatewayIPConfigurations?: ApplicationGatewayIPConfiguration[]; + authenticationCertificates?: ApplicationGatewayAuthenticationCertificate[]; + sslCertificates?: ApplicationGatewaySslCertificate[]; + frontendIPConfigurations?: ApplicationGatewayFrontendIPConfiguration[]; + frontendPorts?: ApplicationGatewayFrontendPort[]; + probes?: ApplicationGatewayProbe[]; + backendAddressPools?: ApplicationGatewayBackendAddressPool[]; + backendHttpSettingsCollection?: ApplicationGatewayBackendHttpSettings[]; + httpListeners?: ApplicationGatewayHttpListener[]; + urlPathMaps?: ApplicationGatewayUrlPathMap[]; + requestRoutingRules?: ApplicationGatewayRequestRoutingRule[]; + redirectConfigurations?: ApplicationGatewayRedirectConfiguration[]; + webApplicationFirewallConfiguration?: ApplicationGatewayWebApplicationFirewallConfiguration; + enableHttp2?: boolean; + resourceGuid?: string; + provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFirewallRule class. + * @constructor + * A web application firewall rule. + * + * @member {number} ruleId The identifier of the web application firewall rule. + * @member {string} [description] The description of the web application + * firewall rule. + */ +export interface ApplicationGatewayFirewallRule { + ruleId: number; + description?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFirewallRuleGroup class. + * @constructor + * A web application firewall rule group. + * + * @member {string} ruleGroupName The name of the web application firewall rule + * group. + * @member {string} [description] The description of the web application + * firewall rule group. + * @member {array} rules The rules of the web application firewall rule group. + */ +export interface ApplicationGatewayFirewallRuleGroup { + ruleGroupName: string; + description?: string; + rules: ApplicationGatewayFirewallRule[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayFirewallRuleSet class. + * @constructor + * A web application firewall rule set. + * + * @member {string} [provisioningState] The provisioning state of the web + * application firewall rule set. + * @member {string} ruleSetType The type of the web application firewall rule + * set. + * @member {string} ruleSetVersion The version of the web application firewall + * rule set type. + * @member {array} ruleGroups The rule groups of the web application firewall + * rule set. + */ +export interface ApplicationGatewayFirewallRuleSet extends Resource { + provisioningState?: string; + ruleSetType: string; + ruleSetVersion: string; + ruleGroups: ApplicationGatewayFirewallRuleGroup[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayAvailableWafRuleSetsResult class. + * @constructor + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + * + * @member {array} [value] The list of application gateway rule sets. + */ +export interface ApplicationGatewayAvailableWafRuleSetsResult { + value?: ApplicationGatewayFirewallRuleSet[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayAvailableSslOptions class. + * @constructor + * Response for ApplicationGatewayAvailableSslOptions API service call. + * + * @member {array} [predefinedPolicies] List of available Ssl predefined + * policy. + * @member {string} [defaultPolicy] Name of the Ssl predefined policy applied + * by default to application gateway. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S' + * @member {array} [availableCipherSuites] List of available Ssl cipher suites. + * @member {array} [availableProtocols] List of available Ssl protocols. + */ +export interface ApplicationGatewayAvailableSslOptions extends Resource { + predefinedPolicies?: SubResource[]; + defaultPolicy?: string; + availableCipherSuites?: string[]; + availableProtocols?: string[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewaySslPredefinedPolicy class. + * @constructor + * An Ssl predefined policy + * + * @member {string} [name] Name of Ssl predefined policy. + * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the + * specified order for application gateway. + * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to be + * supported on application gateway. Possible values include: 'TLSv1_0', + * 'TLSv1_1', 'TLSv1_2' + */ +export interface ApplicationGatewaySslPredefinedPolicy extends SubResource { + name?: string; + cipherSuites?: string[]; + minProtocolVersion?: string; +} + +/** + * @class + * Initializes a new instance of the TagsObject class. + * @constructor + * Tags object for patch operations. + * + * @member {object} [tags] Resource tags. + */ +export interface TagsObject { + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DnsNameAvailabilityResult class. + * @constructor + * Response for the CheckDnsNameAvailability API service call. + * + * @member {boolean} [available] Domain availability (True/False). + */ +export interface DnsNameAvailabilityResult { + available?: boolean; +} + +/** + * @class + * Initializes a new instance of the DdosProtectionPlan class. + * @constructor + * A DDoS protection plan in a resource group. + * + * @member {string} [resourceGuid] The resource GUID property of the DDoS + * protection plan resource. It uniquely identifies the resource, even if the + * user changes its name or migrate the resource across subscriptions or + * resource groups. + * @member {string} [provisioningState] The provisioning state of the DDoS + * protection plan resource. Possible values are: 'Succeeded', 'Updating', + * 'Deleting', and 'Failed'. + * @member {array} [virtualNetworks] The list of virtual networks associated + * with the DDoS protection plan resource. This list is read-only. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface DdosProtectionPlan extends Resource { + readonly resourceGuid?: string; + readonly provisioningState?: string; + readonly virtualNetworks?: SubResource[]; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the EndpointServiceResult class. + * @constructor + * Endpoint service. + * + * @member {string} [name] Name of the endpoint service. + * @member {string} [type] Type of the endpoint service. + */ +export interface EndpointServiceResult extends SubResource { + readonly name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitAuthorization class. + * @constructor + * Authorization in an ExpressRouteCircuit resource. + * + * @member {string} [authorizationKey] The authorization key. + * @member {string} [authorizationUseStatus] AuthorizationUseStatus. Possible + * values are: 'Available' and 'InUse'. Possible values include: 'Available', + * 'InUse' + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ExpressRouteCircuitAuthorization extends SubResource { + authorizationKey?: string; + authorizationUseStatus?: string; + provisioningState?: string; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitPeeringConfig class. + * @constructor + * Specifies the peering configuration. + * + * @member {array} [advertisedPublicPrefixes] The reference of + * AdvertisedPublicPrefixes. + * @member {array} [advertisedCommunities] The communities of bgp peering. + * Spepcified for microsoft peering + * @member {string} [advertisedPublicPrefixesState] AdvertisedPublicPrefixState + * of the Peering resource. Possible values are 'NotConfigured', 'Configuring', + * 'Configured', and 'ValidationNeeded'. Possible values include: + * 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + * @member {number} [legacyMode] The legacy mode of the peering. + * @member {number} [customerASN] The CustomerASN of the peering. + * @member {string} [routingRegistryName] The RoutingRegistryName of the + * configuration. + */ +export interface ExpressRouteCircuitPeeringConfig { + advertisedPublicPrefixes?: string[]; + advertisedCommunities?: string[]; + advertisedPublicPrefixesState?: string; + legacyMode?: number; + customerASN?: number; + routingRegistryName?: string; +} + +/** + * @class + * Initializes a new instance of the RouteFilterRule class. + * @constructor + * Route Filter Rule Resource + * + * @member {string} access The access type of the rule. Valid values are: + * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} communities The collection for bgp community values to + * filter on. e.g. ['12076:5010','12076:5020'] + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [location] Resource location. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface RouteFilterRule extends SubResource { + access: string; + communities: string[]; + readonly provisioningState?: string; + name?: string; + location?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitStats class. + * @constructor + * Contains stats associated with the peering. + * + * @member {number} [primarybytesIn] Gets BytesIn of the peering. + * @member {number} [primarybytesOut] Gets BytesOut of the peering. + * @member {number} [secondarybytesIn] Gets BytesIn of the peering. + * @member {number} [secondarybytesOut] Gets BytesOut of the peering. + */ +export interface ExpressRouteCircuitStats { + primarybytesIn?: number; + primarybytesOut?: number; + secondarybytesIn?: number; + secondarybytesOut?: number; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitConnection class. + * @constructor + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + * + * @member {object} [expressRouteCircuitPeering] Reference to Express Route + * Circuit Private Peering Resource of the circuit initiating connection. + * @member {string} [expressRouteCircuitPeering.id] Resource ID. + * @member {object} [peerExpressRouteCircuitPeering] Reference to Express Route + * Circuit Private Peering Resource of the peered circuit. + * @member {string} [peerExpressRouteCircuitPeering.id] Resource ID. + * @member {string} [addressPrefix] /29 IP address space to carve out Customer + * addresses for tunnels. + * @member {string} [authorizationKey] The authorization key. + * @member {string} [circuitConnectionStatus] Express Route Circuit Connection + * State. Possible values are: 'Connected' and 'Disconnected'. Possible values + * include: 'Connected', 'Connecting', 'Disconnected' + * @member {string} [provisioningState] Provisioning state of the circuit + * connection resource. Possible values are: 'Succeded', 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ExpressRouteCircuitConnection extends SubResource { + expressRouteCircuitPeering?: SubResource; + peerExpressRouteCircuitPeering?: SubResource; + addressPrefix?: string; + authorizationKey?: string; + readonly circuitConnectionStatus?: string; + readonly provisioningState?: string; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitPeering class. + * @constructor + * Peering in an ExpressRouteCircuit resource. + * + * @member {string} [peeringType] The peering type. Possible values include: + * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @member {string} [state] The peering state. Possible values include: + * 'Disabled', 'Enabled' + * @member {number} [azureASN] The Azure ASN. + * @member {number} [peerASN] The peer ASN. + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address prefix. + * @member {string} [primaryAzurePort] The primary port. + * @member {string} [secondaryAzurePort] The secondary port. + * @member {string} [sharedKey] The shared key. + * @member {number} [vlanId] The VLAN ID. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of the + * peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of the + * peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [stats] Gets peering stats. + * @member {number} [stats.primarybytesIn] Gets BytesIn of the peering. + * @member {number} [stats.primarybytesOut] Gets BytesOut of the peering. + * @member {number} [stats.secondarybytesIn] Gets BytesIn of the peering. + * @member {number} [stats.secondarybytesOut] Gets BytesOut of the peering. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [lastModifiedBy] Gets whether the provider or the customer + * last modified the peering. + * @member {object} [routeFilter] The reference of the RouteFilter resource. + * @member {array} [routeFilter.rules] Collection of RouteFilterRules contained + * within a route filter. + * @member {array} [routeFilter.peerings] A collection of references to express + * route circuit peerings. + * @member {string} [routeFilter.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [routeFilter.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {object} [ipv6PeeringConfig] The IPv6 peering configuration. + * @member {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * @member {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * @member {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft + * peering configuration. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [ipv6PeeringConfig.routeFilter] The reference of the + * RouteFilter resource. + * @member {array} [ipv6PeeringConfig.routeFilter.rules] Collection of + * RouteFilterRules contained within a route filter. + * @member {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of + * references to express route circuit peerings. + * @member {string} [ipv6PeeringConfig.routeFilter.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {string} [ipv6PeeringConfig.state] The state of peering. Possible + * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', + * 'Enabled' + * @member {array} [connections] The list of circuit connections associated + * with Azure Private Peering for this circuit. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ExpressRouteCircuitPeering extends SubResource { + peeringType?: string; + state?: string; + azureASN?: number; + peerASN?: number; + primaryPeerAddressPrefix?: string; + secondaryPeerAddressPrefix?: string; + primaryAzurePort?: string; + secondaryAzurePort?: string; + sharedKey?: string; + vlanId?: number; + microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; + stats?: ExpressRouteCircuitStats; + provisioningState?: string; + gatewayManagerEtag?: string; + lastModifiedBy?: string; + routeFilter?: RouteFilter; + ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; + connections?: ExpressRouteCircuitConnection[]; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the RouteFilter class. + * @constructor + * Route Filter Resource. + * + * @member {array} [rules] Collection of RouteFilterRules contained within a + * route filter. + * @member {array} [peerings] A collection of references to express route + * circuit peerings. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface RouteFilter extends Resource { + rules?: RouteFilterRule[]; + peerings?: ExpressRouteCircuitPeering[]; + readonly provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the Ipv6ExpressRouteCircuitPeeringConfig class. + * @constructor + * Contains IPv6 peering config. + * + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address prefix. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of the + * peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of the + * peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [routeFilter] The reference of the RouteFilter resource. + * @member {array} [routeFilter.rules] Collection of RouteFilterRules contained + * within a route filter. + * @member {array} [routeFilter.peerings] A collection of references to express + * route circuit peerings. + * @member {string} [routeFilter.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [routeFilter.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {string} [state] The state of peering. Possible values are: + * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + */ +export interface Ipv6ExpressRouteCircuitPeeringConfig { + primaryPeerAddressPrefix?: string; + secondaryPeerAddressPrefix?: string; + microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; + routeFilter?: RouteFilter; + state?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitSku class. + * @constructor + * Contains SKU in an ExpressRouteCircuit. + * + * @member {string} [name] The name of the SKU. + * @member {string} [tier] The tier of the SKU. Possible values are 'Standard' + * and 'Premium'. Possible values include: 'Standard', 'Premium' + * @member {string} [family] The family of the SKU. Possible values are: + * 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', + * 'MeteredData' + */ +export interface ExpressRouteCircuitSku { + name?: string; + tier?: string; + family?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitServiceProviderProperties class. + * @constructor + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + * + * @member {string} [serviceProviderName] The serviceProviderName. + * @member {string} [peeringLocation] The peering location. + * @member {number} [bandwidthInMbps] The BandwidthInMbps. + */ +export interface ExpressRouteCircuitServiceProviderProperties { + serviceProviderName?: string; + peeringLocation?: string; + bandwidthInMbps?: number; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuit class. + * @constructor + * ExpressRouteCircuit resource + * + * @member {object} [sku] The SKU. + * @member {string} [sku.name] The name of the SKU. + * @member {string} [sku.tier] The tier of the SKU. Possible values are + * 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @member {string} [sku.family] The family of the SKU. Possible values are: + * 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', + * 'MeteredData' + * @member {boolean} [allowClassicOperations] Allow classic operations + * @member {string} [circuitProvisioningState] The CircuitProvisioningState + * state of the resource. + * @member {string} [serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * @member {array} [authorizations] The list of authorizations. + * @member {array} [peerings] The list of peerings. + * @member {string} [serviceKey] The ServiceKey. + * @member {string} [serviceProviderNotes] The ServiceProviderNotes. + * @member {object} [serviceProviderProperties] The ServiceProviderProperties. + * @member {string} [serviceProviderProperties.serviceProviderName] The + * serviceProviderName. + * @member {string} [serviceProviderProperties.peeringLocation] The peering + * location. + * @member {number} [serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface ExpressRouteCircuit extends Resource { + sku?: ExpressRouteCircuitSku; + allowClassicOperations?: boolean; + circuitProvisioningState?: string; + serviceProviderProvisioningState?: string; + authorizations?: ExpressRouteCircuitAuthorization[]; + peerings?: ExpressRouteCircuitPeering[]; + serviceKey?: string; + serviceProviderNotes?: string; + serviceProviderProperties?: ExpressRouteCircuitServiceProviderProperties; + provisioningState?: string; + gatewayManagerEtag?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitArpTable class. + * @constructor + * The ARP table associated with the ExpressRouteCircuit. + * + * @member {number} [age] Age + * @member {string} [interfaceProperty] Interface + * @member {string} [ipAddress] The IP address. + * @member {string} [macAddress] The MAC address. + */ +export interface ExpressRouteCircuitArpTable { + age?: number; + interfaceProperty?: string; + ipAddress?: string; + macAddress?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitsArpTableListResult class. + * @constructor + * Response for ListArpTable associated with the Express Route Circuits API. + * + * @member {array} [value] Gets list of the ARP table. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCircuitsArpTableListResult { + value?: ExpressRouteCircuitArpTable[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitRoutesTable class. + * @constructor + * The routes table associated with the ExpressRouteCircuit + * + * @member {string} [network] network + * @member {string} [nextHop] nextHop + * @member {string} [locPrf] locPrf + * @member {number} [weight] weight. + * @member {string} [path] path + */ +export interface ExpressRouteCircuitRoutesTable { + network?: string; + nextHop?: string; + locPrf?: string; + weight?: number; + path?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitsRoutesTableListResult class. + * @constructor + * Response for ListRoutesTable associated with the Express Route Circuits API. + * + * @member {array} [value] The list of routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCircuitsRoutesTableListResult { + value?: ExpressRouteCircuitRoutesTable[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitRoutesTableSummary class. + * @constructor + * The routes table associated with the ExpressRouteCircuit. + * + * @member {string} [neighbor] Neighbor + * @member {number} [v] BGP version number spoken to the neighbor. + * @member {number} [as] Autonomous system number. + * @member {string} [upDown] The length of time that the BGP session has been + * in the Established state, or the current status if not in the Established + * state. + * @member {string} [statePfxRcd] Current state of the BGP session, and the + * number of prefixes that have been received from a neighbor or peer group. + */ +export interface ExpressRouteCircuitRoutesTableSummary { + neighbor?: string; + v?: number; + as?: number; + upDown?: string; + statePfxRcd?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitsRoutesTableSummaryListResult class. + * @constructor + * Response for ListRoutesTable associated with the Express Route Circuits API. + * + * @member {array} [value] A list of the routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCircuitsRoutesTableSummaryListResult { + value?: ExpressRouteCircuitRoutesTableSummary[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteServiceProviderBandwidthsOffered class. + * @constructor + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + * + * @member {string} [offerName] The OfferName. + * @member {number} [valueInMbps] The ValueInMbps. + */ +export interface ExpressRouteServiceProviderBandwidthsOffered { + offerName?: string; + valueInMbps?: number; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteServiceProvider class. + * @constructor + * A ExpressRouteResourceProvider object. + * + * @member {array} [peeringLocations] Get a list of peering locations. + * @member {array} [bandwidthsOffered] Gets bandwidths offered. + * @member {string} [provisioningState] Gets the provisioning state of the + * resource. + */ +export interface ExpressRouteServiceProvider extends Resource { + peeringLocations?: string[]; + bandwidthsOffered?: ExpressRouteServiceProviderBandwidthsOffered[]; + provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnectionRoutesTableSummary class. + * @constructor + * The routes table associated with the ExpressRouteCircuit. + * + * @member {string} [neighbor] IP address of Neighbor router + * @member {number} [asn] Autonomous system number. + * @member {string} [upDown] The length of time that the BGP session has been + * in the Established state, or the current status if not in the Established + * state. + * @member {string} [stateOrPrefixesReceived] Current state of the BGP session, + * and the number of prefixes that have been received from a neighbor or peer + * group. + */ +export interface ExpressRouteCrossConnectionRoutesTableSummary { + neighbor?: string; + asn?: number; + upDown?: string; + stateOrPrefixesReceived?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + * @constructor + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + * + * @member {array} [value] A list of the routes table. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + value?: ExpressRouteCrossConnectionRoutesTableSummary[]; + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitReference class. + * @constructor + * @member {string} [id] Corresponding Express Route Circuit Id. + */ +export interface ExpressRouteCircuitReference { + id?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnectionPeering class. + * @constructor + * Peering in an ExpressRoute Cross Connection resource. + * + * @member {string} [peeringType] The peering type. Possible values include: + * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @member {string} [state] The peering state. Possible values include: + * 'Disabled', 'Enabled' + * @member {number} [azureASN] The Azure ASN. + * @member {number} [peerASN] The peer ASN. + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address prefix. + * @member {string} [primaryAzurePort] The primary port. + * @member {string} [secondaryAzurePort] The secondary port. + * @member {string} [sharedKey] The shared key. + * @member {number} [vlanId] The VLAN ID. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of the + * peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of the + * peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [gatewayManagerEtag] The GatewayManager Etag. + * @member {string} [lastModifiedBy] Gets whether the provider or the customer + * last modified the peering. + * @member {object} [ipv6PeeringConfig] The IPv6 peering configuration. + * @member {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * @member {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * @member {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft + * peering configuration. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * @member {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * @member {string} + * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [ipv6PeeringConfig.routeFilter] The reference of the + * RouteFilter resource. + * @member {array} [ipv6PeeringConfig.routeFilter.rules] Collection of + * RouteFilterRules contained within a route filter. + * @member {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of + * references to express route circuit peerings. + * @member {string} [ipv6PeeringConfig.routeFilter.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {string} [ipv6PeeringConfig.state] The state of peering. Possible + * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', + * 'Enabled' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface ExpressRouteCrossConnectionPeering extends SubResource { + peeringType?: string; + state?: string; + readonly azureASN?: number; + peerASN?: number; + primaryPeerAddressPrefix?: string; + secondaryPeerAddressPrefix?: string; + readonly primaryAzurePort?: string; + readonly secondaryAzurePort?: string; + sharedKey?: string; + vlanId?: number; + microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; + readonly provisioningState?: string; + readonly gatewayManagerEtag?: string; + lastModifiedBy?: string; + ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnection class. + * @constructor + * ExpressRouteCrossConnection resource + * + * @member {string} [primaryAzurePort] The name of the primary port. + * @member {string} [secondaryAzurePort] The name of the secondary port. + * @member {number} [sTag] The identifier of the circuit traffic. + * @member {string} [peeringLocation] The peering location of the ExpressRoute + * circuit. + * @member {number} [bandwidthInMbps] The circuit bandwidth In Mbps. + * @member {object} [expressRouteCircuit] The ExpressRouteCircuit + * @member {string} [expressRouteCircuit.id] Corresponding Express Route + * Circuit Id. + * @member {string} [serviceProviderProvisioningState] The provisioning state + * of the circuit in the connectivity provider system. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: + * 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @member {string} [serviceProviderNotes] Additional read only notes set by + * the connectivity provider. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {array} [peerings] The list of peerings. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface ExpressRouteCrossConnection extends Resource { + readonly primaryAzurePort?: string; + readonly secondaryAzurePort?: string; + readonly sTag?: number; + readonly peeringLocation?: string; + readonly bandwidthInMbps?: number; + readonly expressRouteCircuit?: ExpressRouteCircuitReference; + serviceProviderProvisioningState?: string; + serviceProviderNotes?: string; + readonly provisioningState?: string; + peerings?: ExpressRouteCrossConnectionPeering[]; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerSku class. + * @constructor + * SKU of a load balancer + * + * @member {string} [name] Name of a load balancer SKU. Possible values + * include: 'Basic', 'Standard' + */ +export interface LoadBalancerSku { + name?: string; +} + +/** + * @class + * Initializes a new instance of the FrontendIPConfiguration class. + * @constructor + * Frontend IP address of the load balancer. + * + * @member {array} [inboundNatRules] Read only. Inbound rules URIs that use + * this frontend IP. + * @member {array} [inboundNatPools] Read only. Inbound pools URIs that use + * this frontend IP. + * @member {array} [outboundNatRules] Read only. Outbound rules URIs that use + * this frontend IP. + * @member {array} [loadBalancingRules] Gets load balancing rules URIs that use + * this frontend IP. + * @member {string} [privateIPAddress] The private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] The Private IP allocation + * method. Possible values are: 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A collection + * of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. True + * means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to the + * network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of references + * to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {object} [publicIPAddress] The reference of the Public IP resource. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAllocationMethod] + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic' + * @member {object} [publicIPAddress.ipConfiguration.subnet] The reference of + * the subnet resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] The + * address prefix for the subnet. + * @member {object} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The reference + * of the NetworkSecurityGroup resource. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] + * A collection of references to subnets. + * @member {boolean} + * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An + * array of service endpoints. + * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations using + * subnet. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [publicIPAddress.ipConfiguration.subnet.provisioningState] + * The provisioning state of the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} [publicIPAddress.ipConfiguration.provisioningState] Gets + * the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [publicIPAddress.ipConfiguration.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or sets + * the Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated with + * the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout of + * the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {array} [zones] A list of availability zones denoting the IP + * allocated for the resource needs to come from. + */ +export interface FrontendIPConfiguration extends SubResource { + readonly inboundNatRules?: SubResource[]; + readonly inboundNatPools?: SubResource[]; + readonly outboundNatRules?: SubResource[]; + readonly loadBalancingRules?: SubResource[]; + privateIPAddress?: string; + privateIPAllocationMethod?: string; + subnet?: Subnet; + publicIPAddress?: PublicIPAddress; + provisioningState?: string; + name?: string; + etag?: string; + zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the LoadBalancingRule class. + * @constructor + * A load balancing rule for a load balancer. + * + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [backendAddressPool] A reference to a pool of DIPs. Inbound + * traffic is randomly load balanced across IPs in the backend IPs. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [probe] The reference of the load balancer probe used by + * the load balancing rule. + * @member {string} [probe.id] Resource ID. + * @member {string} protocol Possible values include: 'Udp', 'Tcp', 'All' + * @member {string} [loadDistribution] The load distribution policy for this + * rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + * Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + * @member {number} frontendPort The port for the external endpoint. Port + * numbers for each rule must be unique within the Load Balancer. Acceptable + * values are between 0 and 65534. Note that value 0 enables "Any Port" + * @member {number} [backendPort] The port used for internal connections on the + * endpoint. Acceptable values are between 0 and 65535. Note that value 0 + * enables "Any Port" + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default value + * is 4 minutes. This element is only used when the protocol is set to TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's endpoint + * for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you + * create the endpoint. + * @member {boolean} [disableOutboundSnat] Configures SNAT for the VMs in the + * backend pool to use the publicIP address specified in the frontend of the + * load balancing rule. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface LoadBalancingRule extends SubResource { + frontendIPConfiguration?: SubResource; + backendAddressPool?: SubResource; + probe?: SubResource; + protocol: string; + loadDistribution?: string; + frontendPort: number; + backendPort?: number; + idleTimeoutInMinutes?: number; + enableFloatingIP?: boolean; + disableOutboundSnat?: boolean; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the Probe class. + * @constructor + * A load balancer probe. + * + * @member {array} [loadBalancingRules] The load balancer rules that use this + * probe. + * @member {string} protocol The protocol of the end point. Possible values + * are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for + * the probe to be successful. If 'Http' is specified, a 200 OK response from + * the specifies URI is required for the probe to be successful. Possible + * values include: 'Http', 'Tcp' + * @member {number} port The port for communicating the probe. Possible values + * range from 1 to 65535, inclusive. + * @member {number} [intervalInSeconds] The interval, in seconds, for how + * frequently to probe the endpoint for health status. Typically, the interval + * is slightly less than half the allocated timeout period (in seconds) which + * allows two full probes before taking the instance out of rotation. The + * default value is 15, the minimum value is 5. + * @member {number} [numberOfProbes] The number of probes where if no response, + * will result in stopping further traffic from being delivered to the + * endpoint. This values allows endpoints to be taken out of rotation faster or + * slower than the typical times used in Azure. + * @member {string} [requestPath] The URI used for requesting health status + * from the VM. Path is required if a protocol is set to http. Otherwise, it is + * not allowed. There is no default value. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface Probe extends SubResource { + readonly loadBalancingRules?: SubResource[]; + protocol: string; + port: number; + intervalInSeconds?: number; + numberOfProbes?: number; + requestPath?: string; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the InboundNatPool class. + * @constructor + * Inbound NAT pool of the load balancer. + * + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {string} protocol Possible values include: 'Udp', 'Tcp', 'All' + * @member {number} frontendPortRangeStart The first port number in the range + * of external ports that will be used to provide Inbound Nat to NICs + * associated with a load balancer. Acceptable values range between 1 and + * 65534. + * @member {number} frontendPortRangeEnd The last port number in the range of + * external ports that will be used to provide Inbound Nat to NICs associated + * with a load balancer. Acceptable values range between 1 and 65535. + * @member {number} backendPort The port used for internal connections on the + * endpoint. Acceptable values are between 1 and 65535. + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default value + * is 4 minutes. This element is only used when the protocol is set to TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's endpoint + * for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you + * create the endpoint. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface InboundNatPool extends SubResource { + frontendIPConfiguration?: SubResource; + protocol: string; + frontendPortRangeStart: number; + frontendPortRangeEnd: number; + backendPort: number; + idleTimeoutInMinutes?: number; + enableFloatingIP?: boolean; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the OutboundNatRule class. + * @constructor + * Outbound NAT pool of the load balancer. + * + * @member {number} [allocatedOutboundPorts] The number of outbound ports to be + * used for NAT. + * @member {array} [frontendIPConfigurations] The Frontend IP addresses of the + * load balancer. + * @member {object} backendAddressPool A reference to a pool of DIPs. Outbound + * traffic is randomly load balanced across IPs in the backend IPs. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface OutboundNatRule extends SubResource { + allocatedOutboundPorts?: number; + frontendIPConfigurations?: SubResource[]; + backendAddressPool: SubResource; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancer class. + * @constructor + * LoadBalancer resource + * + * @member {object} [sku] The load balancer SKU. + * @member {string} [sku.name] Name of a load balancer SKU. Possible values + * include: 'Basic', 'Standard' + * @member {array} [frontendIPConfigurations] Object representing the frontend + * IPs to be used for the load balancer + * @member {array} [backendAddressPools] Collection of backend address pools + * used by a load balancer + * @member {array} [loadBalancingRules] Object collection representing the load + * balancing rules Gets the provisioning + * @member {array} [probes] Collection of probe objects used in the load + * balancer + * @member {array} [inboundNatRules] Collection of inbound NAT Rules used by a + * load balancer. Defining inbound NAT rules on your load balancer is mutually + * exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * @member {array} [inboundNatPools] Defines an external port range for inbound + * NAT to a single backend port on NICs associated with a load balancer. + * Inbound NAT rules are created automatically for each NIC associated with the + * Load Balancer using an external port from this range. Defining an Inbound + * NAT pool on your Load Balancer is mutually exclusive with defining inbound + * Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. + * NICs that are associated with individual virtual machines cannot reference + * an inbound NAT pool. They have to reference individual inbound NAT rules. + * @member {array} [outboundNatRules] The outbound NAT rules. + * @member {string} [resourceGuid] The resource GUID property of the load + * balancer resource. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface LoadBalancer extends Resource { + sku?: LoadBalancerSku; + frontendIPConfigurations?: FrontendIPConfiguration[]; + backendAddressPools?: BackendAddressPool[]; + loadBalancingRules?: LoadBalancingRule[]; + probes?: Probe[]; + inboundNatRules?: InboundNatRule[]; + inboundNatPools?: InboundNatPool[]; + outboundNatRules?: OutboundNatRule[]; + resourceGuid?: string; + provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorDetails class. + * @constructor + * @member {string} [code] + * @member {string} [target] + * @member {string} [message] + */ +export interface ErrorDetails { + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * @member {string} [code] + * @member {string} [message] + * @member {string} [target] + * @member {array} [details] + * @member {string} [innerError] + */ +export interface ErrorModel { + code?: string; + message?: string; + target?: string; + details?: ErrorDetails[]; + innerError?: string; +} + +/** + * @class + * Initializes a new instance of the AzureAsyncOperationResult class. + * @constructor + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + * + * @member {string} [status] Status of the Azure async operation. Possible + * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + * include: 'InProgress', 'Succeeded', 'Failed' + * @member {object} [error] + * @member {string} [error.code] + * @member {string} [error.message] + * @member {string} [error.target] + * @member {array} [error.details] + * @member {string} [error.innerError] + */ +export interface AzureAsyncOperationResult { + status?: string; + error?: ErrorModel; +} + +/** + * @class + * Initializes a new instance of the EffectiveNetworkSecurityGroupAssociation class. + * @constructor + * The effective network security group association. + * + * @member {object} [subnet] The ID of the subnet if assigned. + * @member {string} [subnet.id] Resource ID. + * @member {object} [networkInterface] The ID of the network interface if + * assigned. + * @member {string} [networkInterface.id] Resource ID. + */ +export interface EffectiveNetworkSecurityGroupAssociation { + subnet?: SubResource; + networkInterface?: SubResource; +} + +/** + * @class + * Initializes a new instance of the EffectiveNetworkSecurityRule class. + * @constructor + * Effective network security rules. + * + * @member {string} [name] The name of the security rule specified by the user + * (if created by the user). + * @member {string} [protocol] The network protocol this rule applies to. + * Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: + * 'Tcp', 'Udp', 'All' + * @member {string} [sourcePortRange] The source port or range. + * @member {string} [destinationPortRange] The destination port or range. + * @member {array} [sourcePortRanges] The source port ranges. Expected values + * include a single integer between 0 and 65535, a range using '-' as seperator + * (e.g. 100-400), or an asterix (*) + * @member {array} [destinationPortRanges] The destination port ranges. + * Expected values include a single integer between 0 and 65535, a range using + * '-' as seperator (e.g. 100-400), or an asterix (*) + * @member {string} [sourceAddressPrefix] The source address prefix. + * @member {string} [destinationAddressPrefix] The destination address prefix. + * @member {array} [sourceAddressPrefixes] The source address prefixes. + * Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AureLoadBalancer, Internet), System Tags, and the asterix (*). + * @member {array} [destinationAddressPrefixes] The destination address + * prefixes. Expected values include CIDR IP ranges, Default Tags + * (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix + * (*). + * @member {array} [expandedSourceAddressPrefix] The expanded source address + * prefix. + * @member {array} [expandedDestinationAddressPrefix] Expanded destination + * address prefix. + * @member {string} [access] Whether network traffic is allowed or denied. + * Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + * 'Deny' + * @member {number} [priority] The priority of the rule. + * @member {string} [direction] The direction of the rule. Possible values are: + * 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound' + */ +export interface EffectiveNetworkSecurityRule { + name?: string; + protocol?: string; + sourcePortRange?: string; + destinationPortRange?: string; + sourcePortRanges?: string[]; + destinationPortRanges?: string[]; + sourceAddressPrefix?: string; + destinationAddressPrefix?: string; + sourceAddressPrefixes?: string[]; + destinationAddressPrefixes?: string[]; + expandedSourceAddressPrefix?: string[]; + expandedDestinationAddressPrefix?: string[]; + access?: string; + priority?: number; + direction?: string; +} + +/** + * @class + * Initializes a new instance of the EffectiveNetworkSecurityGroup class. + * @constructor + * Effective network security group. + * + * @member {object} [networkSecurityGroup] The ID of network security group + * that is applied. + * @member {string} [networkSecurityGroup.id] Resource ID. + * @member {object} [association] Associated resources. + * @member {object} [association.subnet] The ID of the subnet if assigned. + * @member {string} [association.subnet.id] Resource ID. + * @member {object} [association.networkInterface] The ID of the network + * interface if assigned. + * @member {string} [association.networkInterface.id] Resource ID. + * @member {array} [effectiveSecurityRules] A collection of effective security + * rules. + * @member {object} [tagMap] Mapping of tags to list of IP Addresses included + * within the tag. + */ +export interface EffectiveNetworkSecurityGroup { + networkSecurityGroup?: SubResource; + association?: EffectiveNetworkSecurityGroupAssociation; + effectiveSecurityRules?: EffectiveNetworkSecurityRule[]; + tagMap?: { [propertyName: string]: string[] }; +} + +/** + * @class + * Initializes a new instance of the EffectiveNetworkSecurityGroupListResult class. + * @constructor + * Response for list effective network security groups API service call. + * + * @member {array} [value] A list of effective network security groups. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface EffectiveNetworkSecurityGroupListResult { + value?: EffectiveNetworkSecurityGroup[]; + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the EffectiveRoute class. + * @constructor + * Effective Route + * + * @member {string} [name] The name of the user defined route. This is + * optional. + * @member {string} [source] Who created the route. Possible values are: + * 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values + * include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + * @member {string} [state] The value of effective route. Possible values are: + * 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' + * @member {array} [addressPrefix] The address prefixes of the effective routes + * in CIDR notation. + * @member {array} [nextHopIpAddress] The IP address of the next hop of the + * effective route. + * @member {string} [nextHopType] The type of Azure hop the packet should be + * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + */ +export interface EffectiveRoute { + name?: string; + source?: string; + state?: string; + addressPrefix?: string[]; + nextHopIpAddress?: string[]; + nextHopType?: string; +} + +/** + * @class + * Initializes a new instance of the EffectiveRouteListResult class. + * @constructor + * Response for list effective route API service call. + * + * @member {array} [value] A list of effective routes. + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface EffectiveRouteListResult { + value?: EffectiveRoute[]; + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkWatcher class. + * @constructor + * Network watcher in a resource group. + * + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + */ +export interface NetworkWatcher extends Resource { + etag?: string; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the TopologyParameters class. + * @constructor + * Parameters that define the representation of topology. + * + * @member {string} [targetResourceGroupName] The name of the target resource + * group to perform topology on. + * @member {object} [targetVirtualNetwork] The reference of the Virtual Network + * resource. + * @member {string} [targetVirtualNetwork.id] Resource ID. + * @member {object} [targetSubnet] The reference of the Subnet resource. + * @member {string} [targetSubnet.id] Resource ID. + */ +export interface TopologyParameters { + targetResourceGroupName?: string; + targetVirtualNetwork?: SubResource; + targetSubnet?: SubResource; +} + +/** + * @class + * Initializes a new instance of the TopologyAssociation class. + * @constructor + * Resources that have an association with the parent resource. + * + * @member {string} [name] The name of the resource that is associated with the + * parent resource. + * @member {string} [resourceId] The ID of the resource that is associated with + * the parent resource. + * @member {string} [associationType] The association type of the child + * resource to the parent resource. Possible values include: 'Associated', + * 'Contains' + */ +export interface TopologyAssociation { + name?: string; + resourceId?: string; + associationType?: string; +} + +/** + * @class + * Initializes a new instance of the TopologyResource class. + * @constructor + * The network resource topology information for the given resource group. + * + * @member {string} [name] Name of the resource. + * @member {string} [id] ID of the resource. + * @member {string} [location] Resource location. + * @member {array} [associations] Holds the associations the resource has with + * other resources in the resource group. + */ +export interface TopologyResource { + name?: string; + id?: string; + location?: string; + associations?: TopologyAssociation[]; +} + +/** + * @class + * Initializes a new instance of the Topology class. + * @constructor + * Topology of the specified resource group. + * + * @member {string} [id] GUID representing the operation id. + * @member {date} [createdDateTime] The datetime when the topology was + * initially created for the resource group. + * @member {date} [lastModified] The datetime when the topology was last + * modified. + * @member {array} [resources] + */ +export interface Topology { + readonly id?: string; + readonly createdDateTime?: Date; + readonly lastModified?: Date; + resources?: TopologyResource[]; +} + +/** + * @class + * Initializes a new instance of the VerificationIPFlowParameters class. + * @constructor + * Parameters that define the IP flow to be verified. + * + * @member {string} targetResourceId The ID of the target resource to perform + * next-hop on. + * @member {string} direction The direction of the packet represented as a + * 5-tuple. Possible values include: 'Inbound', 'Outbound' + * @member {string} protocol Protocol to be verified on. Possible values + * include: 'TCP', 'UDP' + * @member {string} localPort The local port. Acceptable values are a single + * integer in the range (0-65535). Support for * for the source port, which + * depends on the direction. + * @member {string} remotePort The remote port. Acceptable values are a single + * integer in the range (0-65535). Support for * for the source port, which + * depends on the direction. + * @member {string} localIPAddress The local IP address. Acceptable values are + * valid IPv4 addresses. + * @member {string} remoteIPAddress The remote IP address. Acceptable values + * are valid IPv4 addresses. + * @member {string} [targetNicResourceId] The NIC ID. (If VM has multiple NICs + * and IP forwarding is enabled on any of them, then this parameter must be + * specified. Otherwise optional). + */ +export interface VerificationIPFlowParameters { + targetResourceId: string; + direction: string; + protocol: string; + localPort: string; + remotePort: string; + localIPAddress: string; + remoteIPAddress: string; + targetNicResourceId?: string; +} + +/** + * @class + * Initializes a new instance of the VerificationIPFlowResult class. + * @constructor + * Results of IP flow verification on the target resource. + * + * @member {string} [access] Indicates whether the traffic is allowed or + * denied. Possible values include: 'Allow', 'Deny' + * @member {string} [ruleName] Name of the rule. If input is not matched + * against any security rule, it is not displayed. + */ +export interface VerificationIPFlowResult { + access?: string; + ruleName?: string; +} + +/** + * @class + * Initializes a new instance of the NextHopParameters class. + * @constructor + * Parameters that define the source and destination endpoint. + * + * @member {string} targetResourceId The resource identifier of the target + * resource against which the action is to be performed. + * @member {string} sourceIPAddress The source IP address. + * @member {string} destinationIPAddress The destination IP address. + * @member {string} [targetNicResourceId] The NIC ID. (If VM has multiple NICs + * and IP forwarding is enabled on any of the nics, then this parameter must be + * specified. Otherwise optional). + */ +export interface NextHopParameters { + targetResourceId: string; + sourceIPAddress: string; + destinationIPAddress: string; + targetNicResourceId?: string; +} + +/** + * @class + * Initializes a new instance of the NextHopResult class. + * @constructor + * The information about next hop from the specified VM. + * + * @member {string} [nextHopType] Next hop type. Possible values include: + * 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + * 'HyperNetGateway', 'None' + * @member {string} [nextHopIpAddress] Next hop IP Address + * @member {string} [routeTableId] The resource identifier for the route table + * associated with the route being returned. If the route being returned does + * not correspond to any user created routes then this field will be the string + * 'System Route'. + */ +export interface NextHopResult { + nextHopType?: string; + nextHopIpAddress?: string; + routeTableId?: string; +} + +/** + * @class + * Initializes a new instance of the SecurityGroupViewParameters class. + * @constructor + * Parameters that define the VM to check security groups for. + * + * @member {string} targetResourceId ID of the target VM. + */ +export interface SecurityGroupViewParameters { + targetResourceId: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceAssociation class. + * @constructor + * Network interface and its custom security rules. + * + * @member {string} [id] Network interface ID. + * @member {array} [securityRules] Collection of custom security rules. + */ +export interface NetworkInterfaceAssociation { + readonly id?: string; + securityRules?: SecurityRule[]; +} + +/** + * @class + * Initializes a new instance of the SubnetAssociation class. + * @constructor + * Network interface and its custom security rules. + * + * @member {string} [id] Subnet ID. + * @member {array} [securityRules] Collection of custom security rules. + */ +export interface SubnetAssociation { + readonly id?: string; + securityRules?: SecurityRule[]; +} + +/** + * @class + * Initializes a new instance of the SecurityRuleAssociations class. + * @constructor + * All security rules associated with the network interface. + * + * @member {object} [networkInterfaceAssociation] + * @member {string} [networkInterfaceAssociation.id] Network interface ID. + * @member {array} [networkInterfaceAssociation.securityRules] Collection of + * custom security rules. + * @member {object} [subnetAssociation] + * @member {string} [subnetAssociation.id] Subnet ID. + * @member {array} [subnetAssociation.securityRules] Collection of custom + * security rules. + * @member {array} [defaultSecurityRules] Collection of default security rules + * of the network security group. + * @member {array} [effectiveSecurityRules] Collection of effective security + * rules. + */ +export interface SecurityRuleAssociations { + networkInterfaceAssociation?: NetworkInterfaceAssociation; + subnetAssociation?: SubnetAssociation; + defaultSecurityRules?: SecurityRule[]; + effectiveSecurityRules?: EffectiveNetworkSecurityRule[]; +} + +/** + * @class + * Initializes a new instance of the SecurityGroupNetworkInterface class. + * @constructor + * Network interface and all its associated security rules. + * + * @member {string} [id] ID of the network interface. + * @member {object} [securityRuleAssociations] + * @member {object} [securityRuleAssociations.networkInterfaceAssociation] + * @member {string} [securityRuleAssociations.networkInterfaceAssociation.id] + * Network interface ID. + * @member {array} + * [securityRuleAssociations.networkInterfaceAssociation.securityRules] + * Collection of custom security rules. + * @member {object} [securityRuleAssociations.subnetAssociation] + * @member {string} [securityRuleAssociations.subnetAssociation.id] Subnet ID. + * @member {array} [securityRuleAssociations.subnetAssociation.securityRules] + * Collection of custom security rules. + * @member {array} [securityRuleAssociations.defaultSecurityRules] Collection + * of default security rules of the network security group. + * @member {array} [securityRuleAssociations.effectiveSecurityRules] Collection + * of effective security rules. + */ +export interface SecurityGroupNetworkInterface { + id?: string; + securityRuleAssociations?: SecurityRuleAssociations; +} + +/** + * @class + * Initializes a new instance of the SecurityGroupViewResult class. + * @constructor + * The information about security rules applied to the specified VM. + * + * @member {array} [networkInterfaces] List of network interfaces on the + * specified VM. + */ +export interface SecurityGroupViewResult { + networkInterfaces?: SecurityGroupNetworkInterface[]; +} + +/** + * @class + * Initializes a new instance of the PacketCaptureStorageLocation class. + * @constructor + * Describes the storage location for a packet capture session. + * + * @member {string} [storageId] The ID of the storage account to save the + * packet capture session. Required if no local file path is provided. + * @member {string} [storagePath] The URI of the storage path to save the + * packet capture. Must be a well-formed URI describing the location to save + * the packet capture. + * @member {string} [filePath] A valid local path on the targeting VM. Must + * include the name of the capture file (*.cap). For linux virtual machine it + * must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + */ +export interface PacketCaptureStorageLocation { + storageId?: string; + storagePath?: string; + filePath?: string; +} + +/** + * @class + * Initializes a new instance of the PacketCaptureFilter class. + * @constructor + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + * + * @member {string} [protocol] Protocol to be filtered on. Possible values + * include: 'TCP', 'UDP', 'Any'. Default value: 'Any' . + * @member {string} [localIPAddress] Local IP Address to be filtered on. + * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for + * range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently + * supported. Default = null. + * @member {string} [remoteIPAddress] Local IP Address to be filtered on. + * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for + * range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently + * supported. Default = null. + * @member {string} [localPort] Local port to be filtered on. Notation: "80" + * for single port entry."80-85" for range. "80;443;" for multiple entries. + * Multiple ranges not currently supported. Mixing ranges with multiple entries + * not currently supported. Default = null. + * @member {string} [remotePort] Remote port to be filtered on. Notation: "80" + * for single port entry."80-85" for range. "80;443;" for multiple entries. + * Multiple ranges not currently supported. Mixing ranges with multiple entries + * not currently supported. Default = null. + */ +export interface PacketCaptureFilter { + protocol?: string; + localIPAddress?: string; + remoteIPAddress?: string; + localPort?: string; + remotePort?: string; +} + +/** + * @class + * Initializes a new instance of the PacketCaptureParameters class. + * @constructor + * Parameters that define the create packet capture operation. + * + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture output. + * Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage ID + * is provided, otherwise optional. + * @member {array} [filters] + */ +export interface PacketCaptureParameters { + target: string; + bytesToCapturePerPacket?: number; + totalBytesPerSession?: number; + timeLimitInSeconds?: number; + storageLocation: PacketCaptureStorageLocation; + filters?: PacketCaptureFilter[]; +} + +/** + * @class + * Initializes a new instance of the PacketCapture class. + * @constructor + * Parameters that define the create packet capture operation. + * + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture output. + * Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage ID + * is provided, otherwise optional. + * @member {array} [filters] + */ +export interface PacketCapture { + target: string; + bytesToCapturePerPacket?: number; + totalBytesPerSession?: number; + timeLimitInSeconds?: number; + storageLocation: PacketCaptureStorageLocation; + filters?: PacketCaptureFilter[]; +} + +/** + * @class + * Initializes a new instance of the PacketCaptureResult class. + * @constructor + * Information about packet capture session. + * + * @member {string} [name] Name of the packet capture session. + * @member {string} [id] ID of the packet capture operation. + * @member {string} [etag] Default value: 'A unique read-only string that + * changes whenever the resource is updated.' . + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture output. + * Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage ID + * is provided, otherwise optional. + * @member {array} [filters] + * @member {string} [provisioningState] The provisioning state of the packet + * capture session. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + */ +export interface PacketCaptureResult { + readonly name?: string; + readonly id?: string; + etag?: string; + target: string; + bytesToCapturePerPacket?: number; + totalBytesPerSession?: number; + timeLimitInSeconds?: number; + storageLocation: PacketCaptureStorageLocation; + filters?: PacketCaptureFilter[]; + provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the PacketCaptureQueryStatusResult class. + * @constructor + * Status of packet capture session. + * + * @member {string} [name] The name of the packet capture resource. + * @member {string} [id] The ID of the packet capture resource. + * @member {date} [captureStartTime] The start time of the packet capture + * session. + * @member {string} [packetCaptureStatus] The status of the packet capture + * session. Possible values include: 'NotStarted', 'Running', 'Stopped', + * 'Error', 'Unknown' + * @member {string} [stopReason] The reason the current packet capture session + * was stopped. + * @member {array} [packetCaptureError] List of errors of packet capture + * session. + */ +export interface PacketCaptureQueryStatusResult { + name?: string; + id?: string; + captureStartTime?: Date; + packetCaptureStatus?: string; + stopReason?: string; + packetCaptureError?: string[]; +} + +/** + * @class + * Initializes a new instance of the TroubleshootingParameters class. + * @constructor + * Parameters that define the resource to troubleshoot. + * + * @member {string} targetResourceId The target resource to troubleshoot. + * @member {string} storageId The ID for the storage account to save the + * troubleshoot result. + * @member {string} storagePath The path to the blob to save the troubleshoot + * result in. + */ +export interface TroubleshootingParameters { + targetResourceId: string; + storageId: string; + storagePath: string; +} + +/** + * @class + * Initializes a new instance of the QueryTroubleshootingParameters class. + * @constructor + * Parameters that define the resource to query the troubleshooting result. + * + * @member {string} targetResourceId The target resource ID to query the + * troubleshooting result. + */ +export interface QueryTroubleshootingParameters { + targetResourceId: string; +} + +/** + * @class + * Initializes a new instance of the TroubleshootingRecommendedActions class. + * @constructor + * Recommended actions based on discovered issues. + * + * @member {string} [actionId] ID of the recommended action. + * @member {string} [actionText] Description of recommended actions. + * @member {string} [actionUri] The uri linking to a documentation for the + * recommended troubleshooting actions. + * @member {string} [actionUriText] The information from the URI for the + * recommended troubleshooting actions. + */ +export interface TroubleshootingRecommendedActions { + actionId?: string; + actionText?: string; + actionUri?: string; + actionUriText?: string; +} + +/** + * @class + * Initializes a new instance of the TroubleshootingDetails class. + * @constructor + * Information gained from troubleshooting of specified resource. + * + * @member {string} [id] The id of the get troubleshoot operation. + * @member {string} [reasonType] Reason type of failure. + * @member {string} [summary] A summary of troubleshooting. + * @member {string} [detail] Details on troubleshooting results. + * @member {array} [recommendedActions] List of recommended actions. + */ +export interface TroubleshootingDetails { + id?: string; + reasonType?: string; + summary?: string; + detail?: string; + recommendedActions?: TroubleshootingRecommendedActions[]; +} + +/** + * @class + * Initializes a new instance of the TroubleshootingResult class. + * @constructor + * Troubleshooting information gained from specified resource. + * + * @member {date} [startTime] The start time of the troubleshooting. + * @member {date} [endTime] The end time of the troubleshooting. + * @member {string} [code] The result code of the troubleshooting. + * @member {array} [results] Information from troubleshooting. + */ +export interface TroubleshootingResult { + startTime?: Date; + endTime?: Date; + code?: string; + results?: TroubleshootingDetails[]; +} + +/** + * @class + * Initializes a new instance of the RetentionPolicyParameters class. + * @constructor + * Parameters that define the retention policy for flow log. + * + * @member {number} [days] Number of days to retain flow log records. Default + * value: 0 . + * @member {boolean} [enabled] Flag to enable/disable retention. Default value: + * false . + */ +export interface RetentionPolicyParameters { + days?: number; + enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the FlowLogStatusParameters class. + * @constructor + * Parameters that define a resource to query flow log status. + * + * @member {string} targetResourceId The target resource where getting the flow + * logging status. + */ +export interface FlowLogStatusParameters { + targetResourceId: string; +} + +/** + * @class + * Initializes a new instance of the FlowLogInformation class. + * @constructor + * Information on the configuration of flow log. + * + * @member {string} targetResourceId The ID of the resource to configure for + * flow logging. + * @member {string} storageId ID of the storage account which is used to store + * the flow log. + * @member {boolean} enabled Flag to enable/disable flow logging. + * @member {object} [retentionPolicy] + * @member {number} [retentionPolicy.days] Number of days to retain flow log + * records. + * @member {boolean} [retentionPolicy.enabled] Flag to enable/disable + * retention. + */ +export interface FlowLogInformation { + targetResourceId: string; + storageId: string; + enabled: boolean; + retentionPolicy?: RetentionPolicyParameters; +} + +/** + * @class + * Initializes a new instance of the ConnectivitySource class. + * @constructor + * Parameters that define the source of the connection. + * + * @member {string} resourceId The ID of the resource from which a connectivity + * check will be initiated. + * @member {number} [port] The source port from which a connectivity check will + * be performed. + */ +export interface ConnectivitySource { + resourceId: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectivityDestination class. + * @constructor + * Parameters that define destination of connection. + * + * @member {string} [resourceId] The ID of the resource to which a connection + * attempt will be made. + * @member {string} [address] The IP address or URI the resource to which a + * connection attempt will be made. + * @member {number} [port] Port on which check connectivity will be performed. + */ +export interface ConnectivityDestination { + resourceId?: string; + address?: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectivityParameters class. + * @constructor + * Parameters that determine how the connectivity check will be performed. + * + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource from which a + * connectivity check will be initiated. + * @member {number} [source.port] The source port from which a connectivity + * check will be performed. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource to which a + * connection attempt will be made. + * @member {string} [destination.address] The IP address or URI the resource to + * which a connection attempt will be made. + * @member {number} [destination.port] Port on which check connectivity will be + * performed. + */ +export interface ConnectivityParameters { + source: ConnectivitySource; + destination: ConnectivityDestination; +} + +/** + * @class + * Initializes a new instance of the ConnectivityIssue class. + * @constructor + * Information about an issue encountered in the process of checking for + * connectivity. + * + * @member {string} [origin] The origin of the issue. Possible values include: + * 'Local', 'Inbound', 'Outbound' + * @member {string} [severity] The severity of the issue. Possible values + * include: 'Error', 'Warning' + * @member {string} [type] The type of issue. Possible values include: + * 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + * 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + * @member {array} [context] Provides additional context on the issue. + */ +export interface ConnectivityIssue { + readonly origin?: string; + readonly severity?: string; + readonly type?: string; + readonly context?: { [propertyName: string]: string }[]; +} + +/** + * @class + * Initializes a new instance of the ConnectivityHop class. + * @constructor + * Information about a hop between the source and the destination. + * + * @member {string} [type] The type of the hop. + * @member {string} [id] The ID of the hop. + * @member {string} [address] The IP address of the hop. + * @member {string} [resourceId] The ID of the resource corresponding to this + * hop. + * @member {array} [nextHopIds] List of next hop identifiers. + * @member {array} [issues] List of issues. + */ +export interface ConnectivityHop { + readonly type?: string; + readonly id?: string; + readonly address?: string; + readonly resourceId?: string; + readonly nextHopIds?: string[]; + readonly issues?: ConnectivityIssue[]; +} + +/** + * @class + * Initializes a new instance of the ConnectivityInformation class. + * @constructor + * Information on the connectivity status. + * + * @member {array} [hops] List of hops between the source and the destination. + * @member {string} [connectionStatus] The connection status. Possible values + * include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' + * @member {number} [avgLatencyInMs] Average latency in milliseconds. + * @member {number} [minLatencyInMs] Minimum latency in milliseconds. + * @member {number} [maxLatencyInMs] Maximum latency in milliseconds. + * @member {number} [probesSent] Total number of probes sent. + * @member {number} [probesFailed] Number of failed probes. + */ +export interface ConnectivityInformation { + readonly hops?: ConnectivityHop[]; + readonly connectionStatus?: string; + readonly avgLatencyInMs?: number; + readonly minLatencyInMs?: number; + readonly maxLatencyInMs?: number; + readonly probesSent?: number; + readonly probesFailed?: number; +} + +/** + * @class + * Initializes a new instance of the AzureReachabilityReportLocation class. + * @constructor + * Parameters that define a geographic location. + * + * @member {string} country The name of the country. + * @member {string} [state] The name of the state. + * @member {string} [city] The name of the city or town. + */ +export interface AzureReachabilityReportLocation { + country: string; + state?: string; + city?: string; +} + +/** + * @class + * Initializes a new instance of the AzureReachabilityReportParameters class. + * @constructor + * Geographic and time constraints for Azure reachability report. + * + * @member {object} providerLocation + * @member {string} [providerLocation.country] The name of the country. + * @member {string} [providerLocation.state] The name of the state. + * @member {string} [providerLocation.city] The name of the city or town. + * @member {array} [providers] List of Internet service providers. + * @member {array} [azureLocations] Optional Azure regions to scope the query + * to. + * @member {date} startTime The start time for the Azure reachability report. + * @member {date} endTime The end time for the Azure reachability report. + */ +export interface AzureReachabilityReportParameters { + providerLocation: AzureReachabilityReportLocation; + providers?: string[]; + azureLocations?: string[]; + startTime: Date; + endTime: Date; +} + +/** + * @class + * Initializes a new instance of the AzureReachabilityReportLatencyInfo class. + * @constructor + * Details on latency for a time series. + * + * @member {date} [timeStamp] The time stamp. + * @member {number} [score] The relative latency score between 1 and 100, + * higher values indicating a faster connection. + */ +export interface AzureReachabilityReportLatencyInfo { + timeStamp?: Date; + score?: number; +} + +/** + * @class + * Initializes a new instance of the AzureReachabilityReportItem class. + * @constructor + * Azure reachability report details for a given provider location. + * + * @member {string} [provider] The Internet service provider. + * @member {string} [azureLocation] The Azure region. + * @member {array} [latencies] List of latency details for each of the time + * series. + */ +export interface AzureReachabilityReportItem { + provider?: string; + azureLocation?: string; + latencies?: AzureReachabilityReportLatencyInfo[]; +} + +/** + * @class + * Initializes a new instance of the AzureReachabilityReport class. + * @constructor + * Azure reachability report details. + * + * @member {string} aggregationLevel The aggregation level of Azure + * reachability report. Can be Country, State or City. + * @member {object} providerLocation + * @member {string} [providerLocation.country] The name of the country. + * @member {string} [providerLocation.state] The name of the state. + * @member {string} [providerLocation.city] The name of the city or town. + * @member {array} reachabilityReport List of Azure reachability report items. + */ +export interface AzureReachabilityReport { + aggregationLevel: string; + providerLocation: AzureReachabilityReportLocation; + reachabilityReport: AzureReachabilityReportItem[]; +} + +/** + * @class + * Initializes a new instance of the AvailableProvidersListParameters class. + * @constructor + * Constraints that determine the list of available Internet service providers. + * + * @member {array} [azureLocations] A list of Azure regions. + * @member {string} [country] The country for available providers list. + * @member {string} [state] The state for available providers list. + * @member {string} [city] The city or town for available providers list. + */ +export interface AvailableProvidersListParameters { + azureLocations?: string[]; + country?: string; + state?: string; + city?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableProvidersListCity class. + * @constructor + * City or town details. + * + * @member {string} [cityName] The city or town name. + * @member {array} [providers] A list of Internet service providers. + */ +export interface AvailableProvidersListCity { + cityName?: string; + providers?: string[]; +} + +/** + * @class + * Initializes a new instance of the AvailableProvidersListState class. + * @constructor + * State details. + * + * @member {string} [stateName] The state name. + * @member {array} [providers] A list of Internet service providers. + * @member {array} [cities] List of available cities or towns in the state. + */ +export interface AvailableProvidersListState { + stateName?: string; + providers?: string[]; + cities?: AvailableProvidersListCity[]; +} + +/** + * @class + * Initializes a new instance of the AvailableProvidersListCountry class. + * @constructor + * Country details. + * + * @member {string} [countryName] The country name. + * @member {array} [providers] A list of Internet service providers. + * @member {array} [states] List of available states in the country. + */ +export interface AvailableProvidersListCountry { + countryName?: string; + providers?: string[]; + states?: AvailableProvidersListState[]; +} + +/** + * @class + * Initializes a new instance of the AvailableProvidersList class. + * @constructor + * List of available countries with details. + * + * @member {array} countries List of available countries. + */ +export interface AvailableProvidersList { + countries: AvailableProvidersListCountry[]; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorSource class. + * @constructor + * Describes the source of connection monitor. + * + * @member {string} resourceId The ID of the resource used as the source by + * connection monitor. + * @member {number} [port] The source port used by connection monitor. + */ +export interface ConnectionMonitorSource { + resourceId: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorDestination class. + * @constructor + * Describes the destination of connection monitor. + * + * @member {string} [resourceId] The ID of the resource used as the destination + * by connection monitor. + * @member {string} [address] Address of the connection monitor destination (IP + * or domain name). + * @member {number} [port] The destination port used by connection monitor. + */ +export interface ConnectionMonitorDestination { + resourceId?: string; + address?: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorParameters class. + * @constructor + * Parameters that define the operation to create a connection monitor. + * + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as the + * destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by connection + * monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + */ +export interface ConnectionMonitorParameters { + source: ConnectionMonitorSource; + destination: ConnectionMonitorDestination; + autoStart?: boolean; + monitoringIntervalInSeconds?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitor class. + * @constructor + * Parameters that define the operation to create a connection monitor. + * + * @member {string} [location] Connection monitor location. + * @member {object} [tags] Connection monitor tags. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as the + * destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by connection + * monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + */ +export interface ConnectionMonitor { + location?: string; + tags?: { [propertyName: string]: string }; + source: ConnectionMonitorSource; + destination: ConnectionMonitorDestination; + autoStart?: boolean; + monitoringIntervalInSeconds?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorResult class. + * @constructor + * Information about the connection monitor. + * + * @member {string} [name] Name of the connection monitor. + * @member {string} [id] ID of the connection monitor. + * @member {string} [etag] Default value: 'A unique read-only string that + * changes whenever the resource is updated.' . + * @member {string} [type] Connection monitor type. + * @member {string} [location] Connection monitor location. + * @member {object} [tags] Connection monitor tags. + * @member {object} source + * @member {string} [source.resourceId] The ID of the resource used as the + * source by connection monitor. + * @member {number} [source.port] The source port used by connection monitor. + * @member {object} destination + * @member {string} [destination.resourceId] The ID of the resource used as the + * destination by connection monitor. + * @member {string} [destination.address] Address of the connection monitor + * destination (IP or domain name). + * @member {number} [destination.port] The destination port used by connection + * monitor. + * @member {boolean} [autoStart] Determines if the connection monitor will + * start automatically once created. Default value: true . + * @member {number} [monitoringIntervalInSeconds] Monitoring interval in + * seconds. Default value: 60 . + * @member {string} [provisioningState] The provisioning state of the + * connection monitor. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * @member {date} [startTime] The date and time when the connection monitor was + * started. + * @member {string} [monitoringStatus] The monitoring status of the connection + * monitor. + */ +export interface ConnectionMonitorResult extends BaseResource { + readonly name?: string; + readonly id?: string; + etag?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; + source: ConnectionMonitorSource; + destination: ConnectionMonitorDestination; + autoStart?: boolean; + monitoringIntervalInSeconds?: number; + provisioningState?: string; + startTime?: Date; + monitoringStatus?: string; +} + +/** + * @class + * Initializes a new instance of the ConnectionStateSnapshot class. + * @constructor + * Connection state snapshot. + * + * @member {string} [connectionState] The connection state. Possible values + * include: 'Reachable', 'Unreachable', 'Unknown' + * @member {date} [startTime] The start time of the connection snapshot. + * @member {date} [endTime] The end time of the connection snapshot. + * @member {string} [evaluationState] Connectivity analysis evaluation state. + * Possible values include: 'NotStarted', 'InProgress', 'Completed' + * @member {array} [hops] List of hops between the source and the destination. + */ +export interface ConnectionStateSnapshot { + connectionState?: string; + startTime?: Date; + endTime?: Date; + evaluationState?: string; + readonly hops?: ConnectivityHop[]; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorQueryResult class. + * @constructor + * List of connection states snaphots. + * + * @member {array} [states] Information about connection states. + */ +export interface ConnectionMonitorQueryResult { + states?: ConnectionStateSnapshot[]; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * Display metadata associated with the operation. + * + * @member {string} [provider] Service provider: Microsoft Network. + * @member {string} [resource] Resource on which the operation is performed. + * @member {string} [operation] Type of the operation: get, read, delete, etc. + * @member {string} [description] Description of the operation. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Availability class. + * @constructor + * Availability of the metric. + * + * @member {string} [timeGrain] The time grain of the availability. + * @member {string} [retention] The retention of the availability. + * @member {string} [blobDuration] Duration of the availability blob. + */ +export interface Availability { + timeGrain?: string; + retention?: string; + blobDuration?: string; +} + +/** + * @class + * Initializes a new instance of the Dimension class. + * @constructor + * Dimension of the metric. + * + * @member {string} [name] The name of the dimension. + * @member {string} [displayName] The display name of the dimension. + * @member {string} [internalName] The internal name of the dimension. + */ +export interface Dimension { + name?: string; + displayName?: string; + internalName?: string; +} + +/** + * @class + * Initializes a new instance of the MetricSpecification class. + * @constructor + * Description of metrics specification. + * + * @member {string} [name] The name of the metric. + * @member {string} [displayName] The display name of the metric. + * @member {string} [displayDescription] The description of the metric. + * @member {string} [unit] Units the metric to be displayed in. + * @member {string} [aggregationType] The aggregation type. + * @member {array} [availabilities] List of availability. + * @member {boolean} [enableRegionalMdmAccount] Whether regional MDM account + * enabled. + * @member {boolean} [fillGapWithZero] Whether gaps would be filled with zeros. + * @member {string} [metricFilterPattern] Pattern for the filter of the metric. + * @member {array} [dimensions] List of dimensions. + * @member {boolean} [isInternal] Whether the metric is internal. + * @member {string} [sourceMdmAccount] The source MDM account. + * @member {string} [sourceMdmNamespace] The source MDM namespace. + * @member {string} [resourceIdDimensionNameOverride] The resource Id dimension + * name override. + */ +export interface MetricSpecification { + name?: string; + displayName?: string; + displayDescription?: string; + unit?: string; + aggregationType?: string; + availabilities?: Availability[]; + enableRegionalMdmAccount?: boolean; + fillGapWithZero?: boolean; + metricFilterPattern?: string; + dimensions?: Dimension[]; + isInternal?: boolean; + sourceMdmAccount?: string; + sourceMdmNamespace?: string; + resourceIdDimensionNameOverride?: string; +} + +/** + * @class + * Initializes a new instance of the LogSpecification class. + * @constructor + * Description of logging specification. + * + * @member {string} [name] The name of the specification. + * @member {string} [displayName] The display name of the specification. + * @member {string} [blobDuration] Duration of the blob. + */ +export interface LogSpecification { + name?: string; + displayName?: string; + blobDuration?: string; +} + +/** + * @class + * Initializes a new instance of the OperationPropertiesFormatServiceSpecification class. + * @constructor + * Specification of the service. + * + * @member {array} [metricSpecifications] Operation service specification. + * @member {array} [logSpecifications] Operation log specification. + */ +export interface OperationPropertiesFormatServiceSpecification { + metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Network REST API operation definition. + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] Display metadata associated with the operation. + * @member {string} [display.provider] Service provider: Microsoft Network. + * @member {string} [display.resource] Resource on which the operation is + * performed. + * @member {string} [display.operation] Type of the operation: get, read, + * delete, etc. + * @member {string} [display.description] Description of the operation. + * @member {string} [origin] Origin of the operation. + * @member {object} [serviceSpecification] Specification of the service. + * @member {array} [serviceSpecification.metricSpecifications] Operation + * service specification. + * @member {array} [serviceSpecification.logSpecifications] Operation log + * specification. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; + origin?: string; + serviceSpecification?: OperationPropertiesFormatServiceSpecification; +} + +/** + * @class + * Initializes a new instance of the PatchRouteFilterRule class. + * @constructor + * Route Filter Rule Resource + * + * @member {string} access The access type of the rule. Valid values are: + * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} communities The collection for bgp community values to + * filter on. e.g. ['12076:5010','12076:5020'] + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface PatchRouteFilterRule extends SubResource { + access: string; + communities: string[]; + readonly provisioningState?: string; + readonly name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the PatchRouteFilter class. + * @constructor + * Route Filter Resource. + * + * @member {array} [rules] Collection of RouteFilterRules contained within a + * route filter. + * @member {array} [peerings] A collection of references to express route + * circuit peerings. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + * @member {string} [type] Resource type. + * @member {object} [tags] Resource tags. + */ +export interface PatchRouteFilter extends SubResource { + rules?: RouteFilterRule[]; + peerings?: ExpressRouteCircuitPeering[]; + readonly provisioningState?: string; + readonly name?: string; + readonly etag?: string; + readonly type?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the BGPCommunity class. + * @constructor + * Contains bgp community information offered in Service Community resources. + * + * @member {string} [serviceSupportedRegion] The region which the service + * support. e.g. For O365, region is Global. + * @member {string} [communityName] The name of the bgp community. e.g. Skype. + * @member {string} [communityValue] The value of the bgp community. For more + * information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * @member {array} [communityPrefixes] The prefixes that the bgp community + * contains. + * @member {boolean} [isAuthorizedToUse] Customer is authorized to use bgp + * community or not. + * @member {string} [serviceGroup] The service group of the bgp community + * contains. + */ +export interface BGPCommunity { + serviceSupportedRegion?: string; + communityName?: string; + communityValue?: string; + communityPrefixes?: string[]; + isAuthorizedToUse?: boolean; + serviceGroup?: string; +} + +/** + * @class + * Initializes a new instance of the BgpServiceCommunity class. + * @constructor + * Service Community Properties. + * + * @member {string} [serviceName] The name of the bgp community. e.g. Skype. + * @member {array} [bgpCommunities] Get a list of bgp communities. + */ +export interface BgpServiceCommunity extends Resource { + serviceName?: string; + bgpCommunities?: BGPCommunity[]; +} + +/** + * @class + * Initializes a new instance of the UsageName class. + * @constructor + * The usage names. + * + * @member {string} [value] A string describing the resource name. + * @member {string} [localizedValue] A localized string describing the resource + * name. + */ +export interface UsageName { + value?: string; + localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the Usage class. + * @constructor + * Describes network resource usage. + * + * @member {string} [id] Resource identifier. + * @member {number} currentValue The current value of the usage. + * @member {number} limit The limit of usage. + * @member {object} name The name of the type of usage. + * @member {string} [name.value] A string describing the resource name. + * @member {string} [name.localizedValue] A localized string describing the + * resource name. + */ +export interface Usage { + readonly id?: string; + currentValue: number; + limit: number; + name: UsageName; +} + +/** + * @class + * Initializes a new instance of the AddressSpace class. + * @constructor + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + * + * @member {array} [addressPrefixes] A list of address blocks reserved for this + * virtual network in CIDR notation. + */ +export interface AddressSpace { + addressPrefixes?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkPeering class. + * @constructor + * Peerings in a virtual network resource. + * + * @member {boolean} [allowVirtualNetworkAccess] Whether the VMs in the linked + * virtual network space would be able to access all the VMs in local Virtual + * network space. + * @member {boolean} [allowForwardedTraffic] Whether the forwarded traffic from + * the VMs in the remote virtual network will be allowed/disallowed. + * @member {boolean} [allowGatewayTransit] If gateway links can be used in + * remote virtual networking to link to this virtual network. + * @member {boolean} [useRemoteGateways] If remote gateways can be used on this + * virtual network. If the flag is set to true, and allowGatewayTransit on + * remote peering is also true, virtual network will use gateways of remote + * virtual network for transit. Only one peering can have this flag set to + * true. This flag cannot be set if virtual network already has a gateway. + * @member {object} [remoteVirtualNetwork] The reference of the remote virtual + * network. The remote virtual network can be in the same or different region + * (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @member {string} [remoteVirtualNetwork.id] Resource ID. + * @member {object} [remoteAddressSpace] The reference of the remote virtual + * network address space. + * @member {array} [remoteAddressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * @member {string} [peeringState] The status of the virtual network peering. + * Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible + * values include: 'Initiated', 'Connected', 'Disconnected' + * @member {string} [provisioningState] The provisioning state of the resource. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface VirtualNetworkPeering extends SubResource { + allowVirtualNetworkAccess?: boolean; + allowForwardedTraffic?: boolean; + allowGatewayTransit?: boolean; + useRemoteGateways?: boolean; + remoteVirtualNetwork?: SubResource; + remoteAddressSpace?: AddressSpace; + peeringState?: string; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the DhcpOptions class. + * @constructor + * DhcpOptions contains an array of DNS servers available to VMs deployed in + * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + * options. + * + * @member {array} [dnsServers] The list of DNS servers IP addresses. + */ +export interface DhcpOptions { + dnsServers?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualNetwork class. + * @constructor + * Virtual Network resource. + * + * @member {object} [addressSpace] The AddressSpace that contains an array of + * IP address ranges that can be used by subnets. + * @member {array} [addressSpace.addressPrefixes] A list of address blocks + * reserved for this virtual network in CIDR notation. + * @member {object} [dhcpOptions] The dhcpOptions that contains an array of DNS + * servers available to VMs deployed in the virtual network. + * @member {array} [dhcpOptions.dnsServers] The list of DNS servers IP + * addresses. + * @member {array} [subnets] A list of subnets in a Virtual Network. + * @member {array} [virtualNetworkPeerings] A list of peerings in a Virtual + * Network. + * @member {string} [resourceGuid] The resourceGuid property of the Virtual + * Network resource. + * @member {string} [provisioningState] The provisioning state of the PublicIP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {boolean} [enableDdosProtection] Indicates if DDoS protection is + * enabled for all the protected resources in the virtual network. It requires + * a DDoS protection plan associated with the resource. Default value: false . + * @member {boolean} [enableVmProtection] Indicates if VM protection is enabled + * for all the subnets in the virtual network. Default value: false . + * @member {object} [ddosProtectionPlan] The DDoS protection plan associated + * with the virtual network. + * @member {string} [ddosProtectionPlan.id] Resource ID. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualNetwork extends Resource { + addressSpace?: AddressSpace; + dhcpOptions?: DhcpOptions; + subnets?: Subnet[]; + virtualNetworkPeerings?: VirtualNetworkPeering[]; + resourceGuid?: string; + provisioningState?: string; + enableDdosProtection?: boolean; + enableVmProtection?: boolean; + ddosProtectionPlan?: SubResource; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the IPAddressAvailabilityResult class. + * @constructor + * Response for CheckIPAddressAvailability API service call + * + * @member {boolean} [available] Private IP address availability. + * @member {array} [availableIPAddresses] Contains other available private IP + * addresses if the asked for address is taken. + */ +export interface IPAddressAvailabilityResult { + available?: boolean; + availableIPAddresses?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkUsageName class. + * @constructor + * Usage strings container. + * + * @member {string} [localizedValue] Localized subnet size and usage string. + * @member {string} [value] Subnet size and usage string. + */ +export interface VirtualNetworkUsageName { + readonly localizedValue?: string; + readonly value?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkUsage class. + * @constructor + * Usage details for subnet. + * + * @member {number} [currentValue] Indicates number of IPs used from the + * Subnet. + * @member {string} [id] Subnet identifier. + * @member {number} [limit] Indicates the size of the subnet. + * @member {object} [name] The name containing common and localized value for + * usage. + * @member {string} [name.localizedValue] Localized subnet size and usage + * string. + * @member {string} [name.value] Subnet size and usage string. + * @member {string} [unit] Usage units. Returns 'Count' + */ +export interface VirtualNetworkUsage { + readonly currentValue?: number; + readonly id?: string; + readonly limit?: number; + readonly name?: VirtualNetworkUsageName; + readonly unit?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayIPConfiguration class. + * @constructor + * IP configuration for virtual network gateway + * + * @member {string} [privateIPAllocationMethod] The private IP allocation + * method. Possible values are: 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.id] Resource ID. + * @member {object} [publicIPAddress] The reference of the public IP resource. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] The provisioning state of the public IP + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface VirtualNetworkGatewayIPConfiguration extends SubResource { + privateIPAllocationMethod?: string; + subnet?: SubResource; + publicIPAddress?: SubResource; + readonly provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewaySku class. + * @constructor + * VirtualNetworkGatewaySku details + * + * @member {string} [name] Gateway SKU name. Possible values include: 'Basic', + * 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + * 'VpnGw3' + * @member {string} [tier] Gateway SKU tier. Possible values include: 'Basic', + * 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + * 'VpnGw3' + * @member {number} [capacity] The capacity. + */ +export interface VirtualNetworkGatewaySku { + name?: string; + tier?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the VpnClientRootCertificate class. + * @constructor + * VPN client root certificate of virtual network gateway + * + * @member {string} publicCertData The certificate public data. + * @member {string} [provisioningState] The provisioning state of the VPN + * client root certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface VpnClientRootCertificate extends SubResource { + publicCertData: string; + readonly provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the VpnClientRevokedCertificate class. + * @constructor + * VPN client revoked certificate of virtual network gateway. + * + * @member {string} [thumbprint] The revoked VPN client certificate thumbprint. + * @member {string} [provisioningState] The provisioning state of the VPN + * client revoked certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface VpnClientRevokedCertificate extends SubResource { + thumbprint?: string; + readonly provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the IpsecPolicy class. + * @constructor + * An IPSec Policy configuration for a virtual network gateway connection + * + * @member {number} saLifeTimeSeconds The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN + * tunnel. + * @member {number} saDataSizeKilobytes The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN + * tunnel. + * @member {string} ipsecEncryption The IPSec encryption algorithm (IKE phase + * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * @member {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase 1). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + * 'GCMAES256' + * @member {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). + * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + * 'GCMAES256', 'GCMAES128' + * @member {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + * 'GCMAES128' + * @member {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. + * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @member {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child + * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + */ +export interface IpsecPolicy { + saLifeTimeSeconds: number; + saDataSizeKilobytes: number; + ipsecEncryption: string; + ipsecIntegrity: string; + ikeEncryption: string; + ikeIntegrity: string; + dhGroup: string; + pfsGroup: string; +} + +/** + * @class + * Initializes a new instance of the VpnClientConfiguration class. + * @constructor + * VpnClientConfiguration for P2S client. + * + * @member {object} [vpnClientAddressPool] The reference of the address space + * resource which represents Address space for P2S VpnClient. + * @member {array} [vpnClientAddressPool.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * @member {array} [vpnClientRootCertificates] VpnClientRootCertificate for + * virtual network gateway. + * @member {array} [vpnClientRevokedCertificates] VpnClientRevokedCertificate + * for Virtual network gateway. + * @member {array} [vpnClientProtocols] VpnClientProtocols for Virtual network + * gateway. + * @member {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for virtual + * network gateway P2S client. + * @member {string} [radiusServerAddress] The radius server address property of + * the VirtualNetworkGateway resource for vpn client connection. + * @member {string} [radiusServerSecret] The radius secret property of the + * VirtualNetworkGateway resource for vpn client connection. + */ +export interface VpnClientConfiguration { + vpnClientAddressPool?: AddressSpace; + vpnClientRootCertificates?: VpnClientRootCertificate[]; + vpnClientRevokedCertificates?: VpnClientRevokedCertificate[]; + vpnClientProtocols?: string[]; + vpnClientIpsecPolicies?: IpsecPolicy[]; + radiusServerAddress?: string; + radiusServerSecret?: string; +} + +/** + * @class + * Initializes a new instance of the BgpSettings class. + * @constructor + * BGP settings details + * + * @member {number} [asn] The BGP speaker's ASN. + * @member {string} [bgpPeeringAddress] The BGP peering address and BGP + * identifier of this BGP speaker. + * @member {number} [peerWeight] The weight added to routes learned from this + * BGP speaker. + */ +export interface BgpSettings { + asn?: number; + bgpPeeringAddress?: string; + peerWeight?: number; +} + +/** + * @class + * Initializes a new instance of the BgpPeerStatus class. + * @constructor + * BGP peer status details + * + * @member {string} [localAddress] The virtual network gateway's local address + * @member {string} [neighbor] The remote BGP peer + * @member {number} [asn] The autonomous system number of the remote BGP peer + * @member {string} [state] The BGP peer state. Possible values include: + * 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' + * @member {string} [connectedDuration] For how long the peering has been up + * @member {number} [routesReceived] The number of routes learned from this + * peer + * @member {number} [messagesSent] The number of BGP messages sent + * @member {number} [messagesReceived] The number of BGP messages received + */ +export interface BgpPeerStatus { + readonly localAddress?: string; + readonly neighbor?: string; + readonly asn?: number; + readonly state?: string; + readonly connectedDuration?: string; + readonly routesReceived?: number; + readonly messagesSent?: number; + readonly messagesReceived?: number; +} + +/** + * @class + * Initializes a new instance of the GatewayRoute class. + * @constructor + * Gateway routing details + * + * @member {string} [localAddress] The gateway's local address + * @member {string} [network] The route's network prefix + * @member {string} [nextHop] The route's next hop + * @member {string} [sourcePeer] The peer this route was learned from + * @member {string} [origin] The source this route was learned from + * @member {string} [asPath] The route's AS path sequence + * @member {number} [weight] The route's weight + */ +export interface GatewayRoute { + readonly localAddress?: string; + readonly network?: string; + readonly nextHop?: string; + readonly sourcePeer?: string; + readonly origin?: string; + readonly asPath?: string; + readonly weight?: number; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGateway class. + * @constructor + * A common class for general resource information + * + * @member {array} [ipConfigurations] IP configurations for virtual network + * gateway. + * @member {string} [gatewayType] The type of this virtual network gateway. + * Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: + * 'Vpn', 'ExpressRoute' + * @member {string} [vpnType] The type of this virtual network gateway. + * Possible values are: 'PolicyBased' and 'RouteBased'. Possible values + * include: 'PolicyBased', 'RouteBased' + * @member {boolean} [enableBgp] Whether BGP is enabled for this virtual + * network gateway or not. + * @member {boolean} [activeActive] ActiveActive flag + * @member {object} [gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * @member {string} [gatewayDefaultSite.id] Resource ID. + * @member {object} [sku] The reference of the VirtualNetworkGatewaySku + * resource which represents the SKU selected for Virtual network gateway. + * @member {string} [sku.name] Gateway SKU name. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {string} [sku.tier] Gateway SKU tier. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {number} [sku.capacity] The capacity. + * @member {object} [vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * @member {object} [vpnClientConfiguration.vpnClientAddressPool] The reference + * of the address space resource which represents Address space for P2S + * VpnClient. + * @member {array} + * [vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * @member {array} [vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} [vpnClientConfiguration.radiusServerAddress] The radius + * server address property of the VirtualNetworkGateway resource for vpn client + * connection. + * @member {string} [vpnClientConfiguration.radiusServerSecret] The radius + * secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * @member {object} [bgpSettings] Virtual network gateway's BGP speaker + * settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address and + * BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes learned + * from this BGP speaker. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualNetworkGateway extends Resource { + ipConfigurations?: VirtualNetworkGatewayIPConfiguration[]; + gatewayType?: string; + vpnType?: string; + enableBgp?: boolean; + activeActive?: boolean; + gatewayDefaultSite?: SubResource; + sku?: VirtualNetworkGatewaySku; + vpnClientConfiguration?: VpnClientConfiguration; + bgpSettings?: BgpSettings; + resourceGuid?: string; + readonly provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the VpnClientParameters class. + * @constructor + * Vpn Client Parameters for package generation + * + * @member {string} [processorArchitecture] VPN client Processor Architecture. + * Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', + * 'X86' + * @member {string} [authenticationMethod] VPN client Authentication Method. + * Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: + * 'EAPTLS', 'EAPMSCHAPv2' + * @member {string} [radiusServerAuthCertificate] The public certificate data + * for the radius server authentication certificate as a Base-64 encoded + * string. Required only if external radius authentication has been configured + * with EAPTLS authentication. + * @member {array} [clientRootCertificates] A list of client root certificates + * public certificate data encoded as Base-64 strings. Optional parameter for + * external radius based authentication with EAPTLS. + */ +export interface VpnClientParameters { + processorArchitecture?: string; + authenticationMethod?: string; + radiusServerAuthCertificate?: string; + clientRootCertificates?: string[]; +} + +/** + * @class + * Initializes a new instance of the BgpPeerStatusListResult class. + * @constructor + * Response for list BGP peer status API service call + * + * @member {array} [value] List of BGP peers + */ +export interface BgpPeerStatusListResult { + value?: BgpPeerStatus[]; +} + +/** + * @class + * Initializes a new instance of the GatewayRouteListResult class. + * @constructor + * List of virtual network gateway routes + * + * @member {array} [value] List of gateway routes + */ +export interface GatewayRouteListResult { + value?: GatewayRoute[]; +} + +/** + * @class + * Initializes a new instance of the TunnelConnectionHealth class. + * @constructor + * VirtualNetworkGatewayConnection properties + * + * @member {string} [tunnel] Tunnel name. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * @member {number} [ingressBytesTransferred] The Ingress Bytes Transferred in + * this connection + * @member {number} [egressBytesTransferred] The Egress Bytes Transferred in + * this connection + * @member {string} [lastConnectionEstablishedUtcTime] The time at which + * connection was established in Utc format. + */ +export interface TunnelConnectionHealth { + readonly tunnel?: string; + readonly connectionStatus?: string; + readonly ingressBytesTransferred?: number; + readonly egressBytesTransferred?: number; + readonly lastConnectionEstablishedUtcTime?: string; +} + +/** + * @class + * Initializes a new instance of the LocalNetworkGateway class. + * @constructor + * A common class for general resource information + * + * @member {object} [localNetworkAddressSpace] Local network site address + * space. + * @member {array} [localNetworkAddressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * @member {string} [gatewayIpAddress] IP address of local network gateway. + * @member {object} [bgpSettings] Local network gateway's BGP speaker settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address and + * BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes learned + * from this BGP speaker. + * @member {string} [resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * @member {string} [provisioningState] The provisioning state of the + * LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface LocalNetworkGateway extends Resource { + localNetworkAddressSpace?: AddressSpace; + gatewayIpAddress?: string; + bgpSettings?: BgpSettings; + resourceGuid?: string; + readonly provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayConnection class. + * @constructor + * A common class for general resource information + * + * @member {string} [authorizationKey] The authorizationKey. + * @member {object} virtualNetworkGateway1 The reference to virtual network + * gateway resource. + * @member {array} [virtualNetworkGateway1.ipConfigurations] IP configurations + * for virtual network gateway. + * @member {string} [virtualNetworkGateway1.gatewayType] The type of this + * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * @member {string} [virtualNetworkGateway1.vpnType] The type of this virtual + * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. + * Possible values include: 'PolicyBased', 'RouteBased' + * @member {boolean} [virtualNetworkGateway1.enableBgp] Whether BGP is enabled + * for this virtual network gateway or not. + * @member {boolean} [virtualNetworkGateway1.activeActive] ActiveActive flag + * @member {object} [virtualNetworkGateway1.gatewayDefaultSite] The reference + * of the LocalNetworkGateway resource which represents local network site + * having default routes. Assign Null value in case of removing existing + * default site setting. + * @member {string} [virtualNetworkGateway1.gatewayDefaultSite.id] Resource ID. + * @member {object} [virtualNetworkGateway1.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * @member {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {number} [virtualNetworkGateway1.sku.capacity] The capacity. + * @member {object} [virtualNetworkGateway1.vpnClientConfiguration] The + * reference of the VpnClientConfiguration resource which represents the P2S + * VpnClient configurations. + * @member {object} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] + * A list of address blocks reserved for this virtual network in CIDR notation. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} + * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * @member {string} + * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * @member {object} [virtualNetworkGateway1.bgpSettings] Virtual network + * gateway's BGP speaker settings. + * @member {number} [virtualNetworkGateway1.bgpSettings.asn] The BGP speaker's + * ASN. + * @member {string} [virtualNetworkGateway1.bgpSettings.bgpPeeringAddress] The + * BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [virtualNetworkGateway1.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * @member {string} [virtualNetworkGateway1.resourceGuid] The resource GUID + * property of the VirtualNetworkGateway resource. + * @member {string} [virtualNetworkGateway1.provisioningState] The provisioning + * state of the VirtualNetworkGateway resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [virtualNetworkGateway1.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * @member {object} [virtualNetworkGateway2] The reference to virtual network + * gateway resource. + * @member {array} [virtualNetworkGateway2.ipConfigurations] IP configurations + * for virtual network gateway. + * @member {string} [virtualNetworkGateway2.gatewayType] The type of this + * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * @member {string} [virtualNetworkGateway2.vpnType] The type of this virtual + * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. + * Possible values include: 'PolicyBased', 'RouteBased' + * @member {boolean} [virtualNetworkGateway2.enableBgp] Whether BGP is enabled + * for this virtual network gateway or not. + * @member {boolean} [virtualNetworkGateway2.activeActive] ActiveActive flag + * @member {object} [virtualNetworkGateway2.gatewayDefaultSite] The reference + * of the LocalNetworkGateway resource which represents local network site + * having default routes. Assign Null value in case of removing existing + * default site setting. + * @member {string} [virtualNetworkGateway2.gatewayDefaultSite.id] Resource ID. + * @member {object} [virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * @member {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {number} [virtualNetworkGateway2.sku.capacity] The capacity. + * @member {object} [virtualNetworkGateway2.vpnClientConfiguration] The + * reference of the VpnClientConfiguration resource which represents the P2S + * VpnClient configurations. + * @member {object} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] + * A list of address blocks reserved for this virtual network in CIDR notation. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} + * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * @member {string} + * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * @member {object} [virtualNetworkGateway2.bgpSettings] Virtual network + * gateway's BGP speaker settings. + * @member {number} [virtualNetworkGateway2.bgpSettings.asn] The BGP speaker's + * ASN. + * @member {string} [virtualNetworkGateway2.bgpSettings.bgpPeeringAddress] The + * BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [virtualNetworkGateway2.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * @member {string} [virtualNetworkGateway2.resourceGuid] The resource GUID + * property of the VirtualNetworkGateway resource. + * @member {string} [virtualNetworkGateway2.provisioningState] The provisioning + * state of the VirtualNetworkGateway resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [virtualNetworkGateway2.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * @member {object} [localNetworkGateway2] The reference to local network + * gateway resource. + * @member {object} [localNetworkGateway2.localNetworkAddressSpace] Local + * network site address space. + * @member {array} + * [localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * @member {string} [localNetworkGateway2.gatewayIpAddress] IP address of local + * network gateway. + * @member {object} [localNetworkGateway2.bgpSettings] Local network gateway's + * BGP speaker settings. + * @member {number} [localNetworkGateway2.bgpSettings.asn] The BGP speaker's + * ASN. + * @member {string} [localNetworkGateway2.bgpSettings.bgpPeeringAddress] The + * BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [localNetworkGateway2.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * @member {string} [localNetworkGateway2.resourceGuid] The resource GUID + * property of the LocalNetworkGateway resource. + * @member {string} [localNetworkGateway2.provisioningState] The provisioning + * state of the LocalNetworkGateway resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [localNetworkGateway2.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {string} connectionType Gateway connection type. Possible values + * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @member {number} [routingWeight] The routing weight. + * @member {string} [sharedKey] The IPSec shared key. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values are 'Unknown', 'Connecting', 'Connected' and + * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected' + * @member {array} [tunnelConnectionStatus] Collection of all tunnels' + * connection health status. + * @member {number} [egressBytesTransferred] The egress bytes transferred in + * this connection. + * @member {number} [ingressBytesTransferred] The ingress bytes transferred in + * this connection. + * @member {object} [peer] The reference to peerings resource. + * @member {string} [peer.id] Resource ID. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based + * traffic selectors. + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by this + * connection. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualNetworkGatewayConnection extends Resource { + authorizationKey?: string; + virtualNetworkGateway1: VirtualNetworkGateway; + virtualNetworkGateway2?: VirtualNetworkGateway; + localNetworkGateway2?: LocalNetworkGateway; + connectionType: string; + routingWeight?: number; + sharedKey?: string; + readonly connectionStatus?: string; + readonly tunnelConnectionStatus?: TunnelConnectionHealth[]; + readonly egressBytesTransferred?: number; + readonly ingressBytesTransferred?: number; + peer?: SubResource; + enableBgp?: boolean; + usePolicyBasedTrafficSelectors?: boolean; + ipsecPolicies?: IpsecPolicy[]; + resourceGuid?: string; + readonly provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the ConnectionResetSharedKey class. + * @constructor + * The virtual network connection reset shared key + * + * @member {number} keyLength The virtual network connection reset shared key + * length, should between 1 and 128. + */ +export interface ConnectionResetSharedKey { + keyLength: number; +} + +/** + * @class + * Initializes a new instance of the ConnectionSharedKey class. + * @constructor + * Response for GetConnectionSharedKey API service call + * + * @member {string} value The virtual network connection shared key value. + */ +export interface ConnectionSharedKey { + value: string; +} + +/** + * @class + * Initializes a new instance of the VpnClientIPsecParameters class. + * @constructor + * An IPSec parameters for a virtual network gateway P2S connection. + * + * @member {number} saLifeTimeSeconds The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * @member {number} saDataSizeKilobytes The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * @member {string} ipsecEncryption The IPSec encryption algorithm (IKE phase + * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * @member {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase 1). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + * 'GCMAES256' + * @member {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). + * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + * 'GCMAES256', 'GCMAES128' + * @member {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + * 'GCMAES128' + * @member {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. + * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @member {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child + * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + */ +export interface VpnClientIPsecParameters { + saLifeTimeSeconds: number; + saDataSizeKilobytes: number; + ipsecEncryption: string; + ipsecIntegrity: string; + ikeEncryption: string; + ikeIntegrity: string; + dhGroup: string; + pfsGroup: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkConnectionGatewayReference class. + * @constructor + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @member {string} id The ID of VirtualNetworkGateway or LocalNetworkGateway + * resource. + */ +export interface VirtualNetworkConnectionGatewayReference { + id: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayConnectionListEntity class. + * @constructor + * A common class for general resource information + * + * @member {string} [authorizationKey] The authorizationKey. + * @member {object} virtualNetworkGateway1 The reference to virtual network + * gateway resource. + * @member {string} [virtualNetworkGateway1.id] The ID of VirtualNetworkGateway + * or LocalNetworkGateway resource. + * @member {object} [virtualNetworkGateway2] The reference to virtual network + * gateway resource. + * @member {string} [virtualNetworkGateway2.id] The ID of VirtualNetworkGateway + * or LocalNetworkGateway resource. + * @member {object} [localNetworkGateway2] The reference to local network + * gateway resource. + * @member {string} [localNetworkGateway2.id] The ID of VirtualNetworkGateway + * or LocalNetworkGateway resource. + * @member {string} connectionType Gateway connection type. Possible values + * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @member {number} [routingWeight] The routing weight. + * @member {string} [sharedKey] The IPSec shared key. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values are 'Unknown', 'Connecting', 'Connected' and + * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected' + * @member {array} [tunnelConnectionStatus] Collection of all tunnels' + * connection health status. + * @member {number} [egressBytesTransferred] The egress bytes transferred in + * this connection. + * @member {number} [ingressBytesTransferred] The ingress bytes transferred in + * this connection. + * @member {object} [peer] The reference to peerings resource. + * @member {string} [peer.id] Resource ID. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based + * traffic selectors. + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by this + * connection. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualNetworkGatewayConnectionListEntity extends Resource { + authorizationKey?: string; + virtualNetworkGateway1: VirtualNetworkConnectionGatewayReference; + virtualNetworkGateway2?: VirtualNetworkConnectionGatewayReference; + localNetworkGateway2?: VirtualNetworkConnectionGatewayReference; + connectionType: string; + routingWeight?: number; + sharedKey?: string; + readonly connectionStatus?: string; + readonly tunnelConnectionStatus?: TunnelConnectionHealth[]; + readonly egressBytesTransferred?: number; + readonly ingressBytesTransferred?: number; + peer?: SubResource; + enableBgp?: boolean; + usePolicyBasedTrafficSelectors?: boolean; + ipsecPolicies?: IpsecPolicy[]; + resourceGuid?: string; + readonly provisioningState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the VpnDeviceScriptParameters class. + * @constructor + * Vpn device configuration script generation parameters + * + * @member {string} [vendor] The vendor for the vpn device. + * @member {string} [deviceFamily] The device family for the vpn device. + * @member {string} [firmwareVersion] The firmware version for the vpn device. + */ +export interface VpnDeviceScriptParameters { + vendor?: string; + deviceFamily?: string; + firmwareVersion?: string; +} + + +/** + * @class + * Initializes a new instance of the ApplicationGatewayListResult class. + * @constructor + * Response for ListApplicationGateways API service call. + * + * @member {string} [nextLink] URL to get the next set of results. + */ +export interface ApplicationGatewayListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayAvailableSslPredefinedPolicies class. + * @constructor + * Response for ApplicationGatewayAvailableSslOptions API service call. + * + * @member {string} [nextLink] URL to get the next set of results. + */ +export interface ApplicationGatewayAvailableSslPredefinedPolicies extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationSecurityGroupListResult class. + * @constructor + * A list of application security groups. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ApplicationSecurityGroupListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DdosProtectionPlanListResult class. + * @constructor + * A list of DDoS protection plans. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface DdosProtectionPlanListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the EndpointServicesListResult class. + * @constructor + * Response for the ListAvailableEndpointServices API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface EndpointServicesListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AuthorizationListResult class. + * @constructor + * Response for ListAuthorizations API service call retrieves all + * authorizations that belongs to an ExpressRouteCircuit. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface AuthorizationListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitPeeringListResult class. + * @constructor + * Response for ListPeering API service call retrieves all peerings that belong + * to an ExpressRouteCircuit. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCircuitPeeringListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCircuitListResult class. + * @constructor + * Response for ListExpressRouteCircuit API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCircuitListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteServiceProviderListResult class. + * @constructor + * Response for the ListExpressRouteServiceProvider API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteServiceProviderListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnectionListResult class. + * @constructor + * Response for ListExpressRouteCrossConnection API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCrossConnectionListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ExpressRouteCrossConnectionPeeringList class. + * @constructor + * Response for ListPeering API service call retrieves all peerings that belong + * to an ExpressRouteCrossConnection. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface ExpressRouteCrossConnectionPeeringList extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerListResult class. + * @constructor + * Response for ListLoadBalancers API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LoadBalancerListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerBackendAddressPoolListResult class. + * @constructor + * Response for ListBackendAddressPool API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LoadBalancerBackendAddressPoolListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerFrontendIPConfigurationListResult class. + * @constructor + * Response for ListFrontendIPConfiguration API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LoadBalancerFrontendIPConfigurationListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the InboundNatRuleListResult class. + * @constructor + * Response for ListInboundNatRule API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface InboundNatRuleListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerLoadBalancingRuleListResult class. + * @constructor + * Response for ListLoadBalancingRule API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LoadBalancerLoadBalancingRuleListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceListResult class. + * @constructor + * Response for the ListNetworkInterface API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface NetworkInterfaceListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancerProbeListResult class. + * @constructor + * Response for ListProbe API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LoadBalancerProbeListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceIPConfigurationListResult class. + * @constructor + * Response for list ip configurations API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface NetworkInterfaceIPConfigurationListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceLoadBalancerListResult class. + * @constructor + * Response for list ip configurations API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface NetworkInterfaceLoadBalancerListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkSecurityGroupListResult class. + * @constructor + * Response for ListNetworkSecurityGroups API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface NetworkSecurityGroupListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SecurityRuleListResult class. + * @constructor + * Response for ListSecurityRule API service call. Retrieves all security rules + * that belongs to a network security group. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface SecurityRuleListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkWatcherListResult class. + * @constructor + * List of network watcher resources. + * + */ +export interface NetworkWatcherListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the PacketCaptureListResult class. + * @constructor + * List of packet capture sessions. + * + */ +export interface PacketCaptureListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorListResult class. + * @constructor + * List of connection monitors. + * + */ +export interface ConnectionMonitorListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Network operations. It contains a list of + * operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the PublicIPAddressListResult class. + * @constructor + * Response for ListPublicIpAddresses API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface PublicIPAddressListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RouteFilterListResult class. + * @constructor + * Response for the ListRouteFilters API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface RouteFilterListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RouteFilterRuleListResult class. + * @constructor + * Response for the ListRouteFilterRules API service call + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface RouteFilterRuleListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RouteTableListResult class. + * @constructor + * Response for the ListRouteTable API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface RouteTableListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RouteListResult class. + * @constructor + * Response for the ListRoute API service call + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface RouteListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the BgpServiceCommunityListResult class. + * @constructor + * Response for the ListServiceCommunity API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface BgpServiceCommunityListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the UsagesListResult class. + * @constructor + * The list usages operation response. + * + * @member {string} [nextLink] URL to get the next set of results. + */ +export interface UsagesListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkListResult class. + * @constructor + * Response for the ListVirtualNetworks API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkListUsageResult class. + * @constructor + * Response for the virtual networks GetUsage API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkListUsageResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SubnetListResult class. + * @constructor + * Response for ListSubnets API service callRetrieves all subnet that belongs + * to a virtual network + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface SubnetListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkPeeringListResult class. + * @constructor + * Response for ListSubnets API service call. Retrieves all subnets that belong + * to a virtual network. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkPeeringListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayListResult class. + * @constructor + * Response for the ListVirtualNetworkGateways API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkGatewayListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayListConnectionsResult class. + * @constructor + * Response for the VirtualNetworkGatewayListConnections API service call + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkGatewayListConnectionsResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkGatewayConnectionListResult class. + * @constructor + * Response for the ListVirtualNetworkGatewayConnections API service call + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface VirtualNetworkGatewayConnectionListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LocalNetworkGatewayListResult class. + * @constructor + * Response for ListLocalNetworkGateways API service call. + * + * @member {string} [nextLink] The URL to get the next set of results. + */ +export interface LocalNetworkGatewayListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/networkManagement2/lib/lib/models/index.js b/lib/services/networkManagement2/lib/lib/models/index.js new file mode 100644 index 0000000000..6f5fcdaa5d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/index.js @@ -0,0 +1,250 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.SubResource = require('./subResource'); +exports.BackendAddressPool = require('./backendAddressPool'); +exports.InboundNatRule = require('./inboundNatRule'); +exports.Resource = require('./resource'); +exports.ApplicationSecurityGroup = require('./applicationSecurityGroup'); +exports.SecurityRule = require('./securityRule'); +exports.NetworkInterfaceDnsSettings = require('./networkInterfaceDnsSettings'); +exports.NetworkInterface = require('./networkInterface'); +exports.NetworkSecurityGroup = require('./networkSecurityGroup'); +exports.Route = require('./route'); +exports.RouteTable = require('./routeTable'); +exports.ServiceEndpointPropertiesFormat = require('./serviceEndpointPropertiesFormat'); +exports.PublicIPAddressSku = require('./publicIPAddressSku'); +exports.PublicIPAddressDnsSettings = require('./publicIPAddressDnsSettings'); +exports.IpTag = require('./ipTag'); +exports.PublicIPAddress = require('./publicIPAddress'); +exports.IPConfiguration = require('./iPConfiguration'); +exports.ResourceNavigationLink = require('./resourceNavigationLink'); +exports.Subnet = require('./subnet'); +exports.NetworkInterfaceIPConfiguration = require('./networkInterfaceIPConfiguration'); +exports.ApplicationGatewayBackendAddress = require('./applicationGatewayBackendAddress'); +exports.ApplicationGatewayBackendAddressPool = require('./applicationGatewayBackendAddressPool'); +exports.ApplicationGatewayConnectionDraining = require('./applicationGatewayConnectionDraining'); +exports.ApplicationGatewayBackendHttpSettings = require('./applicationGatewayBackendHttpSettings'); +exports.ApplicationGatewayBackendHealthServer = require('./applicationGatewayBackendHealthServer'); +exports.ApplicationGatewayBackendHealthHttpSettings = require('./applicationGatewayBackendHealthHttpSettings'); +exports.ApplicationGatewayBackendHealthPool = require('./applicationGatewayBackendHealthPool'); +exports.ApplicationGatewayBackendHealth = require('./applicationGatewayBackendHealth'); +exports.ApplicationGatewaySku = require('./applicationGatewaySku'); +exports.ApplicationGatewaySslPolicy = require('./applicationGatewaySslPolicy'); +exports.ApplicationGatewayIPConfiguration = require('./applicationGatewayIPConfiguration'); +exports.ApplicationGatewayAuthenticationCertificate = require('./applicationGatewayAuthenticationCertificate'); +exports.ApplicationGatewaySslCertificate = require('./applicationGatewaySslCertificate'); +exports.ApplicationGatewayFrontendIPConfiguration = require('./applicationGatewayFrontendIPConfiguration'); +exports.ApplicationGatewayFrontendPort = require('./applicationGatewayFrontendPort'); +exports.ApplicationGatewayHttpListener = require('./applicationGatewayHttpListener'); +exports.ApplicationGatewayPathRule = require('./applicationGatewayPathRule'); +exports.ApplicationGatewayProbeHealthResponseMatch = require('./applicationGatewayProbeHealthResponseMatch'); +exports.ApplicationGatewayProbe = require('./applicationGatewayProbe'); +exports.ApplicationGatewayRequestRoutingRule = require('./applicationGatewayRequestRoutingRule'); +exports.ApplicationGatewayRedirectConfiguration = require('./applicationGatewayRedirectConfiguration'); +exports.ApplicationGatewayUrlPathMap = require('./applicationGatewayUrlPathMap'); +exports.ApplicationGatewayFirewallDisabledRuleGroup = require('./applicationGatewayFirewallDisabledRuleGroup'); +exports.ApplicationGatewayWebApplicationFirewallConfiguration = require('./applicationGatewayWebApplicationFirewallConfiguration'); +exports.ApplicationGateway = require('./applicationGateway'); +exports.ApplicationGatewayFirewallRule = require('./applicationGatewayFirewallRule'); +exports.ApplicationGatewayFirewallRuleGroup = require('./applicationGatewayFirewallRuleGroup'); +exports.ApplicationGatewayFirewallRuleSet = require('./applicationGatewayFirewallRuleSet'); +exports.ApplicationGatewayAvailableWafRuleSetsResult = require('./applicationGatewayAvailableWafRuleSetsResult'); +exports.ApplicationGatewayAvailableSslOptions = require('./applicationGatewayAvailableSslOptions'); +exports.ApplicationGatewaySslPredefinedPolicy = require('./applicationGatewaySslPredefinedPolicy'); +exports.TagsObject = require('./tagsObject'); +exports.DnsNameAvailabilityResult = require('./dnsNameAvailabilityResult'); +exports.DdosProtectionPlan = require('./ddosProtectionPlan'); +exports.EndpointServiceResult = require('./endpointServiceResult'); +exports.ExpressRouteCircuitAuthorization = require('./expressRouteCircuitAuthorization'); +exports.ExpressRouteCircuitPeeringConfig = require('./expressRouteCircuitPeeringConfig'); +exports.RouteFilterRule = require('./routeFilterRule'); +exports.ExpressRouteCircuitStats = require('./expressRouteCircuitStats'); +exports.ExpressRouteCircuitConnection = require('./expressRouteCircuitConnection'); +exports.ExpressRouteCircuitPeering = require('./expressRouteCircuitPeering'); +exports.RouteFilter = require('./routeFilter'); +exports.Ipv6ExpressRouteCircuitPeeringConfig = require('./ipv6ExpressRouteCircuitPeeringConfig'); +exports.ExpressRouteCircuitSku = require('./expressRouteCircuitSku'); +exports.ExpressRouteCircuitServiceProviderProperties = require('./expressRouteCircuitServiceProviderProperties'); +exports.ExpressRouteCircuit = require('./expressRouteCircuit'); +exports.ExpressRouteCircuitArpTable = require('./expressRouteCircuitArpTable'); +exports.ExpressRouteCircuitsArpTableListResult = require('./expressRouteCircuitsArpTableListResult'); +exports.ExpressRouteCircuitRoutesTable = require('./expressRouteCircuitRoutesTable'); +exports.ExpressRouteCircuitsRoutesTableListResult = require('./expressRouteCircuitsRoutesTableListResult'); +exports.ExpressRouteCircuitRoutesTableSummary = require('./expressRouteCircuitRoutesTableSummary'); +exports.ExpressRouteCircuitsRoutesTableSummaryListResult = require('./expressRouteCircuitsRoutesTableSummaryListResult'); +exports.ExpressRouteServiceProviderBandwidthsOffered = require('./expressRouteServiceProviderBandwidthsOffered'); +exports.ExpressRouteServiceProvider = require('./expressRouteServiceProvider'); +exports.ExpressRouteCrossConnectionRoutesTableSummary = require('./expressRouteCrossConnectionRoutesTableSummary'); +exports.ExpressRouteCrossConnectionsRoutesTableSummaryListResult = require('./expressRouteCrossConnectionsRoutesTableSummaryListResult'); +exports.ExpressRouteCircuitReference = require('./expressRouteCircuitReference'); +exports.ExpressRouteCrossConnectionPeering = require('./expressRouteCrossConnectionPeering'); +exports.ExpressRouteCrossConnection = require('./expressRouteCrossConnection'); +exports.LoadBalancerSku = require('./loadBalancerSku'); +exports.FrontendIPConfiguration = require('./frontendIPConfiguration'); +exports.LoadBalancingRule = require('./loadBalancingRule'); +exports.Probe = require('./probe'); +exports.InboundNatPool = require('./inboundNatPool'); +exports.OutboundNatRule = require('./outboundNatRule'); +exports.LoadBalancer = require('./loadBalancer'); +exports.ErrorDetails = require('./errorDetails'); +exports.ErrorModel = require('./errorModel'); +exports.AzureAsyncOperationResult = require('./azureAsyncOperationResult'); +exports.EffectiveNetworkSecurityGroupAssociation = require('./effectiveNetworkSecurityGroupAssociation'); +exports.EffectiveNetworkSecurityRule = require('./effectiveNetworkSecurityRule'); +exports.EffectiveNetworkSecurityGroup = require('./effectiveNetworkSecurityGroup'); +exports.EffectiveNetworkSecurityGroupListResult = require('./effectiveNetworkSecurityGroupListResult'); +exports.EffectiveRoute = require('./effectiveRoute'); +exports.EffectiveRouteListResult = require('./effectiveRouteListResult'); +exports.NetworkWatcher = require('./networkWatcher'); +exports.TopologyParameters = require('./topologyParameters'); +exports.TopologyAssociation = require('./topologyAssociation'); +exports.TopologyResource = require('./topologyResource'); +exports.Topology = require('./topology'); +exports.VerificationIPFlowParameters = require('./verificationIPFlowParameters'); +exports.VerificationIPFlowResult = require('./verificationIPFlowResult'); +exports.NextHopParameters = require('./nextHopParameters'); +exports.NextHopResult = require('./nextHopResult'); +exports.SecurityGroupViewParameters = require('./securityGroupViewParameters'); +exports.NetworkInterfaceAssociation = require('./networkInterfaceAssociation'); +exports.SubnetAssociation = require('./subnetAssociation'); +exports.SecurityRuleAssociations = require('./securityRuleAssociations'); +exports.SecurityGroupNetworkInterface = require('./securityGroupNetworkInterface'); +exports.SecurityGroupViewResult = require('./securityGroupViewResult'); +exports.PacketCaptureStorageLocation = require('./packetCaptureStorageLocation'); +exports.PacketCaptureFilter = require('./packetCaptureFilter'); +exports.PacketCaptureParameters = require('./packetCaptureParameters'); +exports.PacketCapture = require('./packetCapture'); +exports.PacketCaptureResult = require('./packetCaptureResult'); +exports.PacketCaptureQueryStatusResult = require('./packetCaptureQueryStatusResult'); +exports.TroubleshootingParameters = require('./troubleshootingParameters'); +exports.QueryTroubleshootingParameters = require('./queryTroubleshootingParameters'); +exports.TroubleshootingRecommendedActions = require('./troubleshootingRecommendedActions'); +exports.TroubleshootingDetails = require('./troubleshootingDetails'); +exports.TroubleshootingResult = require('./troubleshootingResult'); +exports.RetentionPolicyParameters = require('./retentionPolicyParameters'); +exports.FlowLogStatusParameters = require('./flowLogStatusParameters'); +exports.FlowLogInformation = require('./flowLogInformation'); +exports.ConnectivitySource = require('./connectivitySource'); +exports.ConnectivityDestination = require('./connectivityDestination'); +exports.ConnectivityParameters = require('./connectivityParameters'); +exports.ConnectivityIssue = require('./connectivityIssue'); +exports.ConnectivityHop = require('./connectivityHop'); +exports.ConnectivityInformation = require('./connectivityInformation'); +exports.AzureReachabilityReportLocation = require('./azureReachabilityReportLocation'); +exports.AzureReachabilityReportParameters = require('./azureReachabilityReportParameters'); +exports.AzureReachabilityReportLatencyInfo = require('./azureReachabilityReportLatencyInfo'); +exports.AzureReachabilityReportItem = require('./azureReachabilityReportItem'); +exports.AzureReachabilityReport = require('./azureReachabilityReport'); +exports.AvailableProvidersListParameters = require('./availableProvidersListParameters'); +exports.AvailableProvidersListCity = require('./availableProvidersListCity'); +exports.AvailableProvidersListState = require('./availableProvidersListState'); +exports.AvailableProvidersListCountry = require('./availableProvidersListCountry'); +exports.AvailableProvidersList = require('./availableProvidersList'); +exports.ConnectionMonitorSource = require('./connectionMonitorSource'); +exports.ConnectionMonitorDestination = require('./connectionMonitorDestination'); +exports.ConnectionMonitorParameters = require('./connectionMonitorParameters'); +exports.ConnectionMonitor = require('./connectionMonitor'); +exports.ConnectionMonitorResult = require('./connectionMonitorResult'); +exports.ConnectionStateSnapshot = require('./connectionStateSnapshot'); +exports.ConnectionMonitorQueryResult = require('./connectionMonitorQueryResult'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Availability = require('./availability'); +exports.Dimension = require('./dimension'); +exports.MetricSpecification = require('./metricSpecification'); +exports.LogSpecification = require('./logSpecification'); +exports.OperationPropertiesFormatServiceSpecification = require('./operationPropertiesFormatServiceSpecification'); +exports.Operation = require('./operation'); +exports.PatchRouteFilterRule = require('./patchRouteFilterRule'); +exports.PatchRouteFilter = require('./patchRouteFilter'); +exports.BGPCommunity = require('./bGPCommunity'); +exports.BgpServiceCommunity = require('./bgpServiceCommunity'); +exports.UsageName = require('./usageName'); +exports.Usage = require('./usage'); +exports.AddressSpace = require('./addressSpace'); +exports.VirtualNetworkPeering = require('./virtualNetworkPeering'); +exports.DhcpOptions = require('./dhcpOptions'); +exports.VirtualNetwork = require('./virtualNetwork'); +exports.IPAddressAvailabilityResult = require('./iPAddressAvailabilityResult'); +exports.VirtualNetworkUsageName = require('./virtualNetworkUsageName'); +exports.VirtualNetworkUsage = require('./virtualNetworkUsage'); +exports.VirtualNetworkGatewayIPConfiguration = require('./virtualNetworkGatewayIPConfiguration'); +exports.VirtualNetworkGatewaySku = require('./virtualNetworkGatewaySku'); +exports.VpnClientRootCertificate = require('./vpnClientRootCertificate'); +exports.VpnClientRevokedCertificate = require('./vpnClientRevokedCertificate'); +exports.IpsecPolicy = require('./ipsecPolicy'); +exports.VpnClientConfiguration = require('./vpnClientConfiguration'); +exports.BgpSettings = require('./bgpSettings'); +exports.BgpPeerStatus = require('./bgpPeerStatus'); +exports.GatewayRoute = require('./gatewayRoute'); +exports.VirtualNetworkGateway = require('./virtualNetworkGateway'); +exports.VpnClientParameters = require('./vpnClientParameters'); +exports.BgpPeerStatusListResult = require('./bgpPeerStatusListResult'); +exports.GatewayRouteListResult = require('./gatewayRouteListResult'); +exports.TunnelConnectionHealth = require('./tunnelConnectionHealth'); +exports.LocalNetworkGateway = require('./localNetworkGateway'); +exports.VirtualNetworkGatewayConnection = require('./virtualNetworkGatewayConnection'); +exports.ConnectionResetSharedKey = require('./connectionResetSharedKey'); +exports.ConnectionSharedKey = require('./connectionSharedKey'); +exports.VpnClientIPsecParameters = require('./vpnClientIPsecParameters'); +exports.VirtualNetworkConnectionGatewayReference = require('./virtualNetworkConnectionGatewayReference'); +exports.VirtualNetworkGatewayConnectionListEntity = require('./virtualNetworkGatewayConnectionListEntity'); +exports.VpnDeviceScriptParameters = require('./vpnDeviceScriptParameters'); +exports.ApplicationGatewayListResult = require('./applicationGatewayListResult'); +exports.ApplicationGatewayAvailableSslPredefinedPolicies = require('./applicationGatewayAvailableSslPredefinedPolicies'); +exports.ApplicationSecurityGroupListResult = require('./applicationSecurityGroupListResult'); +exports.DdosProtectionPlanListResult = require('./ddosProtectionPlanListResult'); +exports.EndpointServicesListResult = require('./endpointServicesListResult'); +exports.AuthorizationListResult = require('./authorizationListResult'); +exports.ExpressRouteCircuitPeeringListResult = require('./expressRouteCircuitPeeringListResult'); +exports.ExpressRouteCircuitListResult = require('./expressRouteCircuitListResult'); +exports.ExpressRouteServiceProviderListResult = require('./expressRouteServiceProviderListResult'); +exports.ExpressRouteCrossConnectionListResult = require('./expressRouteCrossConnectionListResult'); +exports.ExpressRouteCrossConnectionPeeringList = require('./expressRouteCrossConnectionPeeringList'); +exports.LoadBalancerListResult = require('./loadBalancerListResult'); +exports.LoadBalancerBackendAddressPoolListResult = require('./loadBalancerBackendAddressPoolListResult'); +exports.LoadBalancerFrontendIPConfigurationListResult = require('./loadBalancerFrontendIPConfigurationListResult'); +exports.InboundNatRuleListResult = require('./inboundNatRuleListResult'); +exports.LoadBalancerLoadBalancingRuleListResult = require('./loadBalancerLoadBalancingRuleListResult'); +exports.NetworkInterfaceListResult = require('./networkInterfaceListResult'); +exports.LoadBalancerProbeListResult = require('./loadBalancerProbeListResult'); +exports.NetworkInterfaceIPConfigurationListResult = require('./networkInterfaceIPConfigurationListResult'); +exports.NetworkInterfaceLoadBalancerListResult = require('./networkInterfaceLoadBalancerListResult'); +exports.NetworkSecurityGroupListResult = require('./networkSecurityGroupListResult'); +exports.SecurityRuleListResult = require('./securityRuleListResult'); +exports.NetworkWatcherListResult = require('./networkWatcherListResult'); +exports.PacketCaptureListResult = require('./packetCaptureListResult'); +exports.ConnectionMonitorListResult = require('./connectionMonitorListResult'); +exports.OperationListResult = require('./operationListResult'); +exports.PublicIPAddressListResult = require('./publicIPAddressListResult'); +exports.RouteFilterListResult = require('./routeFilterListResult'); +exports.RouteFilterRuleListResult = require('./routeFilterRuleListResult'); +exports.RouteTableListResult = require('./routeTableListResult'); +exports.RouteListResult = require('./routeListResult'); +exports.BgpServiceCommunityListResult = require('./bgpServiceCommunityListResult'); +exports.UsagesListResult = require('./usagesListResult'); +exports.VirtualNetworkListResult = require('./virtualNetworkListResult'); +exports.VirtualNetworkListUsageResult = require('./virtualNetworkListUsageResult'); +exports.SubnetListResult = require('./subnetListResult'); +exports.VirtualNetworkPeeringListResult = require('./virtualNetworkPeeringListResult'); +exports.VirtualNetworkGatewayListResult = require('./virtualNetworkGatewayListResult'); +exports.VirtualNetworkGatewayListConnectionsResult = require('./virtualNetworkGatewayListConnectionsResult'); +exports.VirtualNetworkGatewayConnectionListResult = require('./virtualNetworkGatewayConnectionListResult'); +exports.LocalNetworkGatewayListResult = require('./localNetworkGatewayListResult'); diff --git a/lib/services/networkManagement2/lib/lib/models/ipTag.js b/lib/services/networkManagement2/lib/lib/models/ipTag.js new file mode 100644 index 0000000000..f6352a0ffa --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/ipTag.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Contains the IpTag associated with the public IP address + * + */ +class IpTag { + /** + * Create a IpTag. + * @member {string} [ipTagType] Gets or sets the ipTag type: Example + * FirstPartyUsage. + * @member {string} [tag] Gets or sets value of the IpTag associated with the + * public IP. Example SQL, Storage etc + */ + constructor() { + } + + /** + * Defines the metadata of IpTag + * + * @returns {object} metadata of IpTag + * + */ + mapper() { + return { + required: false, + serializedName: 'IpTag', + type: { + name: 'Composite', + className: 'IpTag', + modelProperties: { + ipTagType: { + required: false, + serializedName: 'ipTagType', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpTag; diff --git a/lib/services/networkManagement2/lib/lib/models/ipsecPolicy.js b/lib/services/networkManagement2/lib/lib/models/ipsecPolicy.js new file mode 100644 index 0000000000..ee16d6a604 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/ipsecPolicy.js @@ -0,0 +1,124 @@ +/* + * 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'; + +/** + * An IPSec Policy configuration for a virtual network gateway connection + * + */ +class IpsecPolicy { + /** + * Create a IpsecPolicy. + * @member {number} saLifeTimeSeconds The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site + * VPN tunnel. + * @member {number} saDataSizeKilobytes The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN + * tunnel. + * @member {string} ipsecEncryption The IPSec encryption algorithm (IKE phase + * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * @member {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase + * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256' + * @member {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). + * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + * 'GCMAES256', 'GCMAES128' + * @member {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + * 'GCMAES128' + * @member {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. + * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @member {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child + * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + */ + constructor() { + } + + /** + * Defines the metadata of IpsecPolicy + * + * @returns {object} metadata of IpsecPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'IpsecPolicy', + type: { + name: 'Composite', + className: 'IpsecPolicy', + modelProperties: { + saLifeTimeSeconds: { + required: true, + serializedName: 'saLifeTimeSeconds', + type: { + name: 'Number' + } + }, + saDataSizeKilobytes: { + required: true, + serializedName: 'saDataSizeKilobytes', + type: { + name: 'Number' + } + }, + ipsecEncryption: { + required: true, + serializedName: 'ipsecEncryption', + type: { + name: 'String' + } + }, + ipsecIntegrity: { + required: true, + serializedName: 'ipsecIntegrity', + type: { + name: 'String' + } + }, + ikeEncryption: { + required: true, + serializedName: 'ikeEncryption', + type: { + name: 'String' + } + }, + ikeIntegrity: { + required: true, + serializedName: 'ikeIntegrity', + type: { + name: 'String' + } + }, + dhGroup: { + required: true, + serializedName: 'dhGroup', + type: { + name: 'String' + } + }, + pfsGroup: { + required: true, + serializedName: 'pfsGroup', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpsecPolicy; diff --git a/lib/services/networkManagement2/lib/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js b/lib/services/networkManagement2/lib/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js new file mode 100644 index 0000000000..c171731b9d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Contains IPv6 peering config. + * + */ +class Ipv6ExpressRouteCircuitPeeringConfig { + /** + * Create a Ipv6ExpressRouteCircuitPeeringConfig. + * @member {string} [primaryPeerAddressPrefix] The primary address prefix. + * @member {string} [secondaryPeerAddressPrefix] The secondary address + * prefix. + * @member {object} [microsoftPeeringConfig] The Microsoft peering + * configuration. + * @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The + * reference of AdvertisedPublicPrefixes. + * @member {array} [microsoftPeeringConfig.advertisedCommunities] The + * communities of bgp peering. Spepcified for microsoft peering + * @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * @member {number} [microsoftPeeringConfig.legacyMode] The legacy mode of + * the peering. + * @member {number} [microsoftPeeringConfig.customerASN] The CustomerASN of + * the peering. + * @member {string} [microsoftPeeringConfig.routingRegistryName] The + * RoutingRegistryName of the configuration. + * @member {object} [routeFilter] The reference of the RouteFilter resource. + * @member {array} [routeFilter.rules] Collection of RouteFilterRules + * contained within a route filter. + * @member {array} [routeFilter.peerings] A collection of references to + * express route circuit peerings. + * @member {string} [routeFilter.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [routeFilter.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {string} [state] The state of peering. Possible values are: + * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + */ + constructor() { + } + + /** + * Defines the metadata of Ipv6ExpressRouteCircuitPeeringConfig + * + * @returns {object} metadata of Ipv6ExpressRouteCircuitPeeringConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'Ipv6ExpressRouteCircuitPeeringConfig', + type: { + name: 'Composite', + className: 'Ipv6ExpressRouteCircuitPeeringConfig', + modelProperties: { + primaryPeerAddressPrefix: { + required: false, + serializedName: 'primaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + secondaryPeerAddressPrefix: { + required: false, + serializedName: 'secondaryPeerAddressPrefix', + type: { + name: 'String' + } + }, + microsoftPeeringConfig: { + required: false, + serializedName: 'microsoftPeeringConfig', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeeringConfig' + } + }, + routeFilter: { + required: false, + serializedName: 'routeFilter', + type: { + name: 'Composite', + className: 'RouteFilter' + } + }, + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Ipv6ExpressRouteCircuitPeeringConfig; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancer.js b/lib/services/networkManagement2/lib/lib/models/loadBalancer.js new file mode 100644 index 0000000000..a0e73dfe7b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancer.js @@ -0,0 +1,260 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * LoadBalancer resource + * + * @extends models['Resource'] + */ +class LoadBalancer extends models['Resource'] { + /** + * Create a LoadBalancer. + * @member {object} [sku] The load balancer SKU. + * @member {string} [sku.name] Name of a load balancer SKU. Possible values + * include: 'Basic', 'Standard' + * @member {array} [frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * @member {array} [backendAddressPools] Collection of backend address pools + * used by a load balancer + * @member {array} [loadBalancingRules] Object collection representing the + * load balancing rules Gets the provisioning + * @member {array} [probes] Collection of probe objects used in the load + * balancer + * @member {array} [inboundNatRules] Collection of inbound NAT Rules used by + * a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools + * are referenced from virtual machine scale sets. NICs that are associated + * with individual virtual machines cannot reference an Inbound NAT pool. + * They have to reference individual inbound NAT rules. + * @member {array} [inboundNatPools] Defines an external port range for + * inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an inbound NAT pool. They have to + * reference individual inbound NAT rules. + * @member {array} [outboundNatRules] The outbound NAT rules. + * @member {string} [resourceGuid] The resource GUID property of the load + * balancer resource. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancer + * + * @returns {object} metadata of LoadBalancer + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancer', + type: { + name: 'Composite', + className: 'LoadBalancer', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'LoadBalancerSku' + } + }, + frontendIPConfigurations: { + required: false, + serializedName: 'properties.frontendIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendIPConfigurationElementType', + type: { + name: 'Composite', + className: 'FrontendIPConfiguration' + } + } + } + }, + backendAddressPools: { + required: false, + serializedName: 'properties.backendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendAddressPoolElementType', + type: { + name: 'Composite', + className: 'BackendAddressPool' + } + } + } + }, + loadBalancingRules: { + required: false, + serializedName: 'properties.loadBalancingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancingRuleElementType', + type: { + name: 'Composite', + className: 'LoadBalancingRule' + } + } + } + }, + probes: { + required: false, + serializedName: 'properties.probes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProbeElementType', + type: { + name: 'Composite', + className: 'Probe' + } + } + } + }, + inboundNatRules: { + required: false, + serializedName: 'properties.inboundNatRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InboundNatRuleElementType', + type: { + name: 'Composite', + className: 'InboundNatRule' + } + } + } + }, + inboundNatPools: { + required: false, + serializedName: 'properties.inboundNatPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InboundNatPoolElementType', + type: { + name: 'Composite', + className: 'InboundNatPool' + } + } + } + }, + outboundNatRules: { + required: false, + serializedName: 'properties.outboundNatRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OutboundNatRuleElementType', + type: { + name: 'Composite', + className: 'OutboundNatRule' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancer; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerBackendAddressPoolListResult.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerBackendAddressPoolListResult.js new file mode 100644 index 0000000000..0950d568de --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerBackendAddressPoolListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListBackendAddressPool API service call. + */ +class LoadBalancerBackendAddressPoolListResult extends Array { + /** + * Create a LoadBalancerBackendAddressPoolListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancerBackendAddressPoolListResult + * + * @returns {object} metadata of LoadBalancerBackendAddressPoolListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerBackendAddressPoolListResult', + type: { + name: 'Composite', + className: 'LoadBalancerBackendAddressPoolListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendAddressPoolElementType', + type: { + name: 'Composite', + className: 'BackendAddressPool' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerBackendAddressPoolListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerFrontendIPConfigurationListResult.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerFrontendIPConfigurationListResult.js new file mode 100644 index 0000000000..f7833aa361 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerFrontendIPConfigurationListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListFrontendIPConfiguration API service call. + */ +class LoadBalancerFrontendIPConfigurationListResult extends Array { + /** + * Create a LoadBalancerFrontendIPConfigurationListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancerFrontendIPConfigurationListResult + * + * @returns {object} metadata of LoadBalancerFrontendIPConfigurationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerFrontendIPConfigurationListResult', + type: { + name: 'Composite', + className: 'LoadBalancerFrontendIPConfigurationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendIPConfigurationElementType', + type: { + name: 'Composite', + className: 'FrontendIPConfiguration' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerFrontendIPConfigurationListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerListResult.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerListResult.js new file mode 100644 index 0000000000..23583728e8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListLoadBalancers API service call. + */ +class LoadBalancerListResult extends Array { + /** + * Create a LoadBalancerListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancerListResult + * + * @returns {object} metadata of LoadBalancerListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerListResult', + type: { + name: 'Composite', + className: 'LoadBalancerListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancerElementType', + type: { + name: 'Composite', + className: 'LoadBalancer' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerLoadBalancingRuleListResult.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerLoadBalancingRuleListResult.js new file mode 100644 index 0000000000..d2d4db85ca --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerLoadBalancingRuleListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListLoadBalancingRule API service call. + */ +class LoadBalancerLoadBalancingRuleListResult extends Array { + /** + * Create a LoadBalancerLoadBalancingRuleListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancerLoadBalancingRuleListResult + * + * @returns {object} metadata of LoadBalancerLoadBalancingRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerLoadBalancingRuleListResult', + type: { + name: 'Composite', + className: 'LoadBalancerLoadBalancingRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancingRuleElementType', + type: { + name: 'Composite', + className: 'LoadBalancingRule' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerLoadBalancingRuleListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerProbeListResult.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerProbeListResult.js new file mode 100644 index 0000000000..c56bf7bd1b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerProbeListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListProbe API service call. + */ +class LoadBalancerProbeListResult extends Array { + /** + * Create a LoadBalancerProbeListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancerProbeListResult + * + * @returns {object} metadata of LoadBalancerProbeListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerProbeListResult', + type: { + name: 'Composite', + className: 'LoadBalancerProbeListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProbeElementType', + type: { + name: 'Composite', + className: 'Probe' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerProbeListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancerSku.js b/lib/services/networkManagement2/lib/lib/models/loadBalancerSku.js new file mode 100644 index 0000000000..b0779d1650 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancerSku.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * SKU of a load balancer + * + */ +class LoadBalancerSku { + /** + * Create a LoadBalancerSku. + * @member {string} [name] Name of a load balancer SKU. Possible values + * include: 'Basic', 'Standard' + */ + constructor() { + } + + /** + * Defines the metadata of LoadBalancerSku + * + * @returns {object} metadata of LoadBalancerSku + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancerSku', + type: { + name: 'Composite', + className: 'LoadBalancerSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancerSku; diff --git a/lib/services/networkManagement2/lib/lib/models/loadBalancingRule.js b/lib/services/networkManagement2/lib/lib/models/loadBalancingRule.js new file mode 100644 index 0000000000..fd17df9a64 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/loadBalancingRule.js @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A load balancing rule for a load balancer. + * + * @extends models['SubResource'] + */ +class LoadBalancingRule extends models['SubResource'] { + /** + * Create a LoadBalancingRule. + * @member {object} [frontendIPConfiguration] A reference to frontend IP + * addresses. + * @member {string} [frontendIPConfiguration.id] Resource ID. + * @member {object} [backendAddressPool] A reference to a pool of DIPs. + * Inbound traffic is randomly load balanced across IPs in the backend IPs. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {object} [probe] The reference of the load balancer probe used by + * the load balancing rule. + * @member {string} [probe.id] Resource ID. + * @member {string} protocol Possible values include: 'Udp', 'Tcp', 'All' + * @member {string} [loadDistribution] The load distribution policy for this + * rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + * Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + * @member {number} frontendPort The port for the external endpoint. Port + * numbers for each rule must be unique within the Load Balancer. Acceptable + * values are between 0 and 65534. Note that value 0 enables "Any Port" + * @member {number} [backendPort] The port used for internal connections on + * the endpoint. Acceptable values are between 0 and 65535. Note that value 0 + * enables "Any Port" + * @member {number} [idleTimeoutInMinutes] The timeout for the TCP idle + * connection. The value can be set between 4 and 30 minutes. The default + * value is 4 minutes. This element is only used when the protocol is set to + * TCP. + * @member {boolean} [enableFloatingIP] Configures a virtual machine's + * endpoint for the floating IP capability required to configure a SQL + * AlwaysOn Availability Group. This setting is required when using the SQL + * AlwaysOn Availability Groups in SQL server. This setting can't be changed + * after you create the endpoint. + * @member {boolean} [disableOutboundSnat] Configures SNAT for the VMs in the + * backend pool to use the publicIP address specified in the frontend of the + * load balancing rule. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancingRule + * + * @returns {object} metadata of LoadBalancingRule + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancingRule', + type: { + name: 'Composite', + className: 'LoadBalancingRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + frontendIPConfiguration: { + required: false, + serializedName: 'properties.frontendIPConfiguration', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + backendAddressPool: { + required: false, + serializedName: 'properties.backendAddressPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + probe: { + required: false, + serializedName: 'properties.probe', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + protocol: { + required: true, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + loadDistribution: { + required: false, + serializedName: 'properties.loadDistribution', + type: { + name: 'String' + } + }, + frontendPort: { + required: true, + serializedName: 'properties.frontendPort', + type: { + name: 'Number' + } + }, + backendPort: { + required: false, + serializedName: 'properties.backendPort', + type: { + name: 'Number' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + enableFloatingIP: { + required: false, + serializedName: 'properties.enableFloatingIP', + type: { + name: 'Boolean' + } + }, + disableOutboundSnat: { + required: false, + serializedName: 'properties.disableOutboundSnat', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancingRule; diff --git a/lib/services/networkManagement2/lib/lib/models/localNetworkGateway.js b/lib/services/networkManagement2/lib/lib/models/localNetworkGateway.js new file mode 100644 index 0000000000..2ec08f4459 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/localNetworkGateway.js @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A common class for general resource information + * + * @extends models['Resource'] + */ +class LocalNetworkGateway extends models['Resource'] { + /** + * Create a LocalNetworkGateway. + * @member {object} [localNetworkAddressSpace] Local network site address + * space. + * @member {array} [localNetworkAddressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * @member {string} [gatewayIpAddress] IP address of local network gateway. + * @member {object} [bgpSettings] Local network gateway's BGP speaker + * settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address + * and BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes + * learned from this BGP speaker. + * @member {string} [resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * @member {string} [provisioningState] The provisioning state of the + * LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LocalNetworkGateway + * + * @returns {object} metadata of LocalNetworkGateway + * + */ + mapper() { + return { + required: false, + serializedName: 'LocalNetworkGateway', + type: { + name: 'Composite', + className: 'LocalNetworkGateway', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + localNetworkAddressSpace: { + required: false, + serializedName: 'properties.localNetworkAddressSpace', + type: { + name: 'Composite', + className: 'AddressSpace' + } + }, + gatewayIpAddress: { + required: false, + serializedName: 'properties.gatewayIpAddress', + type: { + name: 'String' + } + }, + bgpSettings: { + required: false, + serializedName: 'properties.bgpSettings', + type: { + name: 'Composite', + className: 'BgpSettings' + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LocalNetworkGateway; diff --git a/lib/services/networkManagement2/lib/lib/models/localNetworkGatewayListResult.js b/lib/services/networkManagement2/lib/lib/models/localNetworkGatewayListResult.js new file mode 100644 index 0000000000..83f2432d5d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/localNetworkGatewayListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListLocalNetworkGateways API service call. + */ +class LocalNetworkGatewayListResult extends Array { + /** + * Create a LocalNetworkGatewayListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LocalNetworkGatewayListResult + * + * @returns {object} metadata of LocalNetworkGatewayListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LocalNetworkGatewayListResult', + type: { + name: 'Composite', + className: 'LocalNetworkGatewayListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LocalNetworkGatewayElementType', + type: { + name: 'Composite', + className: 'LocalNetworkGateway' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LocalNetworkGatewayListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/logSpecification.js b/lib/services/networkManagement2/lib/lib/models/logSpecification.js new file mode 100644 index 0000000000..bd032c17ec --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/logSpecification.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description of logging specification. + * + */ +class LogSpecification { + /** + * Create a LogSpecification. + * @member {string} [name] The name of the specification. + * @member {string} [displayName] The display name of the specification. + * @member {string} [blobDuration] Duration of the blob. + */ + constructor() { + } + + /** + * Defines the metadata of LogSpecification + * + * @returns {object} metadata of LogSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'LogSpecification', + type: { + name: 'Composite', + className: 'LogSpecification', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + blobDuration: { + required: false, + serializedName: 'blobDuration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogSpecification; diff --git a/lib/services/networkManagement2/lib/lib/models/metricSpecification.js b/lib/services/networkManagement2/lib/lib/models/metricSpecification.js new file mode 100644 index 0000000000..7299f04339 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/metricSpecification.js @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Description of metrics specification. + * + */ +class MetricSpecification { + /** + * Create a MetricSpecification. + * @member {string} [name] The name of the metric. + * @member {string} [displayName] The display name of the metric. + * @member {string} [displayDescription] The description of the metric. + * @member {string} [unit] Units the metric to be displayed in. + * @member {string} [aggregationType] The aggregation type. + * @member {array} [availabilities] List of availability. + * @member {boolean} [enableRegionalMdmAccount] Whether regional MDM account + * enabled. + * @member {boolean} [fillGapWithZero] Whether gaps would be filled with + * zeros. + * @member {string} [metricFilterPattern] Pattern for the filter of the + * metric. + * @member {array} [dimensions] List of dimensions. + * @member {boolean} [isInternal] Whether the metric is internal. + * @member {string} [sourceMdmAccount] The source MDM account. + * @member {string} [sourceMdmNamespace] The source MDM namespace. + * @member {string} [resourceIdDimensionNameOverride] The resource Id + * dimension name override. + */ + constructor() { + } + + /** + * Defines the metadata of MetricSpecification + * + * @returns {object} metadata of MetricSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricSpecification', + type: { + name: 'Composite', + className: 'MetricSpecification', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + displayDescription: { + required: false, + serializedName: 'displayDescription', + type: { + name: 'String' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + aggregationType: { + required: false, + serializedName: 'aggregationType', + type: { + name: 'String' + } + }, + availabilities: { + required: false, + serializedName: 'availabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailabilityElementType', + type: { + name: 'Composite', + className: 'Availability' + } + } + } + }, + enableRegionalMdmAccount: { + required: false, + serializedName: 'enableRegionalMdmAccount', + type: { + name: 'Boolean' + } + }, + fillGapWithZero: { + required: false, + serializedName: 'fillGapWithZero', + type: { + name: 'Boolean' + } + }, + metricFilterPattern: { + required: false, + serializedName: 'metricFilterPattern', + type: { + name: 'String' + } + }, + dimensions: { + required: false, + serializedName: 'dimensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DimensionElementType', + type: { + name: 'Composite', + className: 'Dimension' + } + } + } + }, + isInternal: { + required: false, + serializedName: 'isInternal', + type: { + name: 'Boolean' + } + }, + sourceMdmAccount: { + required: false, + serializedName: 'sourceMdmAccount', + type: { + name: 'String' + } + }, + sourceMdmNamespace: { + required: false, + serializedName: 'sourceMdmNamespace', + type: { + name: 'String' + } + }, + resourceIdDimensionNameOverride: { + required: false, + serializedName: 'resourceIdDimensionNameOverride', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MetricSpecification; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterface.js b/lib/services/networkManagement2/lib/lib/models/networkInterface.js new file mode 100644 index 0000000000..aab3f7b4db --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterface.js @@ -0,0 +1,233 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A network interface in a resource group. + * + * @extends models['Resource'] + */ +class NetworkInterface extends models['Resource'] { + /** + * Create a NetworkInterface. + * @member {object} [virtualMachine] The reference of a virtual machine. + * @member {string} [virtualMachine.id] Resource ID. + * @member {object} [networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [networkSecurityGroup.defaultSecurityRules] The default + * security rules of network security group. + * @member {array} [networkSecurityGroup.networkInterfaces] A collection of + * references to network interfaces. + * @member {array} [networkSecurityGroup.subnets] A collection of references + * to subnets. + * @member {string} [networkSecurityGroup.resourceGuid] The resource GUID + * property of the network security group resource. + * @member {string} [networkSecurityGroup.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [networkSecurityGroup.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {array} [ipConfigurations] A list of IPConfigurations of the + * network interface. + * @member {object} [dnsSettings] The DNS settings in network interface. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses. + * Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. + * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + * only value in dnsServers collection. + * @member {array} [dnsSettings.appliedDnsServers] If the VM that uses this + * NIC is part of an Availability Set, then this list will have the union of + * all DNS servers from all NICs that are part of the Availability Set. This + * property is what is configured on each of those VMs. + * @member {string} [dnsSettings.internalDnsNameLabel] Relative DNS name for + * this NIC used for internal communications between VMs in the same virtual + * network. + * @member {string} [dnsSettings.internalFqdn] Fully qualified DNS name + * supporting internal communications between VMs in the same virtual + * network. + * @member {string} [dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating + * the VM name with the value of internalDomainNameSuffix. + * @member {string} [macAddress] The MAC address of the network interface. + * @member {boolean} [primary] Gets whether this is a primary network + * interface on a virtual machine. + * @member {boolean} [enableAcceleratedNetworking] If the network interface + * is accelerated networking enabled. + * @member {boolean} [enableIPForwarding] Indicates whether IP forwarding is + * enabled on this network interface. + * @member {string} [resourceGuid] The resource GUID property of the network + * interface resource. + * @member {string} [provisioningState] The provisioning state of the public + * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterface + * + * @returns {object} metadata of NetworkInterface + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterface', + type: { + name: 'Composite', + className: 'NetworkInterface', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtualMachine: { + required: false, + serializedName: 'properties.virtualMachine', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + networkSecurityGroup: { + required: false, + serializedName: 'properties.networkSecurityGroup', + type: { + name: 'Composite', + className: 'NetworkSecurityGroup' + } + }, + ipConfigurations: { + required: false, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceIPConfigurationElementType', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + } + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'NetworkInterfaceDnsSettings' + } + }, + macAddress: { + required: false, + serializedName: 'properties.macAddress', + type: { + name: 'String' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + enableAcceleratedNetworking: { + required: false, + serializedName: 'properties.enableAcceleratedNetworking', + type: { + name: 'Boolean' + } + }, + enableIPForwarding: { + required: false, + serializedName: 'properties.enableIPForwarding', + type: { + name: 'Boolean' + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterface; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceAssociation.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceAssociation.js new file mode 100644 index 0000000000..a867b7457c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceAssociation.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network interface and its custom security rules. + * + */ +class NetworkInterfaceAssociation { + /** + * Create a NetworkInterfaceAssociation. + * @member {string} [id] Network interface ID. + * @member {array} [securityRules] Collection of custom security rules. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkInterfaceAssociation + * + * @returns {object} metadata of NetworkInterfaceAssociation + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceAssociation', + type: { + name: 'Composite', + className: 'NetworkInterfaceAssociation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + securityRules: { + required: false, + serializedName: 'securityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceAssociation; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceDnsSettings.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceDnsSettings.js new file mode 100644 index 0000000000..eb3373a032 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceDnsSettings.js @@ -0,0 +1,109 @@ +/* + * 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'; + +/** + * DNS settings of a network interface. + * + */ +class NetworkInterfaceDnsSettings { + /** + * Create a NetworkInterfaceDnsSettings. + * @member {array} [dnsServers] List of DNS servers IP addresses. Use + * 'AzureProvidedDNS' to switch to azure provided DNS resolution. + * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + * only value in dnsServers collection. + * @member {array} [appliedDnsServers] If the VM that uses this NIC is part + * of an Availability Set, then this list will have the union of all DNS + * servers from all NICs that are part of the Availability Set. This property + * is what is configured on each of those VMs. + * @member {string} [internalDnsNameLabel] Relative DNS name for this NIC + * used for internal communications between VMs in the same virtual network. + * @member {string} [internalFqdn] Fully qualified DNS name supporting + * internal communications between VMs in the same virtual network. + * @member {string} [internalDomainNameSuffix] Even if internalDnsNameLabel + * is not specified, a DNS entry is created for the primary NIC of the VM. + * This DNS name can be constructed by concatenating the VM name with the + * value of internalDomainNameSuffix. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkInterfaceDnsSettings + * + * @returns {object} metadata of NetworkInterfaceDnsSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceDnsSettings', + type: { + name: 'Composite', + className: 'NetworkInterfaceDnsSettings', + modelProperties: { + dnsServers: { + required: false, + serializedName: 'dnsServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + appliedDnsServers: { + required: false, + serializedName: 'appliedDnsServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + internalDnsNameLabel: { + required: false, + serializedName: 'internalDnsNameLabel', + type: { + name: 'String' + } + }, + internalFqdn: { + required: false, + serializedName: 'internalFqdn', + type: { + name: 'String' + } + }, + internalDomainNameSuffix: { + required: false, + serializedName: 'internalDomainNameSuffix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceDnsSettings; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfiguration.js new file mode 100644 index 0000000000..21466e3abc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfiguration.js @@ -0,0 +1,374 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * IPConfiguration in a network interface. + * + * @extends models['SubResource'] + */ +class NetworkInterfaceIPConfiguration extends models['SubResource'] { + /** + * Create a NetworkInterfaceIPConfiguration. + * @member {array} [applicationGatewayBackendAddressPools] The reference of + * ApplicationGatewayBackendAddressPool resource. + * @member {array} [loadBalancerBackendAddressPools] The reference of + * LoadBalancerBackendAddressPool resource. + * @member {array} [loadBalancerInboundNatRules] A list of references of + * LoadBalancerInboundNatRules. + * @member {string} [privateIPAddress] Private IP address of the IP + * configuration. + * @member {string} [privateIPAllocationMethod] Defines how a private IP + * address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2016-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {object} [subnet] Subnet bound to the IP configuration. + * @member {string} [subnet.addressPrefix] The address prefix for the subnet. + * @member {object} [subnet.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [subnet.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * @member {array} [subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} [subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [subnet.networkSecurityGroup.subnets] A collection of + * references to subnets. + * @member {string} [subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} [subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [subnet.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [subnet.routeTable] The reference of the RouteTable + * resource. + * @member {array} [subnet.routeTable.routes] Collection of routes contained + * within a route table. + * @member {array} [subnet.routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} [subnet.routeTable.provisioningState] The provisioning + * state of the resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [subnet.routeTable.etag] Gets a unique read-only string + * that changes whenever the resource is updated. + * @member {array} [subnet.serviceEndpoints] An array of service endpoints. + * @member {array} [subnet.ipConfigurations] Gets an array of references to + * the network interface IP configurations using subnet. + * @member {array} [subnet.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * @member {string} [subnet.provisioningState] The provisioning state of the + * resource. + * @member {string} [subnet.name] The name of the resource that is unique + * within a resource group. This name can be used to access the resource. + * @member {string} [subnet.etag] A unique read-only string that changes + * whenever the resource is updated. + * @member {boolean} [primary] Gets whether this is a primary customer + * address on the network interface. + * @member {object} [publicIPAddress] Public IP address bound to the IP + * configuration. + * @member {object} [publicIPAddress.sku] The public IP address SKU. + * @member {string} [publicIPAddress.sku.name] Name of a public IP address + * SKU. Possible values include: 'Basic', 'Standard' + * @member {string} [publicIPAddress.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {string} [publicIPAddress.publicIPAddressVersion] The public IP + * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values + * include: 'IPv4', 'IPv6' + * @member {object} [publicIPAddress.ipConfiguration] The IP configuration + * associated with the public IP address. + * @member {string} [publicIPAddress.ipConfiguration.privateIPAddress] The + * private IP address of the IP configuration. + * @member {string} + * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP + * allocation method. Possible values are 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {object} [publicIPAddress.ipConfiguration.subnet] The reference of + * the subnet resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] + * The address prefix for the subnet. + * @member {object} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] + * A collection of security rules of the network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] + * A collection of references to network interfaces. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] + * The resource GUID property of the network security group resource. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The + * reference of the RouteTable resource. + * @member {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] + * Collection of routes contained within a route table. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection + * of references to subnets. + * @member {boolean} + * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] + * Gets a unique read-only string that changes whenever the resource is + * updated. + * @member {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] + * An array of service endpoints. + * @member {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] + * Gets an array of references to the network interface IP configurations + * using subnet. + * @member {array} + * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} + * [publicIPAddress.ipConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.name] The name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * @member {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique + * read-only string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.ipConfiguration.publicIPAddress] The + * reference of the public IP resource. + * @member {string} [publicIPAddress.ipConfiguration.provisioningState] Gets + * the provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.ipConfiguration.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * @member {string} [publicIPAddress.ipConfiguration.etag] A unique read-only + * string that changes whenever the resource is updated. + * @member {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * @member {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or + * sets the Domain name label.The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + * @member {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully + * qualified domain name of the A DNS record associated with the public IP. + * This is the concatenation of the domainNameLabel and the regionalized DNS + * zone. + * @member {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets + * the Reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, then + * a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + * @member {array} [publicIPAddress.ipTags] The list of tags associated with + * the public IP address. + * @member {string} [publicIPAddress.ipAddress] The IP address associated + * with the public IP address resource. + * @member {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout + * of the public IP address. + * @member {string} [publicIPAddress.resourceGuid] The resource GUID property + * of the public IP resource. + * @member {string} [publicIPAddress.provisioningState] The provisioning + * state of the PublicIP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [publicIPAddress.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {array} [publicIPAddress.zones] A list of availability zones + * denoting the IP allocated for the resource needs to come from. + * @member {array} [applicationSecurityGroups] Application security groups in + * which the IP configuration is included. + * @member {string} [provisioningState] The provisioning state of the network + * interface IP configuration. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterfaceIPConfiguration + * + * @returns {object} metadata of NetworkInterfaceIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceIPConfiguration', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + applicationGatewayBackendAddressPools: { + required: false, + serializedName: 'properties.applicationGatewayBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationGatewayBackendAddressPoolElementType', + type: { + name: 'Composite', + className: 'ApplicationGatewayBackendAddressPool' + } + } + } + }, + loadBalancerBackendAddressPools: { + required: false, + serializedName: 'properties.loadBalancerBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendAddressPoolElementType', + type: { + name: 'Composite', + className: 'BackendAddressPool' + } + } + } + }, + loadBalancerInboundNatRules: { + required: false, + serializedName: 'properties.loadBalancerInboundNatRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InboundNatRuleElementType', + type: { + name: 'Composite', + className: 'InboundNatRule' + } + } + } + }, + privateIPAddress: { + required: false, + serializedName: 'properties.privateIPAddress', + type: { + name: 'String' + } + }, + privateIPAllocationMethod: { + required: false, + serializedName: 'properties.privateIPAllocationMethod', + type: { + name: 'String' + } + }, + privateIPAddressVersion: { + required: false, + serializedName: 'properties.privateIPAddressVersion', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'Subnet' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'PublicIPAddress' + } + }, + applicationSecurityGroups: { + required: false, + serializedName: 'properties.applicationSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationSecurityGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroup' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceIPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfigurationListResult.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfigurationListResult.js new file mode 100644 index 0000000000..af962fd6bc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfigurationListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for list ip configurations API service call. + */ +class NetworkInterfaceIPConfigurationListResult extends Array { + /** + * Create a NetworkInterfaceIPConfigurationListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterfaceIPConfigurationListResult + * + * @returns {object} metadata of NetworkInterfaceIPConfigurationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceIPConfigurationListResult', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfigurationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceIPConfigurationElementType', + type: { + name: 'Composite', + className: 'NetworkInterfaceIPConfiguration' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceIPConfigurationListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceListResult.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceListResult.js new file mode 100644 index 0000000000..125b569ac8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for the ListNetworkInterface API service call. + */ +class NetworkInterfaceListResult extends Array { + /** + * Create a NetworkInterfaceListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterfaceListResult + * + * @returns {object} metadata of NetworkInterfaceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceListResult', + type: { + name: 'Composite', + className: 'NetworkInterfaceListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceElementType', + type: { + name: 'Composite', + className: 'NetworkInterface' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/networkInterfaceLoadBalancerListResult.js b/lib/services/networkManagement2/lib/lib/models/networkInterfaceLoadBalancerListResult.js new file mode 100644 index 0000000000..c4ff846d5c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkInterfaceLoadBalancerListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for list ip configurations API service call. + */ +class NetworkInterfaceLoadBalancerListResult extends Array { + /** + * Create a NetworkInterfaceLoadBalancerListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterfaceLoadBalancerListResult + * + * @returns {object} metadata of NetworkInterfaceLoadBalancerListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceLoadBalancerListResult', + type: { + name: 'Composite', + className: 'NetworkInterfaceLoadBalancerListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancerElementType', + type: { + name: 'Composite', + className: 'LoadBalancer' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceLoadBalancerListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/networkSecurityGroup.js b/lib/services/networkManagement2/lib/lib/models/networkSecurityGroup.js new file mode 100644 index 0000000000..9a486a39ab --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkSecurityGroup.js @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * NetworkSecurityGroup resource. + * + * @extends models['Resource'] + */ +class NetworkSecurityGroup extends models['Resource'] { + /** + * Create a NetworkSecurityGroup. + * @member {array} [securityRules] A collection of security rules of the + * network security group. + * @member {array} [defaultSecurityRules] The default security rules of + * network security group. + * @member {array} [networkInterfaces] A collection of references to network + * interfaces. + * @member {array} [subnets] A collection of references to subnets. + * @member {string} [resourceGuid] The resource GUID property of the network + * security group resource. + * @member {string} [provisioningState] The provisioning state of the public + * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkSecurityGroup + * + * @returns {object} metadata of NetworkSecurityGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkSecurityGroup', + type: { + name: 'Composite', + className: 'NetworkSecurityGroup', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + securityRules: { + required: false, + serializedName: 'properties.securityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + }, + defaultSecurityRules: { + required: false, + serializedName: 'properties.defaultSecurityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + }, + networkInterfaces: { + required: false, + readOnly: true, + serializedName: 'properties.networkInterfaces', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceElementType', + type: { + name: 'Composite', + className: 'NetworkInterface' + } + } + } + }, + subnets: { + required: false, + readOnly: true, + serializedName: 'properties.subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubnetElementType', + type: { + name: 'Composite', + className: 'Subnet' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/lib/models/networkSecurityGroupListResult.js b/lib/services/networkManagement2/lib/lib/models/networkSecurityGroupListResult.js new file mode 100644 index 0000000000..abf75b6d9d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkSecurityGroupListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ListNetworkSecurityGroups API service call. + */ +class NetworkSecurityGroupListResult extends Array { + /** + * Create a NetworkSecurityGroupListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkSecurityGroupListResult + * + * @returns {object} metadata of NetworkSecurityGroupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkSecurityGroupListResult', + type: { + name: 'Composite', + className: 'NetworkSecurityGroupListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkSecurityGroupElementType', + type: { + name: 'Composite', + className: 'NetworkSecurityGroup' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/networkWatcher.js b/lib/services/networkManagement2/lib/lib/models/networkWatcher.js new file mode 100644 index 0000000000..2d392cef39 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkWatcher.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network watcher in a resource group. + * + * @extends models['Resource'] + */ +class NetworkWatcher extends models['Resource'] { + /** + * Create a NetworkWatcher. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkWatcher + * + * @returns {object} metadata of NetworkWatcher + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkWatcher', + type: { + name: 'Composite', + className: 'NetworkWatcher', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkWatcher; diff --git a/lib/services/networkManagement2/lib/lib/models/networkWatcherListResult.js b/lib/services/networkManagement2/lib/lib/models/networkWatcherListResult.js new file mode 100644 index 0000000000..61b6321fc3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/networkWatcherListResult.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * List of network watcher resources. + */ +class NetworkWatcherListResult extends Array { + /** + * Create a NetworkWatcherListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkWatcherListResult + * + * @returns {object} metadata of NetworkWatcherListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkWatcherListResult', + type: { + name: 'Composite', + className: 'NetworkWatcherListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkWatcherElementType', + type: { + name: 'Composite', + className: 'NetworkWatcher' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkWatcherListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/nextHopParameters.js b/lib/services/networkManagement2/lib/lib/models/nextHopParameters.js new file mode 100644 index 0000000000..490154bbbb --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/nextHopParameters.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Parameters that define the source and destination endpoint. + * + */ +class NextHopParameters { + /** + * Create a NextHopParameters. + * @member {string} targetResourceId The resource identifier of the target + * resource against which the action is to be performed. + * @member {string} sourceIPAddress The source IP address. + * @member {string} destinationIPAddress The destination IP address. + * @member {string} [targetNicResourceId] The NIC ID. (If VM has multiple + * NICs and IP forwarding is enabled on any of the nics, then this parameter + * must be specified. Otherwise optional). + */ + constructor() { + } + + /** + * Defines the metadata of NextHopParameters + * + * @returns {object} metadata of NextHopParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'NextHopParameters', + type: { + name: 'Composite', + className: 'NextHopParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + }, + sourceIPAddress: { + required: true, + serializedName: 'sourceIPAddress', + type: { + name: 'String' + } + }, + destinationIPAddress: { + required: true, + serializedName: 'destinationIPAddress', + type: { + name: 'String' + } + }, + targetNicResourceId: { + required: false, + serializedName: 'targetNicResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NextHopParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/nextHopResult.js b/lib/services/networkManagement2/lib/lib/models/nextHopResult.js new file mode 100644 index 0000000000..e6717174e8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/nextHopResult.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * The information about next hop from the specified VM. + * + */ +class NextHopResult { + /** + * Create a NextHopResult. + * @member {string} [nextHopType] Next hop type. Possible values include: + * 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + * 'HyperNetGateway', 'None' + * @member {string} [nextHopIpAddress] Next hop IP Address + * @member {string} [routeTableId] The resource identifier for the route + * table associated with the route being returned. If the route being + * returned does not correspond to any user created routes then this field + * will be the string 'System Route'. + */ + constructor() { + } + + /** + * Defines the metadata of NextHopResult + * + * @returns {object} metadata of NextHopResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NextHopResult', + type: { + name: 'Composite', + className: 'NextHopResult', + modelProperties: { + nextHopType: { + required: false, + serializedName: 'nextHopType', + type: { + name: 'String' + } + }, + nextHopIpAddress: { + required: false, + serializedName: 'nextHopIpAddress', + type: { + name: 'String' + } + }, + routeTableId: { + required: false, + serializedName: 'routeTableId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NextHopResult; diff --git a/lib/services/networkManagement2/lib/lib/models/operation.js b/lib/services/networkManagement2/lib/lib/models/operation.js new file mode 100644 index 0000000000..61fb880599 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/operation.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network REST API operation definition. + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] Display metadata associated with the operation. + * @member {string} [display.provider] Service provider: Microsoft Network. + * @member {string} [display.resource] Resource on which the operation is + * performed. + * @member {string} [display.operation] Type of the operation: get, read, + * delete, etc. + * @member {string} [display.description] Description of the operation. + * @member {string} [origin] Origin of the operation. + * @member {object} [serviceSpecification] Specification of the service. + * @member {array} [serviceSpecification.metricSpecifications] Operation + * service specification. + * @member {array} [serviceSpecification.logSpecifications] Operation log + * specification. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + }, + origin: { + required: false, + serializedName: 'origin', + type: { + name: 'String' + } + }, + serviceSpecification: { + required: false, + serializedName: 'properties.serviceSpecification', + type: { + name: 'Composite', + className: 'OperationPropertiesFormatServiceSpecification' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/networkManagement2/lib/lib/models/operationDisplay.js b/lib/services/networkManagement2/lib/lib/models/operationDisplay.js new file mode 100644 index 0000000000..da0bff9211 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/operationDisplay.js @@ -0,0 +1,77 @@ +/* + * 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'; + +/** + * Display metadata associated with the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft Network. + * @member {string} [resource] Resource on which the operation is performed. + * @member {string} [operation] Type of the operation: get, read, delete, + * etc. + * @member {string} [description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/networkManagement2/lib/lib/models/operationListResult.js b/lib/services/networkManagement2/lib/lib/models/operationListResult.js new file mode 100644 index 0000000000..cdcc6ce3c6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/operationListResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of the request to list Network operations. It contains a list of + * operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/operationPropertiesFormatServiceSpecification.js b/lib/services/networkManagement2/lib/lib/models/operationPropertiesFormatServiceSpecification.js new file mode 100644 index 0000000000..74aec12973 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/operationPropertiesFormatServiceSpecification.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specification of the service. + * + */ +class OperationPropertiesFormatServiceSpecification { + /** + * Create a OperationPropertiesFormatServiceSpecification. + * @member {array} [metricSpecifications] Operation service specification. + * @member {array} [logSpecifications] Operation log specification. + */ + constructor() { + } + + /** + * Defines the metadata of OperationPropertiesFormatServiceSpecification + * + * @returns {object} metadata of OperationPropertiesFormatServiceSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationPropertiesFormat_serviceSpecification', + type: { + name: 'Composite', + className: 'OperationPropertiesFormatServiceSpecification', + modelProperties: { + metricSpecifications: { + required: false, + serializedName: 'metricSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricSpecificationElementType', + type: { + name: 'Composite', + className: 'MetricSpecification' + } + } + } + }, + logSpecifications: { + required: false, + serializedName: 'logSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LogSpecificationElementType', + type: { + name: 'Composite', + className: 'LogSpecification' + } + } + } + } + } + } + }; + } +} + +module.exports = OperationPropertiesFormatServiceSpecification; diff --git a/lib/services/networkManagement2/lib/lib/models/outboundNatRule.js b/lib/services/networkManagement2/lib/lib/models/outboundNatRule.js new file mode 100644 index 0000000000..33e85d3a09 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/outboundNatRule.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Outbound NAT pool of the load balancer. + * + * @extends models['SubResource'] + */ +class OutboundNatRule extends models['SubResource'] { + /** + * Create a OutboundNatRule. + * @member {number} [allocatedOutboundPorts] The number of outbound ports to + * be used for NAT. + * @member {array} [frontendIPConfigurations] The Frontend IP addresses of + * the load balancer. + * @member {object} backendAddressPool A reference to a pool of DIPs. + * Outbound traffic is randomly load balanced across IPs in the backend IPs. + * @member {string} [backendAddressPool.id] Resource ID. + * @member {string} [provisioningState] Gets the provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OutboundNatRule + * + * @returns {object} metadata of OutboundNatRule + * + */ + mapper() { + return { + required: false, + serializedName: 'OutboundNatRule', + type: { + name: 'Composite', + className: 'OutboundNatRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + allocatedOutboundPorts: { + required: false, + serializedName: 'properties.allocatedOutboundPorts', + type: { + name: 'Number' + } + }, + frontendIPConfigurations: { + required: false, + serializedName: 'properties.frontendIPConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + backendAddressPool: { + required: true, + serializedName: 'properties.backendAddressPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OutboundNatRule; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCapture.js b/lib/services/networkManagement2/lib/lib/models/packetCapture.js new file mode 100644 index 0000000000..3723749592 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCapture.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the create packet capture operation. + * + */ +class PacketCapture { + /** + * Create a PacketCapture. + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture + * output. Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage + * ID is provided, otherwise optional. + * @member {array} [filters] + */ + constructor() { + } + + /** + * Defines the metadata of PacketCapture + * + * @returns {object} metadata of PacketCapture + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCapture', + type: { + name: 'Composite', + className: 'PacketCapture', + modelProperties: { + target: { + required: true, + serializedName: 'properties.target', + type: { + name: 'String' + } + }, + bytesToCapturePerPacket: { + required: false, + serializedName: 'properties.bytesToCapturePerPacket', + defaultValue: 0, + type: { + name: 'Number' + } + }, + totalBytesPerSession: { + required: false, + serializedName: 'properties.totalBytesPerSession', + defaultValue: 1073741824, + type: { + name: 'Number' + } + }, + timeLimitInSeconds: { + required: false, + serializedName: 'properties.timeLimitInSeconds', + defaultValue: 18000, + type: { + name: 'Number' + } + }, + storageLocation: { + required: true, + serializedName: 'properties.storageLocation', + type: { + name: 'Composite', + className: 'PacketCaptureStorageLocation' + } + }, + filters: { + required: false, + serializedName: 'properties.filters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PacketCaptureFilterElementType', + type: { + name: 'Composite', + className: 'PacketCaptureFilter' + } + } + } + } + } + } + }; + } +} + +module.exports = PacketCapture; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureFilter.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureFilter.js new file mode 100644 index 0000000000..fd13922bb6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureFilter.js @@ -0,0 +1,101 @@ +/* + * 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'; + +/** + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + * + */ +class PacketCaptureFilter { + /** + * Create a PacketCaptureFilter. + * @member {string} [protocol] Protocol to be filtered on. Possible values + * include: 'TCP', 'UDP', 'Any'. Default value: 'Any' . + * @member {string} [localIPAddress] Local IP Address to be filtered on. + * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" + * for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not currently + * supported. Default = null. + * @member {string} [remoteIPAddress] Local IP Address to be filtered on. + * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" + * for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not currently + * supported. Default = null. + * @member {string} [localPort] Local port to be filtered on. Notation: "80" + * for single port entry."80-85" for range. "80;443;" for multiple entries. + * Multiple ranges not currently supported. Mixing ranges with multiple + * entries not currently supported. Default = null. + * @member {string} [remotePort] Remote port to be filtered on. Notation: + * "80" for single port entry."80-85" for range. "80;443;" for multiple + * entries. Multiple ranges not currently supported. Mixing ranges with + * multiple entries not currently supported. Default = null. + */ + constructor() { + } + + /** + * Defines the metadata of PacketCaptureFilter + * + * @returns {object} metadata of PacketCaptureFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureFilter', + type: { + name: 'Composite', + className: 'PacketCaptureFilter', + modelProperties: { + protocol: { + required: false, + serializedName: 'protocol', + defaultValue: 'Any', + type: { + name: 'String' + } + }, + localIPAddress: { + required: false, + serializedName: 'localIPAddress', + type: { + name: 'String' + } + }, + remoteIPAddress: { + required: false, + serializedName: 'remoteIPAddress', + type: { + name: 'String' + } + }, + localPort: { + required: false, + serializedName: 'localPort', + type: { + name: 'String' + } + }, + remotePort: { + required: false, + serializedName: 'remotePort', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PacketCaptureFilter; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureListResult.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureListResult.js new file mode 100644 index 0000000000..83e0404f31 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureListResult.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * List of packet capture sessions. + */ +class PacketCaptureListResult extends Array { + /** + * Create a PacketCaptureListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PacketCaptureListResult + * + * @returns {object} metadata of PacketCaptureListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureListResult', + type: { + name: 'Composite', + className: 'PacketCaptureListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PacketCaptureResultElementType', + type: { + name: 'Composite', + className: 'PacketCaptureResult' + } + } + } + } + } + } + }; + } +} + +module.exports = PacketCaptureListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureParameters.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureParameters.js new file mode 100644 index 0000000000..01c24e2b0f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureParameters.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the create packet capture operation. + * + */ +class PacketCaptureParameters { + /** + * Create a PacketCaptureParameters. + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture + * output. Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage + * ID is provided, otherwise optional. + * @member {array} [filters] + */ + constructor() { + } + + /** + * Defines the metadata of PacketCaptureParameters + * + * @returns {object} metadata of PacketCaptureParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureParameters', + type: { + name: 'Composite', + className: 'PacketCaptureParameters', + modelProperties: { + target: { + required: true, + serializedName: 'target', + type: { + name: 'String' + } + }, + bytesToCapturePerPacket: { + required: false, + serializedName: 'bytesToCapturePerPacket', + defaultValue: 0, + type: { + name: 'Number' + } + }, + totalBytesPerSession: { + required: false, + serializedName: 'totalBytesPerSession', + defaultValue: 1073741824, + type: { + name: 'Number' + } + }, + timeLimitInSeconds: { + required: false, + serializedName: 'timeLimitInSeconds', + defaultValue: 18000, + type: { + name: 'Number' + } + }, + storageLocation: { + required: true, + serializedName: 'storageLocation', + type: { + name: 'Composite', + className: 'PacketCaptureStorageLocation' + } + }, + filters: { + required: false, + serializedName: 'filters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PacketCaptureFilterElementType', + type: { + name: 'Composite', + className: 'PacketCaptureFilter' + } + } + } + } + } + } + }; + } +} + +module.exports = PacketCaptureParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureQueryStatusResult.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureQueryStatusResult.js new file mode 100644 index 0000000000..e504224120 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureQueryStatusResult.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Status of packet capture session. + * + */ +class PacketCaptureQueryStatusResult { + /** + * Create a PacketCaptureQueryStatusResult. + * @member {string} [name] The name of the packet capture resource. + * @member {string} [id] The ID of the packet capture resource. + * @member {date} [captureStartTime] The start time of the packet capture + * session. + * @member {string} [packetCaptureStatus] The status of the packet capture + * session. Possible values include: 'NotStarted', 'Running', 'Stopped', + * 'Error', 'Unknown' + * @member {string} [stopReason] The reason the current packet capture + * session was stopped. + * @member {array} [packetCaptureError] List of errors of packet capture + * session. + */ + constructor() { + } + + /** + * Defines the metadata of PacketCaptureQueryStatusResult + * + * @returns {object} metadata of PacketCaptureQueryStatusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureQueryStatusResult', + type: { + name: 'Composite', + className: 'PacketCaptureQueryStatusResult', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + captureStartTime: { + required: false, + serializedName: 'captureStartTime', + type: { + name: 'DateTime' + } + }, + packetCaptureStatus: { + required: false, + serializedName: 'packetCaptureStatus', + type: { + name: 'String' + } + }, + stopReason: { + required: false, + serializedName: 'stopReason', + type: { + name: 'String' + } + }, + packetCaptureError: { + required: false, + serializedName: 'packetCaptureError', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = PacketCaptureQueryStatusResult; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureResult.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureResult.js new file mode 100644 index 0000000000..a4ecc1549f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureResult.js @@ -0,0 +1,158 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information about packet capture session. + * + */ +class PacketCaptureResult { + /** + * Create a PacketCaptureResult. + * @member {string} [name] Name of the packet capture session. + * @member {string} [id] ID of the packet capture operation. + * @member {string} [etag] Default value: 'A unique read-only string that + * changes whenever the resource is updated.' . + * @member {string} target The ID of the targeted resource, only VM is + * currently supported. + * @member {number} [bytesToCapturePerPacket] Number of bytes captured per + * packet, the remaining bytes are truncated. Default value: 0 . + * @member {number} [totalBytesPerSession] Maximum size of the capture + * output. Default value: 1073741824 . + * @member {number} [timeLimitInSeconds] Maximum duration of the capture + * session in seconds. Default value: 18000 . + * @member {object} storageLocation + * @member {string} [storageLocation.storageId] The ID of the storage account + * to save the packet capture session. Required if no local file path is + * provided. + * @member {string} [storageLocation.storagePath] The URI of the storage path + * to save the packet capture. Must be a well-formed URI describing the + * location to save the packet capture. + * @member {string} [storageLocation.filePath] A valid local path on the + * targeting VM. Must include the name of the capture file (*.cap). For linux + * virtual machine it must start with /var/captures. Required if no storage + * ID is provided, otherwise optional. + * @member {array} [filters] + * @member {string} [provisioningState] The provisioning state of the packet + * capture session. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of PacketCaptureResult + * + * @returns {object} metadata of PacketCaptureResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureResult', + type: { + name: 'Composite', + className: 'PacketCaptureResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + defaultValue: 'A unique read-only string that changes whenever the resource is updated.', + type: { + name: 'String' + } + }, + target: { + required: true, + serializedName: 'properties.target', + type: { + name: 'String' + } + }, + bytesToCapturePerPacket: { + required: false, + serializedName: 'properties.bytesToCapturePerPacket', + defaultValue: 0, + type: { + name: 'Number' + } + }, + totalBytesPerSession: { + required: false, + serializedName: 'properties.totalBytesPerSession', + defaultValue: 1073741824, + type: { + name: 'Number' + } + }, + timeLimitInSeconds: { + required: false, + serializedName: 'properties.timeLimitInSeconds', + defaultValue: 18000, + type: { + name: 'Number' + } + }, + storageLocation: { + required: true, + serializedName: 'properties.storageLocation', + type: { + name: 'Composite', + className: 'PacketCaptureStorageLocation' + } + }, + filters: { + required: false, + serializedName: 'properties.filters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PacketCaptureFilterElementType', + type: { + name: 'Composite', + className: 'PacketCaptureFilter' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PacketCaptureResult; diff --git a/lib/services/networkManagement2/lib/lib/models/packetCaptureStorageLocation.js b/lib/services/networkManagement2/lib/lib/models/packetCaptureStorageLocation.js new file mode 100644 index 0000000000..1661120018 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/packetCaptureStorageLocation.js @@ -0,0 +1,74 @@ +/* + * 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'; + +/** + * Describes the storage location for a packet capture session. + * + */ +class PacketCaptureStorageLocation { + /** + * Create a PacketCaptureStorageLocation. + * @member {string} [storageId] The ID of the storage account to save the + * packet capture session. Required if no local file path is provided. + * @member {string} [storagePath] The URI of the storage path to save the + * packet capture. Must be a well-formed URI describing the location to save + * the packet capture. + * @member {string} [filePath] A valid local path on the targeting VM. Must + * include the name of the capture file (*.cap). For linux virtual machine it + * must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + */ + constructor() { + } + + /** + * Defines the metadata of PacketCaptureStorageLocation + * + * @returns {object} metadata of PacketCaptureStorageLocation + * + */ + mapper() { + return { + required: false, + serializedName: 'PacketCaptureStorageLocation', + type: { + name: 'Composite', + className: 'PacketCaptureStorageLocation', + modelProperties: { + storageId: { + required: false, + serializedName: 'storageId', + type: { + name: 'String' + } + }, + storagePath: { + required: false, + serializedName: 'storagePath', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'filePath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PacketCaptureStorageLocation; diff --git a/lib/services/networkManagement2/lib/lib/models/patchRouteFilter.js b/lib/services/networkManagement2/lib/lib/models/patchRouteFilter.js new file mode 100644 index 0000000000..4765da6f2b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/patchRouteFilter.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route Filter Resource. + * + * @extends models['SubResource'] + */ +class PatchRouteFilter extends models['SubResource'] { + /** + * Create a PatchRouteFilter. + * @member {array} [rules] Collection of RouteFilterRules contained within a + * route filter. + * @member {array} [peerings] A collection of references to express route + * circuit peerings. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {string} [type] Resource type. + * @member {object} [tags] Resource tags. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PatchRouteFilter + * + * @returns {object} metadata of PatchRouteFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'PatchRouteFilter', + type: { + name: 'Composite', + className: 'PatchRouteFilter', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + rules: { + required: false, + serializedName: 'properties.rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteFilterRuleElementType', + type: { + name: 'Composite', + className: 'RouteFilterRule' + } + } + } + }, + peerings: { + required: false, + serializedName: 'properties.peerings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeering' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = PatchRouteFilter; diff --git a/lib/services/networkManagement2/lib/lib/models/patchRouteFilterRule.js b/lib/services/networkManagement2/lib/lib/models/patchRouteFilterRule.js new file mode 100644 index 0000000000..2a576e68a4 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/patchRouteFilterRule.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route Filter Rule Resource + * + * @extends models['SubResource'] + */ +class PatchRouteFilterRule extends models['SubResource'] { + /** + * Create a PatchRouteFilterRule. + * @member {string} access The access type of the rule. Valid values are: + * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} communities The collection for bgp community values to + * filter on. e.g. ['12076:5010','12076:5020'] + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PatchRouteFilterRule + * + * @returns {object} metadata of PatchRouteFilterRule + * + */ + mapper() { + return { + required: false, + serializedName: 'PatchRouteFilterRule', + type: { + name: 'Composite', + className: 'PatchRouteFilterRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + access: { + required: true, + serializedName: 'properties.access', + type: { + name: 'String' + } + }, + routeFilterRuleType: { + required: true, + isConstant: true, + serializedName: 'properties.routeFilterRuleType', + defaultValue: 'Community', + type: { + name: 'String' + } + }, + communities: { + required: true, + serializedName: 'properties.communities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PatchRouteFilterRule; diff --git a/lib/services/networkManagement2/lib/lib/models/probe.js b/lib/services/networkManagement2/lib/lib/models/probe.js new file mode 100644 index 0000000000..667f984b64 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/probe.js @@ -0,0 +1,155 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A load balancer probe. + * + * @extends models['SubResource'] + */ +class Probe extends models['SubResource'] { + /** + * Create a Probe. + * @member {array} [loadBalancingRules] The load balancer rules that use this + * probe. + * @member {string} protocol The protocol of the end point. Possible values + * are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + * for the probe to be successful. If 'Http' is specified, a 200 OK response + * from the specifies URI is required for the probe to be successful. + * Possible values include: 'Http', 'Tcp' + * @member {number} port The port for communicating the probe. Possible + * values range from 1 to 65535, inclusive. + * @member {number} [intervalInSeconds] The interval, in seconds, for how + * frequently to probe the endpoint for health status. Typically, the + * interval is slightly less than half the allocated timeout period (in + * seconds) which allows two full probes before taking the instance out of + * rotation. The default value is 15, the minimum value is 5. + * @member {number} [numberOfProbes] The number of probes where if no + * response, will result in stopping further traffic from being delivered to + * the endpoint. This values allows endpoints to be taken out of rotation + * faster or slower than the typical times used in Azure. + * @member {string} [requestPath] The URI used for requesting health status + * from the VM. Path is required if a protocol is set to http. Otherwise, it + * is not allowed. There is no default value. + * @member {string} [provisioningState] Gets the provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Probe + * + * @returns {object} metadata of Probe + * + */ + mapper() { + return { + required: false, + serializedName: 'Probe', + type: { + name: 'Composite', + className: 'Probe', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + loadBalancingRules: { + required: false, + readOnly: true, + serializedName: 'properties.loadBalancingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + protocol: { + required: true, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + intervalInSeconds: { + required: false, + serializedName: 'properties.intervalInSeconds', + type: { + name: 'Number' + } + }, + numberOfProbes: { + required: false, + serializedName: 'properties.numberOfProbes', + type: { + name: 'Number' + } + }, + requestPath: { + required: false, + serializedName: 'properties.requestPath', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Probe; diff --git a/lib/services/networkManagement2/lib/lib/models/publicIPAddress.js b/lib/services/networkManagement2/lib/lib/models/publicIPAddress.js new file mode 100644 index 0000000000..343142c9ae --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/publicIPAddress.js @@ -0,0 +1,305 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Public IP address resource. + * + * @extends models['Resource'] + */ +class PublicIPAddress extends models['Resource'] { + /** + * Create a PublicIPAddress. + * @member {object} [sku] The public IP address SKU. + * @member {string} [sku.name] Name of a public IP address SKU. Possible + * values include: 'Basic', 'Standard' + * @member {string} [publicIPAllocationMethod] The public IP allocation + * method. Possible values are: 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {string} [publicIPAddressVersion] The public IP address version. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6' + * @member {object} [ipConfiguration] The IP configuration associated with + * the public IP address. + * @member {string} [ipConfiguration.privateIPAddress] The private IP address + * of the IP configuration. + * @member {string} [ipConfiguration.privateIPAllocationMethod] The private + * IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * @member {object} [ipConfiguration.subnet] The reference of the subnet + * resource. + * @member {string} [ipConfiguration.subnet.addressPrefix] The address prefix + * for the subnet. + * @member {object} [ipConfiguration.subnet.networkSecurityGroup] The + * reference of the NetworkSecurityGroup resource. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * @member {array} + * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A + * collection of references to network interfaces. + * @member {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A + * collection of references to subnets. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * @member {string} + * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A + * unique read-only string that changes whenever the resource is updated. + * @member {object} [ipConfiguration.subnet.routeTable] The reference of the + * RouteTable resource. + * @member {array} [ipConfiguration.subnet.routeTable.routes] Collection of + * routes contained within a route table. + * @member {array} [ipConfiguration.subnet.routeTable.subnets] A collection + * of references to subnets. + * @member {boolean} + * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or + * sets whether to disable the routes learned by BGP on that route table. + * True means disable. + * @member {string} [ipConfiguration.subnet.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * @member {array} [ipConfiguration.subnet.serviceEndpoints] An array of + * service endpoints. + * @member {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of + * references to the network interface IP configurations using subnet. + * @member {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an + * array of references to the external resources using subnet. + * @member {string} [ipConfiguration.subnet.provisioningState] The + * provisioning state of the resource. + * @member {string} [ipConfiguration.subnet.name] The name of the resource + * that is unique within a resource group. This name can be used to access + * the resource. + * @member {string} [ipConfiguration.subnet.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {object} [ipConfiguration.publicIPAddress] The reference of the + * public IP resource. + * @member {string} [ipConfiguration.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [ipConfiguration.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * @member {string} [ipConfiguration.etag] A unique read-only string that + * changes whenever the resource is updated. + * @member {object} [dnsSettings] The FQDN of the DNS record associated with + * the public IP address. + * @member {string} [dnsSettings.domainNameLabel] Gets or sets the Domain + * name label.The concatenation of the domain name label and the regionalized + * DNS zone make up the fully qualified domain name associated with the + * public IP address. If a domain name label is specified, an A DNS record is + * created for the public IP in the Microsoft Azure DNS system. + * @member {string} [dnsSettings.fqdn] Gets the FQDN, Fully qualified domain + * name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * @member {string} [dnsSettings.reverseFqdn] Gets or Sets the Reverse FQDN. + * A user-visible, fully qualified domain name that resolves to this public + * IP address. If the reverseFqdn is specified, then a PTR DNS record is + * created pointing from the IP address in the in-addr.arpa domain to the + * reverse FQDN. + * @member {array} [ipTags] The list of tags associated with the public IP + * address. + * @member {string} [ipAddress] The IP address associated with the public IP + * address resource. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {string} [resourceGuid] The resource GUID property of the public + * IP resource. + * @member {string} [provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + * @member {array} [zones] A list of availability zones denoting the IP + * allocated for the resource needs to come from. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PublicIPAddress + * + * @returns {object} metadata of PublicIPAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicIPAddress', + type: { + name: 'Composite', + className: 'PublicIPAddress', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'PublicIPAddressSku' + } + }, + publicIPAllocationMethod: { + required: false, + serializedName: 'properties.publicIPAllocationMethod', + type: { + name: 'String' + } + }, + publicIPAddressVersion: { + required: false, + serializedName: 'properties.publicIPAddressVersion', + type: { + name: 'String' + } + }, + ipConfiguration: { + required: false, + readOnly: true, + serializedName: 'properties.ipConfiguration', + type: { + name: 'Composite', + className: 'IPConfiguration' + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'PublicIPAddressDnsSettings' + } + }, + ipTags: { + required: false, + serializedName: 'properties.ipTags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpTagElementType', + type: { + name: 'Composite', + className: 'IpTag' + } + } + } + }, + ipAddress: { + required: false, + serializedName: 'properties.ipAddress', + type: { + name: 'String' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = PublicIPAddress; diff --git a/lib/services/networkManagement2/lib/lib/models/publicIPAddressDnsSettings.js b/lib/services/networkManagement2/lib/lib/models/publicIPAddressDnsSettings.js new file mode 100644 index 0000000000..1381dca87a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/publicIPAddressDnsSettings.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Contains FQDN of the DNS record associated with the public IP address + * + */ +class PublicIPAddressDnsSettings { + /** + * Create a PublicIPAddressDnsSettings. + * @member {string} [domainNameLabel] Gets or sets the Domain name label.The + * concatenation of the domain name label and the regionalized DNS zone make + * up the fully qualified domain name associated with the public IP address. + * If a domain name label is specified, an A DNS record is created for the + * public IP in the Microsoft Azure DNS system. + * @member {string} [fqdn] Gets the FQDN, Fully qualified domain name of the + * A DNS record associated with the public IP. This is the concatenation of + * the domainNameLabel and the regionalized DNS zone. + * @member {string} [reverseFqdn] Gets or Sets the Reverse FQDN. A + * user-visible, fully qualified domain name that resolves to this public IP + * address. If the reverseFqdn is specified, then a PTR DNS record is created + * pointing from the IP address in the in-addr.arpa domain to the reverse + * FQDN. + */ + constructor() { + } + + /** + * Defines the metadata of PublicIPAddressDnsSettings + * + * @returns {object} metadata of PublicIPAddressDnsSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicIPAddressDnsSettings', + type: { + name: 'Composite', + className: 'PublicIPAddressDnsSettings', + modelProperties: { + domainNameLabel: { + required: false, + serializedName: 'domainNameLabel', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + serializedName: 'fqdn', + type: { + name: 'String' + } + }, + reverseFqdn: { + required: false, + serializedName: 'reverseFqdn', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PublicIPAddressDnsSettings; diff --git a/lib/services/networkManagement2/lib/lib/models/publicIPAddressListResult.js b/lib/services/networkManagement2/lib/lib/models/publicIPAddressListResult.js new file mode 100644 index 0000000000..5545b55f0b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/publicIPAddressListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ListPublicIpAddresses API service call. + */ +class PublicIPAddressListResult extends Array { + /** + * Create a PublicIPAddressListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PublicIPAddressListResult + * + * @returns {object} metadata of PublicIPAddressListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicIPAddressListResult', + type: { + name: 'Composite', + className: 'PublicIPAddressListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PublicIPAddressElementType', + type: { + name: 'Composite', + className: 'PublicIPAddress' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PublicIPAddressListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/publicIPAddressSku.js b/lib/services/networkManagement2/lib/lib/models/publicIPAddressSku.js new file mode 100644 index 0000000000..c3198b0439 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/publicIPAddressSku.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * SKU of a public IP address + * + */ +class PublicIPAddressSku { + /** + * Create a PublicIPAddressSku. + * @member {string} [name] Name of a public IP address SKU. Possible values + * include: 'Basic', 'Standard' + */ + constructor() { + } + + /** + * Defines the metadata of PublicIPAddressSku + * + * @returns {object} metadata of PublicIPAddressSku + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicIPAddressSku', + type: { + name: 'Composite', + className: 'PublicIPAddressSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PublicIPAddressSku; diff --git a/lib/services/networkManagement2/lib/lib/models/queryTroubleshootingParameters.js b/lib/services/networkManagement2/lib/lib/models/queryTroubleshootingParameters.js new file mode 100644 index 0000000000..ffca4c1894 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/queryTroubleshootingParameters.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * Parameters that define the resource to query the troubleshooting result. + * + */ +class QueryTroubleshootingParameters { + /** + * Create a QueryTroubleshootingParameters. + * @member {string} targetResourceId The target resource ID to query the + * troubleshooting result. + */ + constructor() { + } + + /** + * Defines the metadata of QueryTroubleshootingParameters + * + * @returns {object} metadata of QueryTroubleshootingParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'QueryTroubleshootingParameters', + type: { + name: 'Composite', + className: 'QueryTroubleshootingParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = QueryTroubleshootingParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/resource.js b/lib/services/networkManagement2/lib/lib/models/resource.js new file mode 100644 index 0000000000..cbf0836276 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/resource.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Common resource representation. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/networkManagement2/lib/lib/models/resourceNavigationLink.js b/lib/services/networkManagement2/lib/lib/models/resourceNavigationLink.js new file mode 100644 index 0000000000..998fc4a73e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/resourceNavigationLink.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ResourceNavigationLink resource. + * + * @extends models['SubResource'] + */ +class ResourceNavigationLink extends models['SubResource'] { + /** + * Create a ResourceNavigationLink. + * @member {string} [linkedResourceType] Resource type of the linked + * resource. + * @member {string} [link] Link to the external resource + * @member {string} [provisioningState] Provisioning state of the + * ResourceNavigationLink resource. + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceNavigationLink + * + * @returns {object} metadata of ResourceNavigationLink + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceNavigationLink', + type: { + name: 'Composite', + className: 'ResourceNavigationLink', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + linkedResourceType: { + required: false, + serializedName: 'properties.linkedResourceType', + type: { + name: 'String' + } + }, + link: { + required: false, + serializedName: 'properties.link', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceNavigationLink; diff --git a/lib/services/networkManagement2/lib/lib/models/retentionPolicyParameters.js b/lib/services/networkManagement2/lib/lib/models/retentionPolicyParameters.js new file mode 100644 index 0000000000..85a9101d3b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/retentionPolicyParameters.js @@ -0,0 +1,64 @@ +/* + * 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'; + +/** + * Parameters that define the retention policy for flow log. + * + */ +class RetentionPolicyParameters { + /** + * Create a RetentionPolicyParameters. + * @member {number} [days] Number of days to retain flow log records. Default + * value: 0 . + * @member {boolean} [enabled] Flag to enable/disable retention. Default + * value: false . + */ + constructor() { + } + + /** + * Defines the metadata of RetentionPolicyParameters + * + * @returns {object} metadata of RetentionPolicyParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RetentionPolicyParameters', + type: { + name: 'Composite', + className: 'RetentionPolicyParameters', + modelProperties: { + days: { + required: false, + serializedName: 'days', + defaultValue: 0, + type: { + name: 'Number' + } + }, + enabled: { + required: false, + serializedName: 'enabled', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = RetentionPolicyParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/route.js b/lib/services/networkManagement2/lib/lib/models/route.js new file mode 100644 index 0000000000..8fb7c8b2b8 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/route.js @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route resource + * + * @extends models['SubResource'] + */ +class Route extends models['SubResource'] { + /** + * Create a Route. + * @member {string} [addressPrefix] The destination CIDR to which the route + * applies. + * @member {string} nextHopType The type of Azure hop the packet should be + * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * 'None' + * @member {string} [nextHopIpAddress] The IP address packets should be + * forwarded to. Next hop values are only allowed in routes where the next + * hop type is VirtualAppliance. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Route + * + * @returns {object} metadata of Route + * + */ + mapper() { + return { + required: false, + serializedName: 'Route', + type: { + name: 'Composite', + className: 'Route', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + addressPrefix: { + required: false, + serializedName: 'properties.addressPrefix', + type: { + name: 'String' + } + }, + nextHopType: { + required: true, + serializedName: 'properties.nextHopType', + type: { + name: 'String' + } + }, + nextHopIpAddress: { + required: false, + serializedName: 'properties.nextHopIpAddress', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Route; diff --git a/lib/services/networkManagement2/lib/lib/models/routeFilter.js b/lib/services/networkManagement2/lib/lib/models/routeFilter.js new file mode 100644 index 0000000000..3c965667ac --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeFilter.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route Filter Resource. + * + * @extends models['Resource'] + */ +class RouteFilter extends models['Resource'] { + /** + * Create a RouteFilter. + * @member {array} [rules] Collection of RouteFilterRules contained within a + * route filter. + * @member {array} [peerings] A collection of references to express route + * circuit peerings. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteFilter + * + * @returns {object} metadata of RouteFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteFilter', + type: { + name: 'Composite', + className: 'RouteFilter', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + rules: { + required: false, + serializedName: 'properties.rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteFilterRuleElementType', + type: { + name: 'Composite', + className: 'RouteFilterRule' + } + } + } + }, + peerings: { + required: false, + serializedName: 'properties.peerings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ExpressRouteCircuitPeeringElementType', + type: { + name: 'Composite', + className: 'ExpressRouteCircuitPeering' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteFilter; diff --git a/lib/services/networkManagement2/lib/lib/models/routeFilterListResult.js b/lib/services/networkManagement2/lib/lib/models/routeFilterListResult.js new file mode 100644 index 0000000000..07f60cfe43 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeFilterListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListRouteFilters API service call. + */ +class RouteFilterListResult extends Array { + /** + * Create a RouteFilterListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteFilterListResult + * + * @returns {object} metadata of RouteFilterListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteFilterListResult', + type: { + name: 'Composite', + className: 'RouteFilterListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteFilterElementType', + type: { + name: 'Composite', + className: 'RouteFilter' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteFilterListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/routeFilterRule.js b/lib/services/networkManagement2/lib/lib/models/routeFilterRule.js new file mode 100644 index 0000000000..026d2ba3cb --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeFilterRule.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route Filter Rule Resource + * + * @extends models['SubResource'] + */ +class RouteFilterRule extends models['SubResource'] { + /** + * Create a RouteFilterRule. + * @member {string} access The access type of the rule. Valid values are: + * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} communities The collection for bgp community values to + * filter on. e.g. ['12076:5010','12076:5020'] + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and + * 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [location] Resource location. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteFilterRule + * + * @returns {object} metadata of RouteFilterRule + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteFilterRule', + type: { + name: 'Composite', + className: 'RouteFilterRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + access: { + required: true, + serializedName: 'properties.access', + type: { + name: 'String' + } + }, + routeFilterRuleType: { + required: true, + isConstant: true, + serializedName: 'properties.routeFilterRuleType', + defaultValue: 'Community', + type: { + name: 'String' + } + }, + communities: { + required: true, + serializedName: 'properties.communities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteFilterRule; diff --git a/lib/services/networkManagement2/lib/lib/models/routeFilterRuleListResult.js b/lib/services/networkManagement2/lib/lib/models/routeFilterRuleListResult.js new file mode 100644 index 0000000000..d5fc3d232a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeFilterRuleListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListRouteFilterRules API service call + */ +class RouteFilterRuleListResult extends Array { + /** + * Create a RouteFilterRuleListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteFilterRuleListResult + * + * @returns {object} metadata of RouteFilterRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteFilterRuleListResult', + type: { + name: 'Composite', + className: 'RouteFilterRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteFilterRuleElementType', + type: { + name: 'Composite', + className: 'RouteFilterRule' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteFilterRuleListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/routeListResult.js b/lib/services/networkManagement2/lib/lib/models/routeListResult.js new file mode 100644 index 0000000000..d5e97bccfd --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListRoute API service call + */ +class RouteListResult extends Array { + /** + * Create a RouteListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteListResult + * + * @returns {object} metadata of RouteListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteListResult', + type: { + name: 'Composite', + className: 'RouteListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteElementType', + type: { + name: 'Composite', + className: 'Route' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/routeTable.js b/lib/services/networkManagement2/lib/lib/models/routeTable.js new file mode 100644 index 0000000000..e6355aad77 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeTable.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Route table resource. + * + * @extends models['Resource'] + */ +class RouteTable extends models['Resource'] { + /** + * Create a RouteTable. + * @member {array} [routes] Collection of routes contained within a route + * table. + * @member {array} [subnets] A collection of references to subnets. + * @member {boolean} [disableBgpRoutePropagation] Gets or sets whether to + * disable the routes learned by BGP on that route table. True means disable. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteTable + * + * @returns {object} metadata of RouteTable + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteTable', + type: { + name: 'Composite', + className: 'RouteTable', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + routes: { + required: false, + serializedName: 'properties.routes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteElementType', + type: { + name: 'Composite', + className: 'Route' + } + } + } + }, + subnets: { + required: false, + readOnly: true, + serializedName: 'properties.subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubnetElementType', + type: { + name: 'Composite', + className: 'Subnet' + } + } + } + }, + disableBgpRoutePropagation: { + required: false, + serializedName: 'properties.disableBgpRoutePropagation', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteTable; diff --git a/lib/services/networkManagement2/lib/lib/models/routeTableListResult.js b/lib/services/networkManagement2/lib/lib/models/routeTableListResult.js new file mode 100644 index 0000000000..e7fcdff6bc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/routeTableListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListRouteTable API service call. + */ +class RouteTableListResult extends Array { + /** + * Create a RouteTableListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RouteTableListResult + * + * @returns {object} metadata of RouteTableListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RouteTableListResult', + type: { + name: 'Composite', + className: 'RouteTableListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RouteTableElementType', + type: { + name: 'Composite', + className: 'RouteTable' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RouteTableListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/securityGroupNetworkInterface.js b/lib/services/networkManagement2/lib/lib/models/securityGroupNetworkInterface.js new file mode 100644 index 0000000000..fab0c7c38e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityGroupNetworkInterface.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network interface and all its associated security rules. + * + */ +class SecurityGroupNetworkInterface { + /** + * Create a SecurityGroupNetworkInterface. + * @member {string} [id] ID of the network interface. + * @member {object} [securityRuleAssociations] + * @member {object} [securityRuleAssociations.networkInterfaceAssociation] + * @member {string} [securityRuleAssociations.networkInterfaceAssociation.id] + * Network interface ID. + * @member {array} + * [securityRuleAssociations.networkInterfaceAssociation.securityRules] + * Collection of custom security rules. + * @member {object} [securityRuleAssociations.subnetAssociation] + * @member {string} [securityRuleAssociations.subnetAssociation.id] Subnet + * ID. + * @member {array} [securityRuleAssociations.subnetAssociation.securityRules] + * Collection of custom security rules. + * @member {array} [securityRuleAssociations.defaultSecurityRules] Collection + * of default security rules of the network security group. + * @member {array} [securityRuleAssociations.effectiveSecurityRules] + * Collection of effective security rules. + */ + constructor() { + } + + /** + * Defines the metadata of SecurityGroupNetworkInterface + * + * @returns {object} metadata of SecurityGroupNetworkInterface + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityGroupNetworkInterface', + type: { + name: 'Composite', + className: 'SecurityGroupNetworkInterface', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + securityRuleAssociations: { + required: false, + serializedName: 'securityRuleAssociations', + type: { + name: 'Composite', + className: 'SecurityRuleAssociations' + } + } + } + } + }; + } +} + +module.exports = SecurityGroupNetworkInterface; diff --git a/lib/services/networkManagement2/lib/lib/models/securityGroupViewParameters.js b/lib/services/networkManagement2/lib/lib/models/securityGroupViewParameters.js new file mode 100644 index 0000000000..f44e5ddca7 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityGroupViewParameters.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Parameters that define the VM to check security groups for. + * + */ +class SecurityGroupViewParameters { + /** + * Create a SecurityGroupViewParameters. + * @member {string} targetResourceId ID of the target VM. + */ + constructor() { + } + + /** + * Defines the metadata of SecurityGroupViewParameters + * + * @returns {object} metadata of SecurityGroupViewParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityGroupViewParameters', + type: { + name: 'Composite', + className: 'SecurityGroupViewParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecurityGroupViewParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/securityGroupViewResult.js b/lib/services/networkManagement2/lib/lib/models/securityGroupViewResult.js new file mode 100644 index 0000000000..4e15fddac6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityGroupViewResult.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The information about security rules applied to the specified VM. + * + */ +class SecurityGroupViewResult { + /** + * Create a SecurityGroupViewResult. + * @member {array} [networkInterfaces] List of network interfaces on the + * specified VM. + */ + constructor() { + } + + /** + * Defines the metadata of SecurityGroupViewResult + * + * @returns {object} metadata of SecurityGroupViewResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityGroupViewResult', + type: { + name: 'Composite', + className: 'SecurityGroupViewResult', + modelProperties: { + networkInterfaces: { + required: false, + serializedName: 'networkInterfaces', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityGroupNetworkInterfaceElementType', + type: { + name: 'Composite', + className: 'SecurityGroupNetworkInterface' + } + } + } + } + } + } + }; + } +} + +module.exports = SecurityGroupViewResult; diff --git a/lib/services/networkManagement2/lib/lib/models/securityRule.js b/lib/services/networkManagement2/lib/lib/models/securityRule.js new file mode 100644 index 0000000000..2cd405eb52 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityRule.js @@ -0,0 +1,269 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network security rule. + * + * @extends models['SubResource'] + */ +class SecurityRule extends models['SubResource'] { + /** + * Create a SecurityRule. + * @member {string} [description] A description for this rule. Restricted to + * 140 chars. + * @member {string} protocol Network protocol this rule applies to. Possible + * values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + * '*' + * @member {string} [sourcePortRange] The source port or range. Integer or + * range between 0 and 65535. Asterix '*' can also be used to match all + * ports. + * @member {string} [destinationPortRange] The destination port or range. + * Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * @member {string} [sourceAddressPrefix] The CIDR or source IP range. + * Asterix '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @member {array} [sourceAddressPrefixes] The CIDR or source IP ranges. + * @member {array} [sourceApplicationSecurityGroups] The application security + * group specified as source. + * @member {string} [destinationAddressPrefix] The destination address + * prefix. CIDR or destination IP range. Asterix '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @member {array} [destinationAddressPrefixes] The destination address + * prefixes. CIDR or destination IP ranges. + * @member {array} [destinationApplicationSecurityGroups] The application + * security group specified as destination. + * @member {array} [sourcePortRanges] The source port ranges. + * @member {array} [destinationPortRanges] The destination port ranges. + * @member {string} access The network traffic is allowed or denied. Possible + * values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {number} [priority] The priority of the rule. The value can be + * between 100 and 4096. The priority number must be unique for each rule in + * the collection. The lower the priority number, the higher the priority of + * the rule. + * @member {string} direction The direction of the rule. The direction + * specifies if rule will be evaluated on incoming or outcoming traffic. + * Possible values are: 'Inbound' and 'Outbound'. Possible values include: + * 'Inbound', 'Outbound' + * @member {string} [provisioningState] The provisioning state of the public + * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SecurityRule + * + * @returns {object} metadata of SecurityRule + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityRule', + type: { + name: 'Composite', + className: 'SecurityRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + protocol: { + required: true, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + sourcePortRange: { + required: false, + serializedName: 'properties.sourcePortRange', + type: { + name: 'String' + } + }, + destinationPortRange: { + required: false, + serializedName: 'properties.destinationPortRange', + type: { + name: 'String' + } + }, + sourceAddressPrefix: { + required: false, + serializedName: 'properties.sourceAddressPrefix', + type: { + name: 'String' + } + }, + sourceAddressPrefixes: { + required: false, + serializedName: 'properties.sourceAddressPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceApplicationSecurityGroups: { + required: false, + serializedName: 'properties.sourceApplicationSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationSecurityGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroup' + } + } + } + }, + destinationAddressPrefix: { + required: false, + serializedName: 'properties.destinationAddressPrefix', + type: { + name: 'String' + } + }, + destinationAddressPrefixes: { + required: false, + serializedName: 'properties.destinationAddressPrefixes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationApplicationSecurityGroups: { + required: false, + serializedName: 'properties.destinationApplicationSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationSecurityGroupElementType', + type: { + name: 'Composite', + className: 'ApplicationSecurityGroup' + } + } + } + }, + sourcePortRanges: { + required: false, + serializedName: 'properties.sourcePortRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationPortRanges: { + required: false, + serializedName: 'properties.destinationPortRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + access: { + required: true, + serializedName: 'properties.access', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'properties.priority', + type: { + name: 'Number' + } + }, + direction: { + required: true, + serializedName: 'properties.direction', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecurityRule; diff --git a/lib/services/networkManagement2/lib/lib/models/securityRuleAssociations.js b/lib/services/networkManagement2/lib/lib/models/securityRuleAssociations.js new file mode 100644 index 0000000000..bfb3321308 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityRuleAssociations.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * All security rules associated with the network interface. + * + */ +class SecurityRuleAssociations { + /** + * Create a SecurityRuleAssociations. + * @member {object} [networkInterfaceAssociation] + * @member {string} [networkInterfaceAssociation.id] Network interface ID. + * @member {array} [networkInterfaceAssociation.securityRules] Collection of + * custom security rules. + * @member {object} [subnetAssociation] + * @member {string} [subnetAssociation.id] Subnet ID. + * @member {array} [subnetAssociation.securityRules] Collection of custom + * security rules. + * @member {array} [defaultSecurityRules] Collection of default security + * rules of the network security group. + * @member {array} [effectiveSecurityRules] Collection of effective security + * rules. + */ + constructor() { + } + + /** + * Defines the metadata of SecurityRuleAssociations + * + * @returns {object} metadata of SecurityRuleAssociations + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityRuleAssociations', + type: { + name: 'Composite', + className: 'SecurityRuleAssociations', + modelProperties: { + networkInterfaceAssociation: { + required: false, + serializedName: 'networkInterfaceAssociation', + type: { + name: 'Composite', + className: 'NetworkInterfaceAssociation' + } + }, + subnetAssociation: { + required: false, + serializedName: 'subnetAssociation', + type: { + name: 'Composite', + className: 'SubnetAssociation' + } + }, + defaultSecurityRules: { + required: false, + serializedName: 'defaultSecurityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + }, + effectiveSecurityRules: { + required: false, + serializedName: 'effectiveSecurityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EffectiveNetworkSecurityRuleElementType', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityRule' + } + } + } + } + } + } + }; + } +} + +module.exports = SecurityRuleAssociations; diff --git a/lib/services/networkManagement2/lib/lib/models/securityRuleListResult.js b/lib/services/networkManagement2/lib/lib/models/securityRuleListResult.js new file mode 100644 index 0000000000..f8e55a66b4 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/securityRuleListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListSecurityRule API service call. Retrieves all security rules + * that belongs to a network security group. + */ +class SecurityRuleListResult extends Array { + /** + * Create a SecurityRuleListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SecurityRuleListResult + * + * @returns {object} metadata of SecurityRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityRuleListResult', + type: { + name: 'Composite', + className: 'SecurityRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecurityRuleListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/serviceEndpointPropertiesFormat.js b/lib/services/networkManagement2/lib/lib/models/serviceEndpointPropertiesFormat.js new file mode 100644 index 0000000000..710f651b4e --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/serviceEndpointPropertiesFormat.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * The service endpoint properties. + * + */ +class ServiceEndpointPropertiesFormat { + /** + * Create a ServiceEndpointPropertiesFormat. + * @member {string} [service] The type of the endpoint service. + * @member {array} [locations] A list of locations. + * @member {string} [provisioningState] The provisioning state of the + * resource. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceEndpointPropertiesFormat + * + * @returns {object} metadata of ServiceEndpointPropertiesFormat + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEndpointPropertiesFormat', + type: { + name: 'Composite', + className: 'ServiceEndpointPropertiesFormat', + modelProperties: { + service: { + required: false, + serializedName: 'service', + type: { + name: 'String' + } + }, + locations: { + required: false, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEndpointPropertiesFormat; diff --git a/lib/services/networkManagement2/lib/lib/models/subResource.js b/lib/services/networkManagement2/lib/lib/models/subResource.js new file mode 100644 index 0000000000..51215f1707 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/subResource.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Reference to another subresource. + * + * @extends models['BaseResource'] + */ +class SubResource extends models['BaseResource'] { + /** + * Create a SubResource. + * @member {string} [id] Resource ID. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubResource + * + * @returns {object} metadata of SubResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SubResource', + type: { + name: 'Composite', + className: 'SubResource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubResource; diff --git a/lib/services/networkManagement2/lib/lib/models/subnet.js b/lib/services/networkManagement2/lib/lib/models/subnet.js new file mode 100644 index 0000000000..8ba2e0f670 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/subnet.js @@ -0,0 +1,186 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Subnet in a virtual network resource. + * + * @extends models['SubResource'] + */ +class Subnet extends models['SubResource'] { + /** + * Create a Subnet. + * @member {string} [addressPrefix] The address prefix for the subnet. + * @member {object} [networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * @member {array} [networkSecurityGroup.securityRules] A collection of + * security rules of the network security group. + * @member {array} [networkSecurityGroup.defaultSecurityRules] The default + * security rules of network security group. + * @member {array} [networkSecurityGroup.networkInterfaces] A collection of + * references to network interfaces. + * @member {array} [networkSecurityGroup.subnets] A collection of references + * to subnets. + * @member {string} [networkSecurityGroup.resourceGuid] The resource GUID + * property of the network security group resource. + * @member {string} [networkSecurityGroup.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [networkSecurityGroup.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {object} [routeTable] The reference of the RouteTable resource. + * @member {array} [routeTable.routes] Collection of routes contained within + * a route table. + * @member {array} [routeTable.subnets] A collection of references to + * subnets. + * @member {boolean} [routeTable.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True + * means disable. + * @member {string} [routeTable.provisioningState] The provisioning state of + * the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [routeTable.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * @member {array} [serviceEndpoints] An array of service endpoints. + * @member {array} [ipConfigurations] Gets an array of references to the + * network interface IP configurations using subnet. + * @member {array} [resourceNavigationLinks] Gets an array of references to + * the external resources using subnet. + * @member {string} [provisioningState] The provisioning state of the + * resource. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Subnet + * + * @returns {object} metadata of Subnet + * + */ + mapper() { + return { + required: false, + serializedName: 'Subnet', + type: { + name: 'Composite', + className: 'Subnet', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + addressPrefix: { + required: false, + serializedName: 'properties.addressPrefix', + type: { + name: 'String' + } + }, + networkSecurityGroup: { + required: false, + serializedName: 'properties.networkSecurityGroup', + type: { + name: 'Composite', + className: 'NetworkSecurityGroup' + } + }, + routeTable: { + required: false, + serializedName: 'properties.routeTable', + type: { + name: 'Composite', + className: 'RouteTable' + } + }, + serviceEndpoints: { + required: false, + serializedName: 'properties.serviceEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEndpointPropertiesFormatElementType', + type: { + name: 'Composite', + className: 'ServiceEndpointPropertiesFormat' + } + } + } + }, + ipConfigurations: { + required: false, + readOnly: true, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IPConfigurationElementType', + type: { + name: 'Composite', + className: 'IPConfiguration' + } + } + } + }, + resourceNavigationLinks: { + required: false, + serializedName: 'properties.resourceNavigationLinks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceNavigationLinkElementType', + type: { + name: 'Composite', + className: 'ResourceNavigationLink' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Subnet; diff --git a/lib/services/networkManagement2/lib/lib/models/subnetAssociation.js b/lib/services/networkManagement2/lib/lib/models/subnetAssociation.js new file mode 100644 index 0000000000..eadfdd90d5 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/subnetAssociation.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network interface and its custom security rules. + * + */ +class SubnetAssociation { + /** + * Create a SubnetAssociation. + * @member {string} [id] Subnet ID. + * @member {array} [securityRules] Collection of custom security rules. + */ + constructor() { + } + + /** + * Defines the metadata of SubnetAssociation + * + * @returns {object} metadata of SubnetAssociation + * + */ + mapper() { + return { + required: false, + serializedName: 'SubnetAssociation', + type: { + name: 'Composite', + className: 'SubnetAssociation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + securityRules: { + required: false, + serializedName: 'securityRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecurityRuleElementType', + type: { + name: 'Composite', + className: 'SecurityRule' + } + } + } + } + } + } + }; + } +} + +module.exports = SubnetAssociation; diff --git a/lib/services/networkManagement2/lib/lib/models/subnetListResult.js b/lib/services/networkManagement2/lib/lib/models/subnetListResult.js new file mode 100644 index 0000000000..fd7e58bb19 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/subnetListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListSubnets API service callRetrieves all subnet that belongs + * to a virtual network + */ +class SubnetListResult extends Array { + /** + * Create a SubnetListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubnetListResult + * + * @returns {object} metadata of SubnetListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SubnetListResult', + type: { + name: 'Composite', + className: 'SubnetListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubnetElementType', + type: { + name: 'Composite', + className: 'Subnet' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubnetListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/tagsObject.js b/lib/services/networkManagement2/lib/lib/models/tagsObject.js new file mode 100644 index 0000000000..755b116391 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/tagsObject.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Tags object for patch operations. + * + */ +class TagsObject { + /** + * Create a TagsObject. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of TagsObject + * + * @returns {object} metadata of TagsObject + * + */ + mapper() { + return { + required: false, + serializedName: 'TagsObject', + type: { + name: 'Composite', + className: 'TagsObject', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = TagsObject; diff --git a/lib/services/networkManagement2/lib/lib/models/topology.js b/lib/services/networkManagement2/lib/lib/models/topology.js new file mode 100644 index 0000000000..3aea099c87 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/topology.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Topology of the specified resource group. + * + */ +class Topology { + /** + * Create a Topology. + * @member {string} [id] GUID representing the operation id. + * @member {date} [createdDateTime] The datetime when the topology was + * initially created for the resource group. + * @member {date} [lastModified] The datetime when the topology was last + * modified. + * @member {array} [resources] + */ + constructor() { + } + + /** + * Defines the metadata of Topology + * + * @returns {object} metadata of Topology + * + */ + mapper() { + return { + required: false, + serializedName: 'Topology', + type: { + name: 'Composite', + className: 'Topology', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + createdDateTime: { + required: false, + readOnly: true, + serializedName: 'createdDateTime', + type: { + name: 'DateTime' + } + }, + lastModified: { + required: false, + readOnly: true, + serializedName: 'lastModified', + type: { + name: 'DateTime' + } + }, + resources: { + required: false, + serializedName: 'resources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TopologyResourceElementType', + type: { + name: 'Composite', + className: 'TopologyResource' + } + } + } + } + } + } + }; + } +} + +module.exports = Topology; diff --git a/lib/services/networkManagement2/lib/lib/models/topologyAssociation.js b/lib/services/networkManagement2/lib/lib/models/topologyAssociation.js new file mode 100644 index 0000000000..af3667e2ec --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/topologyAssociation.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Resources that have an association with the parent resource. + * + */ +class TopologyAssociation { + /** + * Create a TopologyAssociation. + * @member {string} [name] The name of the resource that is associated with + * the parent resource. + * @member {string} [resourceId] The ID of the resource that is associated + * with the parent resource. + * @member {string} [associationType] The association type of the child + * resource to the parent resource. Possible values include: 'Associated', + * 'Contains' + */ + constructor() { + } + + /** + * Defines the metadata of TopologyAssociation + * + * @returns {object} metadata of TopologyAssociation + * + */ + mapper() { + return { + required: false, + serializedName: 'TopologyAssociation', + type: { + name: 'Composite', + className: 'TopologyAssociation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + associationType: { + required: false, + serializedName: 'associationType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TopologyAssociation; diff --git a/lib/services/networkManagement2/lib/lib/models/topologyParameters.js b/lib/services/networkManagement2/lib/lib/models/topologyParameters.js new file mode 100644 index 0000000000..3d123836f6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/topologyParameters.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the representation of topology. + * + */ +class TopologyParameters { + /** + * Create a TopologyParameters. + * @member {string} [targetResourceGroupName] The name of the target resource + * group to perform topology on. + * @member {object} [targetVirtualNetwork] The reference of the Virtual + * Network resource. + * @member {string} [targetVirtualNetwork.id] Resource ID. + * @member {object} [targetSubnet] The reference of the Subnet resource. + * @member {string} [targetSubnet.id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of TopologyParameters + * + * @returns {object} metadata of TopologyParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TopologyParameters', + type: { + name: 'Composite', + className: 'TopologyParameters', + modelProperties: { + targetResourceGroupName: { + required: false, + serializedName: 'targetResourceGroupName', + type: { + name: 'String' + } + }, + targetVirtualNetwork: { + required: false, + serializedName: 'targetVirtualNetwork', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + targetSubnet: { + required: false, + serializedName: 'targetSubnet', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + }; + } +} + +module.exports = TopologyParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/topologyResource.js b/lib/services/networkManagement2/lib/lib/models/topologyResource.js new file mode 100644 index 0000000000..3d3475924c --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/topologyResource.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The network resource topology information for the given resource group. + * + */ +class TopologyResource { + /** + * Create a TopologyResource. + * @member {string} [name] Name of the resource. + * @member {string} [id] ID of the resource. + * @member {string} [location] Resource location. + * @member {array} [associations] Holds the associations the resource has + * with other resources in the resource group. + */ + constructor() { + } + + /** + * Defines the metadata of TopologyResource + * + * @returns {object} metadata of TopologyResource + * + */ + mapper() { + return { + required: false, + serializedName: 'TopologyResource', + type: { + name: 'Composite', + className: 'TopologyResource', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + associations: { + required: false, + serializedName: 'associations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TopologyAssociationElementType', + type: { + name: 'Composite', + className: 'TopologyAssociation' + } + } + } + } + } + } + }; + } +} + +module.exports = TopologyResource; diff --git a/lib/services/networkManagement2/lib/lib/models/troubleshootingDetails.js b/lib/services/networkManagement2/lib/lib/models/troubleshootingDetails.js new file mode 100644 index 0000000000..a05817b8c9 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/troubleshootingDetails.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information gained from troubleshooting of specified resource. + * + */ +class TroubleshootingDetails { + /** + * Create a TroubleshootingDetails. + * @member {string} [id] The id of the get troubleshoot operation. + * @member {string} [reasonType] Reason type of failure. + * @member {string} [summary] A summary of troubleshooting. + * @member {string} [detail] Details on troubleshooting results. + * @member {array} [recommendedActions] List of recommended actions. + */ + constructor() { + } + + /** + * Defines the metadata of TroubleshootingDetails + * + * @returns {object} metadata of TroubleshootingDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'TroubleshootingDetails', + type: { + name: 'Composite', + className: 'TroubleshootingDetails', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + reasonType: { + required: false, + serializedName: 'reasonType', + type: { + name: 'String' + } + }, + summary: { + required: false, + serializedName: 'summary', + type: { + name: 'String' + } + }, + detail: { + required: false, + serializedName: 'detail', + type: { + name: 'String' + } + }, + recommendedActions: { + required: false, + serializedName: 'recommendedActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TroubleshootingRecommendedActionsElementType', + type: { + name: 'Composite', + className: 'TroubleshootingRecommendedActions' + } + } + } + } + } + } + }; + } +} + +module.exports = TroubleshootingDetails; diff --git a/lib/services/networkManagement2/lib/lib/models/troubleshootingParameters.js b/lib/services/networkManagement2/lib/lib/models/troubleshootingParameters.js new file mode 100644 index 0000000000..d57f7fcc88 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/troubleshootingParameters.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Parameters that define the resource to troubleshoot. + * + */ +class TroubleshootingParameters { + /** + * Create a TroubleshootingParameters. + * @member {string} targetResourceId The target resource to troubleshoot. + * @member {string} storageId The ID for the storage account to save the + * troubleshoot result. + * @member {string} storagePath The path to the blob to save the troubleshoot + * result in. + */ + constructor() { + } + + /** + * Defines the metadata of TroubleshootingParameters + * + * @returns {object} metadata of TroubleshootingParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TroubleshootingParameters', + type: { + name: 'Composite', + className: 'TroubleshootingParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + }, + storageId: { + required: true, + serializedName: 'properties.storageId', + type: { + name: 'String' + } + }, + storagePath: { + required: true, + serializedName: 'properties.storagePath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TroubleshootingParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/troubleshootingRecommendedActions.js b/lib/services/networkManagement2/lib/lib/models/troubleshootingRecommendedActions.js new file mode 100644 index 0000000000..60b1587277 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/troubleshootingRecommendedActions.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Recommended actions based on discovered issues. + * + */ +class TroubleshootingRecommendedActions { + /** + * Create a TroubleshootingRecommendedActions. + * @member {string} [actionId] ID of the recommended action. + * @member {string} [actionText] Description of recommended actions. + * @member {string} [actionUri] The uri linking to a documentation for the + * recommended troubleshooting actions. + * @member {string} [actionUriText] The information from the URI for the + * recommended troubleshooting actions. + */ + constructor() { + } + + /** + * Defines the metadata of TroubleshootingRecommendedActions + * + * @returns {object} metadata of TroubleshootingRecommendedActions + * + */ + mapper() { + return { + required: false, + serializedName: 'TroubleshootingRecommendedActions', + type: { + name: 'Composite', + className: 'TroubleshootingRecommendedActions', + modelProperties: { + actionId: { + required: false, + serializedName: 'actionId', + type: { + name: 'String' + } + }, + actionText: { + required: false, + serializedName: 'actionText', + type: { + name: 'String' + } + }, + actionUri: { + required: false, + serializedName: 'actionUri', + type: { + name: 'String' + } + }, + actionUriText: { + required: false, + serializedName: 'actionUriText', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TroubleshootingRecommendedActions; diff --git a/lib/services/networkManagement2/lib/lib/models/troubleshootingResult.js b/lib/services/networkManagement2/lib/lib/models/troubleshootingResult.js new file mode 100644 index 0000000000..567714ac73 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/troubleshootingResult.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Troubleshooting information gained from specified resource. + * + */ +class TroubleshootingResult { + /** + * Create a TroubleshootingResult. + * @member {date} [startTime] The start time of the troubleshooting. + * @member {date} [endTime] The end time of the troubleshooting. + * @member {string} [code] The result code of the troubleshooting. + * @member {array} [results] Information from troubleshooting. + */ + constructor() { + } + + /** + * Defines the metadata of TroubleshootingResult + * + * @returns {object} metadata of TroubleshootingResult + * + */ + mapper() { + return { + required: false, + serializedName: 'TroubleshootingResult', + type: { + name: 'Composite', + className: 'TroubleshootingResult', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + results: { + required: false, + serializedName: 'results', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TroubleshootingDetailsElementType', + type: { + name: 'Composite', + className: 'TroubleshootingDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = TroubleshootingResult; diff --git a/lib/services/networkManagement2/lib/lib/models/tunnelConnectionHealth.js b/lib/services/networkManagement2/lib/lib/models/tunnelConnectionHealth.js new file mode 100644 index 0000000000..4f0858957a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/tunnelConnectionHealth.js @@ -0,0 +1,94 @@ +/* + * 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'; + +/** + * VirtualNetworkGatewayConnection properties + * + */ +class TunnelConnectionHealth { + /** + * Create a TunnelConnectionHealth. + * @member {string} [tunnel] Tunnel name. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * @member {number} [ingressBytesTransferred] The Ingress Bytes Transferred + * in this connection + * @member {number} [egressBytesTransferred] The Egress Bytes Transferred in + * this connection + * @member {string} [lastConnectionEstablishedUtcTime] The time at which + * connection was established in Utc format. + */ + constructor() { + } + + /** + * Defines the metadata of TunnelConnectionHealth + * + * @returns {object} metadata of TunnelConnectionHealth + * + */ + mapper() { + return { + required: false, + serializedName: 'TunnelConnectionHealth', + type: { + name: 'Composite', + className: 'TunnelConnectionHealth', + modelProperties: { + tunnel: { + required: false, + readOnly: true, + serializedName: 'tunnel', + type: { + name: 'String' + } + }, + connectionStatus: { + required: false, + readOnly: true, + serializedName: 'connectionStatus', + type: { + name: 'String' + } + }, + ingressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'ingressBytesTransferred', + type: { + name: 'Number' + } + }, + egressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'egressBytesTransferred', + type: { + name: 'Number' + } + }, + lastConnectionEstablishedUtcTime: { + required: false, + readOnly: true, + serializedName: 'lastConnectionEstablishedUtcTime', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TunnelConnectionHealth; diff --git a/lib/services/networkManagement2/lib/lib/models/usage.js b/lib/services/networkManagement2/lib/lib/models/usage.js new file mode 100644 index 0000000000..c232774e31 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/usage.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'; + +const models = require('./index'); + +/** + * Describes network resource usage. + * + */ +class Usage { + /** + * Create a Usage. + * @member {string} [id] Resource identifier. + * @member {number} currentValue The current value of the usage. + * @member {number} limit The limit of usage. + * @member {object} name The name of the type of usage. + * @member {string} [name.value] A string describing the resource name. + * @member {string} [name.localizedValue] A localized string describing the + * resource name. + */ + constructor() { + } + + /** + * Defines the metadata of Usage + * + * @returns {object} metadata of Usage + * + */ + mapper() { + return { + required: false, + serializedName: 'Usage', + type: { + name: 'Composite', + className: 'Usage', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + unit: { + required: true, + isConstant: true, + serializedName: 'unit', + defaultValue: 'Count', + type: { + name: 'String' + } + }, + currentValue: { + required: true, + serializedName: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'Composite', + className: 'UsageName' + } + } + } + } + }; + } +} + +module.exports = Usage; diff --git a/lib/services/networkManagement2/lib/lib/models/usageName.js b/lib/services/networkManagement2/lib/lib/models/usageName.js new file mode 100644 index 0000000000..391cb23fe0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/usageName.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The usage names. + * + */ +class UsageName { + /** + * Create a UsageName. + * @member {string} [value] A string describing the resource name. + * @member {string} [localizedValue] A localized string describing the + * resource name. + */ + constructor() { + } + + /** + * Defines the metadata of UsageName + * + * @returns {object} metadata of UsageName + * + */ + mapper() { + return { + required: false, + serializedName: 'UsageName', + type: { + name: 'Composite', + className: 'UsageName', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + localizedValue: { + required: false, + serializedName: 'localizedValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UsageName; diff --git a/lib/services/networkManagement2/lib/lib/models/usagesListResult.js b/lib/services/networkManagement2/lib/lib/models/usagesListResult.js new file mode 100644 index 0000000000..7c5697ddb4 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/usagesListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * The list usages operation response. + */ +class UsagesListResult extends Array { + /** + * Create a UsagesListResult. + * @member {string} [nextLink] URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of UsagesListResult + * + * @returns {object} metadata of UsagesListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'UsagesListResult', + type: { + name: 'Composite', + className: 'UsagesListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UsageElementType', + type: { + name: 'Composite', + className: 'Usage' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UsagesListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/verificationIPFlowParameters.js b/lib/services/networkManagement2/lib/lib/models/verificationIPFlowParameters.js new file mode 100644 index 0000000000..6270bd0162 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/verificationIPFlowParameters.js @@ -0,0 +1,119 @@ +/* + * 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'; + +/** + * Parameters that define the IP flow to be verified. + * + */ +class VerificationIPFlowParameters { + /** + * Create a VerificationIPFlowParameters. + * @member {string} targetResourceId The ID of the target resource to perform + * next-hop on. + * @member {string} direction The direction of the packet represented as a + * 5-tuple. Possible values include: 'Inbound', 'Outbound' + * @member {string} protocol Protocol to be verified on. Possible values + * include: 'TCP', 'UDP' + * @member {string} localPort The local port. Acceptable values are a single + * integer in the range (0-65535). Support for * for the source port, which + * depends on the direction. + * @member {string} remotePort The remote port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * @member {string} localIPAddress The local IP address. Acceptable values + * are valid IPv4 addresses. + * @member {string} remoteIPAddress The remote IP address. Acceptable values + * are valid IPv4 addresses. + * @member {string} [targetNicResourceId] The NIC ID. (If VM has multiple + * NICs and IP forwarding is enabled on any of them, then this parameter must + * be specified. Otherwise optional). + */ + constructor() { + } + + /** + * Defines the metadata of VerificationIPFlowParameters + * + * @returns {object} metadata of VerificationIPFlowParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VerificationIPFlowParameters', + type: { + name: 'Composite', + className: 'VerificationIPFlowParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + }, + direction: { + required: true, + serializedName: 'direction', + type: { + name: 'String' + } + }, + protocol: { + required: true, + serializedName: 'protocol', + type: { + name: 'String' + } + }, + localPort: { + required: true, + serializedName: 'localPort', + type: { + name: 'String' + } + }, + remotePort: { + required: true, + serializedName: 'remotePort', + type: { + name: 'String' + } + }, + localIPAddress: { + required: true, + serializedName: 'localIPAddress', + type: { + name: 'String' + } + }, + remoteIPAddress: { + required: true, + serializedName: 'remoteIPAddress', + type: { + name: 'String' + } + }, + targetNicResourceId: { + required: false, + serializedName: 'targetNicResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VerificationIPFlowParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/verificationIPFlowResult.js b/lib/services/networkManagement2/lib/lib/models/verificationIPFlowResult.js new file mode 100644 index 0000000000..47b6fa77d7 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/verificationIPFlowResult.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Results of IP flow verification on the target resource. + * + */ +class VerificationIPFlowResult { + /** + * Create a VerificationIPFlowResult. + * @member {string} [access] Indicates whether the traffic is allowed or + * denied. Possible values include: 'Allow', 'Deny' + * @member {string} [ruleName] Name of the rule. If input is not matched + * against any security rule, it is not displayed. + */ + constructor() { + } + + /** + * Defines the metadata of VerificationIPFlowResult + * + * @returns {object} metadata of VerificationIPFlowResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VerificationIPFlowResult', + type: { + name: 'Composite', + className: 'VerificationIPFlowResult', + modelProperties: { + access: { + required: false, + serializedName: 'access', + type: { + name: 'String' + } + }, + ruleName: { + required: false, + serializedName: 'ruleName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VerificationIPFlowResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetwork.js b/lib/services/networkManagement2/lib/lib/models/virtualNetwork.js new file mode 100644 index 0000000000..824d27e2a4 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetwork.js @@ -0,0 +1,210 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Virtual Network resource. + * + * @extends models['Resource'] + */ +class VirtualNetwork extends models['Resource'] { + /** + * Create a VirtualNetwork. + * @member {object} [addressSpace] The AddressSpace that contains an array of + * IP address ranges that can be used by subnets. + * @member {array} [addressSpace.addressPrefixes] A list of address blocks + * reserved for this virtual network in CIDR notation. + * @member {object} [dhcpOptions] The dhcpOptions that contains an array of + * DNS servers available to VMs deployed in the virtual network. + * @member {array} [dhcpOptions.dnsServers] The list of DNS servers IP + * addresses. + * @member {array} [subnets] A list of subnets in a Virtual Network. + * @member {array} [virtualNetworkPeerings] A list of peerings in a Virtual + * Network. + * @member {string} [resourceGuid] The resourceGuid property of the Virtual + * Network resource. + * @member {string} [provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * @member {boolean} [enableDdosProtection] Indicates if DDoS protection is + * enabled for all the protected resources in the virtual network. It + * requires a DDoS protection plan associated with the resource. Default + * value: false . + * @member {boolean} [enableVmProtection] Indicates if VM protection is + * enabled for all the subnets in the virtual network. Default value: false . + * @member {object} [ddosProtectionPlan] The DDoS protection plan associated + * with the virtual network. + * @member {string} [ddosProtectionPlan.id] Resource ID. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetwork + * + * @returns {object} metadata of VirtualNetwork + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetwork', + type: { + name: 'Composite', + className: 'VirtualNetwork', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + addressSpace: { + required: false, + serializedName: 'properties.addressSpace', + type: { + name: 'Composite', + className: 'AddressSpace' + } + }, + dhcpOptions: { + required: false, + serializedName: 'properties.dhcpOptions', + type: { + name: 'Composite', + className: 'DhcpOptions' + } + }, + subnets: { + required: false, + serializedName: 'properties.subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubnetElementType', + type: { + name: 'Composite', + className: 'Subnet' + } + } + } + }, + virtualNetworkPeerings: { + required: false, + serializedName: 'properties.virtualNetworkPeerings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkPeeringElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkPeering' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + enableDdosProtection: { + required: false, + serializedName: 'properties.enableDdosProtection', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + enableVmProtection: { + required: false, + serializedName: 'properties.enableVmProtection', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + ddosProtectionPlan: { + required: false, + serializedName: 'properties.ddosProtectionPlan', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetwork; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkConnectionGatewayReference.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkConnectionGatewayReference.js new file mode 100644 index 0000000000..8484f69350 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkConnectionGatewayReference.js @@ -0,0 +1,53 @@ +/* + * 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 reference to VirtualNetworkGateway or LocalNetworkGateway resource. + * + */ +class VirtualNetworkConnectionGatewayReference { + /** + * Create a VirtualNetworkConnectionGatewayReference. + * @member {string} id The ID of VirtualNetworkGateway or LocalNetworkGateway + * resource. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualNetworkConnectionGatewayReference + * + * @returns {object} metadata of VirtualNetworkConnectionGatewayReference + * + */ + mapper() { + return { + required: false, + serializedName: 'virtualNetworkConnectionGatewayReference', + type: { + name: 'Composite', + className: 'VirtualNetworkConnectionGatewayReference', + modelProperties: { + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkConnectionGatewayReference; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGateway.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGateway.js new file mode 100644 index 0000000000..a8853085dc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGateway.js @@ -0,0 +1,251 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A common class for general resource information + * + * @extends models['Resource'] + */ +class VirtualNetworkGateway extends models['Resource'] { + /** + * Create a VirtualNetworkGateway. + * @member {array} [ipConfigurations] IP configurations for virtual network + * gateway. + * @member {string} [gatewayType] The type of this virtual network gateway. + * Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: + * 'Vpn', 'ExpressRoute' + * @member {string} [vpnType] The type of this virtual network gateway. + * Possible values are: 'PolicyBased' and 'RouteBased'. Possible values + * include: 'PolicyBased', 'RouteBased' + * @member {boolean} [enableBgp] Whether BGP is enabled for this virtual + * network gateway or not. + * @member {boolean} [activeActive] ActiveActive flag + * @member {object} [gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default + * site setting. + * @member {string} [gatewayDefaultSite.id] Resource ID. + * @member {object} [sku] The reference of the VirtualNetworkGatewaySku + * resource which represents the SKU selected for Virtual network gateway. + * @member {string} [sku.name] Gateway SKU name. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {string} [sku.tier] Gateway SKU tier. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {number} [sku.capacity] The capacity. + * @member {object} [vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * @member {object} [vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * @member {array} + * [vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * @member {array} [vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} [vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} [vpnClientConfiguration.radiusServerAddress] The radius + * server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * @member {string} [vpnClientConfiguration.radiusServerSecret] The radius + * secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * @member {object} [bgpSettings] Virtual network gateway's BGP speaker + * settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address + * and BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes + * learned from this BGP speaker. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGateway resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGateway + * + * @returns {object} metadata of VirtualNetworkGateway + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGateway', + type: { + name: 'Composite', + className: 'VirtualNetworkGateway', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + ipConfigurations: { + required: false, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkGatewayIPConfigurationElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayIPConfiguration' + } + } + } + }, + gatewayType: { + required: false, + serializedName: 'properties.gatewayType', + type: { + name: 'String' + } + }, + vpnType: { + required: false, + serializedName: 'properties.vpnType', + type: { + name: 'String' + } + }, + enableBgp: { + required: false, + serializedName: 'properties.enableBgp', + type: { + name: 'Boolean' + } + }, + activeActive: { + required: false, + serializedName: 'properties.activeActive', + type: { + name: 'Boolean' + } + }, + gatewayDefaultSite: { + required: false, + serializedName: 'properties.gatewayDefaultSite', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewaySku' + } + }, + vpnClientConfiguration: { + required: false, + serializedName: 'properties.vpnClientConfiguration', + type: { + name: 'Composite', + className: 'VpnClientConfiguration' + } + }, + bgpSettings: { + required: false, + serializedName: 'properties.bgpSettings', + type: { + name: 'Composite', + className: 'BgpSettings' + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGateway; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnection.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnection.js new file mode 100644 index 0000000000..b6dc8791ef --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnection.js @@ -0,0 +1,447 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A common class for general resource information + * + * @extends models['Resource'] + */ +class VirtualNetworkGatewayConnection extends models['Resource'] { + /** + * Create a VirtualNetworkGatewayConnection. + * @member {string} [authorizationKey] The authorizationKey. + * @member {object} virtualNetworkGateway1 The reference to virtual network + * gateway resource. + * @member {array} [virtualNetworkGateway1.ipConfigurations] IP + * configurations for virtual network gateway. + * @member {string} [virtualNetworkGateway1.gatewayType] The type of this + * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * @member {string} [virtualNetworkGateway1.vpnType] The type of this virtual + * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. + * Possible values include: 'PolicyBased', 'RouteBased' + * @member {boolean} [virtualNetworkGateway1.enableBgp] Whether BGP is + * enabled for this virtual network gateway or not. + * @member {boolean} [virtualNetworkGateway1.activeActive] ActiveActive flag + * @member {object} [virtualNetworkGateway1.gatewayDefaultSite] The reference + * of the LocalNetworkGateway resource which represents local network site + * having default routes. Assign Null value in case of removing existing + * default site setting. + * @member {string} [virtualNetworkGateway1.gatewayDefaultSite.id] Resource + * ID. + * @member {object} [virtualNetworkGateway1.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * @member {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {number} [virtualNetworkGateway1.sku.capacity] The capacity. + * @member {object} [virtualNetworkGateway1.vpnClientConfiguration] The + * reference of the VpnClientConfiguration resource which represents the P2S + * VpnClient configurations. + * @member {object} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] + * A list of address blocks reserved for this virtual network in CIDR + * notation. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} + * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * @member {string} + * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * @member {object} [virtualNetworkGateway1.bgpSettings] Virtual network + * gateway's BGP speaker settings. + * @member {number} [virtualNetworkGateway1.bgpSettings.asn] The BGP + * speaker's ASN. + * @member {string} [virtualNetworkGateway1.bgpSettings.bgpPeeringAddress] + * The BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [virtualNetworkGateway1.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * @member {string} [virtualNetworkGateway1.resourceGuid] The resource GUID + * property of the VirtualNetworkGateway resource. + * @member {string} [virtualNetworkGateway1.provisioningState] The + * provisioning state of the VirtualNetworkGateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [virtualNetworkGateway1.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * @member {object} [virtualNetworkGateway2] The reference to virtual network + * gateway resource. + * @member {array} [virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * @member {string} [virtualNetworkGateway2.gatewayType] The type of this + * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * @member {string} [virtualNetworkGateway2.vpnType] The type of this virtual + * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. + * Possible values include: 'PolicyBased', 'RouteBased' + * @member {boolean} [virtualNetworkGateway2.enableBgp] Whether BGP is + * enabled for this virtual network gateway or not. + * @member {boolean} [virtualNetworkGateway2.activeActive] ActiveActive flag + * @member {object} [virtualNetworkGateway2.gatewayDefaultSite] The reference + * of the LocalNetworkGateway resource which represents local network site + * having default routes. Assign Null value in case of removing existing + * default site setting. + * @member {string} [virtualNetworkGateway2.gatewayDefaultSite.id] Resource + * ID. + * @member {object} [virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * @member {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @member {number} [virtualNetworkGateway2.sku.capacity] The capacity. + * @member {object} [virtualNetworkGateway2.vpnClientConfiguration] The + * reference of the VpnClientConfiguration resource which represents the P2S + * VpnClient configurations. + * @member {object} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] + * A list of address blocks reserved for this virtual network in CIDR + * notation. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * @member {array} + * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @member {string} + * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * @member {string} + * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * @member {object} [virtualNetworkGateway2.bgpSettings] Virtual network + * gateway's BGP speaker settings. + * @member {number} [virtualNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * @member {string} [virtualNetworkGateway2.bgpSettings.bgpPeeringAddress] + * The BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [virtualNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * @member {string} [virtualNetworkGateway2.resourceGuid] The resource GUID + * property of the VirtualNetworkGateway resource. + * @member {string} [virtualNetworkGateway2.provisioningState] The + * provisioning state of the VirtualNetworkGateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [virtualNetworkGateway2.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * @member {object} [localNetworkGateway2] The reference to local network + * gateway resource. + * @member {object} [localNetworkGateway2.localNetworkAddressSpace] Local + * network site address space. + * @member {array} + * [localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * @member {string} [localNetworkGateway2.gatewayIpAddress] IP address of + * local network gateway. + * @member {object} [localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * @member {number} [localNetworkGateway2.bgpSettings.asn] The BGP speaker's + * ASN. + * @member {string} [localNetworkGateway2.bgpSettings.bgpPeeringAddress] The + * BGP peering address and BGP identifier of this BGP speaker. + * @member {number} [localNetworkGateway2.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * @member {string} [localNetworkGateway2.resourceGuid] The resource GUID + * property of the LocalNetworkGateway resource. + * @member {string} [localNetworkGateway2.provisioningState] The provisioning + * state of the LocalNetworkGateway resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * @member {string} [localNetworkGateway2.etag] A unique read-only string + * that changes whenever the resource is updated. + * @member {string} connectionType Gateway connection type. Possible values + * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @member {number} [routingWeight] The routing weight. + * @member {string} [sharedKey] The IPSec shared key. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values are 'Unknown', 'Connecting', 'Connected' and + * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected' + * @member {array} [tunnelConnectionStatus] Collection of all tunnels' + * connection health status. + * @member {number} [egressBytesTransferred] The egress bytes transferred in + * this connection. + * @member {number} [ingressBytesTransferred] The ingress bytes transferred + * in this connection. + * @member {object} [peer] The reference to peerings resource. + * @member {string} [peer.id] Resource ID. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based + * traffic selectors. + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by + * this connection. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayConnection + * + * @returns {object} metadata of VirtualNetworkGatewayConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayConnection', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + authorizationKey: { + required: false, + serializedName: 'properties.authorizationKey', + type: { + name: 'String' + } + }, + virtualNetworkGateway1: { + required: true, + serializedName: 'properties.virtualNetworkGateway1', + type: { + name: 'Composite', + className: 'VirtualNetworkGateway' + } + }, + virtualNetworkGateway2: { + required: false, + serializedName: 'properties.virtualNetworkGateway2', + type: { + name: 'Composite', + className: 'VirtualNetworkGateway' + } + }, + localNetworkGateway2: { + required: false, + serializedName: 'properties.localNetworkGateway2', + type: { + name: 'Composite', + className: 'LocalNetworkGateway' + } + }, + connectionType: { + required: true, + serializedName: 'properties.connectionType', + type: { + name: 'String' + } + }, + routingWeight: { + required: false, + serializedName: 'properties.routingWeight', + type: { + name: 'Number' + } + }, + sharedKey: { + required: false, + serializedName: 'properties.sharedKey', + type: { + name: 'String' + } + }, + connectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.connectionStatus', + type: { + name: 'String' + } + }, + tunnelConnectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.tunnelConnectionStatus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TunnelConnectionHealthElementType', + type: { + name: 'Composite', + className: 'TunnelConnectionHealth' + } + } + } + }, + egressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.egressBytesTransferred', + type: { + name: 'Number' + } + }, + ingressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.ingressBytesTransferred', + type: { + name: 'Number' + } + }, + peer: { + required: false, + serializedName: 'properties.peer', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + enableBgp: { + required: false, + serializedName: 'properties.enableBgp', + type: { + name: 'Boolean' + } + }, + usePolicyBasedTrafficSelectors: { + required: false, + serializedName: 'properties.usePolicyBasedTrafficSelectors', + type: { + name: 'Boolean' + } + }, + ipsecPolicies: { + required: false, + serializedName: 'properties.ipsecPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpsecPolicyElementType', + type: { + name: 'Composite', + className: 'IpsecPolicy' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayConnection; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListEntity.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListEntity.js new file mode 100644 index 0000000000..12183ef6db --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListEntity.js @@ -0,0 +1,285 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A common class for general resource information + * + * @extends models['Resource'] + */ +class VirtualNetworkGatewayConnectionListEntity extends models['Resource'] { + /** + * Create a VirtualNetworkGatewayConnectionListEntity. + * @member {string} [authorizationKey] The authorizationKey. + * @member {object} virtualNetworkGateway1 The reference to virtual network + * gateway resource. + * @member {string} [virtualNetworkGateway1.id] The ID of + * VirtualNetworkGateway or LocalNetworkGateway resource. + * @member {object} [virtualNetworkGateway2] The reference to virtual network + * gateway resource. + * @member {string} [virtualNetworkGateway2.id] The ID of + * VirtualNetworkGateway or LocalNetworkGateway resource. + * @member {object} [localNetworkGateway2] The reference to local network + * gateway resource. + * @member {string} [localNetworkGateway2.id] The ID of VirtualNetworkGateway + * or LocalNetworkGateway resource. + * @member {string} connectionType Gateway connection type. Possible values + * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @member {number} [routingWeight] The routing weight. + * @member {string} [sharedKey] The IPSec shared key. + * @member {string} [connectionStatus] Virtual network Gateway connection + * status. Possible values are 'Unknown', 'Connecting', 'Connected' and + * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected' + * @member {array} [tunnelConnectionStatus] Collection of all tunnels' + * connection health status. + * @member {number} [egressBytesTransferred] The egress bytes transferred in + * this connection. + * @member {number} [ingressBytesTransferred] The ingress bytes transferred + * in this connection. + * @member {object} [peer] The reference to peerings resource. + * @member {string} [peer.id] Resource ID. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based + * traffic selectors. + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by + * this connection. + * @member {string} [resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * @member {string} [provisioningState] The provisioning state of the + * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayConnectionListEntity + * + * @returns {object} metadata of VirtualNetworkGatewayConnectionListEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayConnectionListEntity', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayConnectionListEntity', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + authorizationKey: { + required: false, + serializedName: 'properties.authorizationKey', + type: { + name: 'String' + } + }, + virtualNetworkGateway1: { + required: true, + serializedName: 'properties.virtualNetworkGateway1', + type: { + name: 'Composite', + className: 'VirtualNetworkConnectionGatewayReference' + } + }, + virtualNetworkGateway2: { + required: false, + serializedName: 'properties.virtualNetworkGateway2', + type: { + name: 'Composite', + className: 'VirtualNetworkConnectionGatewayReference' + } + }, + localNetworkGateway2: { + required: false, + serializedName: 'properties.localNetworkGateway2', + type: { + name: 'Composite', + className: 'VirtualNetworkConnectionGatewayReference' + } + }, + connectionType: { + required: true, + serializedName: 'properties.connectionType', + type: { + name: 'String' + } + }, + routingWeight: { + required: false, + serializedName: 'properties.routingWeight', + type: { + name: 'Number' + } + }, + sharedKey: { + required: false, + serializedName: 'properties.sharedKey', + type: { + name: 'String' + } + }, + connectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.connectionStatus', + type: { + name: 'String' + } + }, + tunnelConnectionStatus: { + required: false, + readOnly: true, + serializedName: 'properties.tunnelConnectionStatus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TunnelConnectionHealthElementType', + type: { + name: 'Composite', + className: 'TunnelConnectionHealth' + } + } + } + }, + egressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.egressBytesTransferred', + type: { + name: 'Number' + } + }, + ingressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.ingressBytesTransferred', + type: { + name: 'Number' + } + }, + peer: { + required: false, + serializedName: 'properties.peer', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + enableBgp: { + required: false, + serializedName: 'properties.enableBgp', + type: { + name: 'Boolean' + } + }, + usePolicyBasedTrafficSelectors: { + required: false, + serializedName: 'properties.usePolicyBasedTrafficSelectors', + type: { + name: 'Boolean' + } + }, + ipsecPolicies: { + required: false, + serializedName: 'properties.ipsecPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpsecPolicyElementType', + type: { + name: 'Composite', + className: 'IpsecPolicy' + } + } + } + }, + resourceGuid: { + required: false, + serializedName: 'properties.resourceGuid', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayConnectionListEntity; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListResult.js new file mode 100644 index 0000000000..6572635654 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for the ListVirtualNetworkGatewayConnections API service call + */ +class VirtualNetworkGatewayConnectionListResult extends Array { + /** + * Create a VirtualNetworkGatewayConnectionListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayConnectionListResult + * + * @returns {object} metadata of VirtualNetworkGatewayConnectionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayConnectionListResult', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayConnectionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkGatewayConnectionElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayConnection' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayConnectionListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayIPConfiguration.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayIPConfiguration.js new file mode 100644 index 0000000000..704ba94ddd --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayIPConfiguration.js @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * IP configuration for virtual network gateway + * + * @extends models['SubResource'] + */ +class VirtualNetworkGatewayIPConfiguration extends models['SubResource'] { + /** + * Create a VirtualNetworkGatewayIPConfiguration. + * @member {string} [privateIPAllocationMethod] The private IP allocation + * method. Possible values are: 'Static' and 'Dynamic'. Possible values + * include: 'Static', 'Dynamic' + * @member {object} [subnet] The reference of the subnet resource. + * @member {string} [subnet.id] Resource ID. + * @member {object} [publicIPAddress] The reference of the public IP + * resource. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] The provisioning state of the public + * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayIPConfiguration + * + * @returns {object} metadata of VirtualNetworkGatewayIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayIPConfiguration', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + privateIPAllocationMethod: { + required: false, + serializedName: 'properties.privateIPAllocationMethod', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayIPConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListConnectionsResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListConnectionsResult.js new file mode 100644 index 0000000000..b2ad2405b1 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListConnectionsResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for the VirtualNetworkGatewayListConnections API service call + */ +class VirtualNetworkGatewayListConnectionsResult extends Array { + /** + * Create a VirtualNetworkGatewayListConnectionsResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayListConnectionsResult + * + * @returns {object} metadata of VirtualNetworkGatewayListConnectionsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayListConnectionsResult', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayListConnectionsResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkGatewayConnectionListEntityElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayConnectionListEntity' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayListConnectionsResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListResult.js new file mode 100644 index 0000000000..7daeceaa76 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for the ListVirtualNetworkGateways API service call. + */ +class VirtualNetworkGatewayListResult extends Array { + /** + * Create a VirtualNetworkGatewayListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkGatewayListResult + * + * @returns {object} metadata of VirtualNetworkGatewayListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewayListResult', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewayListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkGatewayElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkGateway' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewayListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewaySku.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewaySku.js new file mode 100644 index 0000000000..cea2349ade --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewaySku.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * VirtualNetworkGatewaySku details + * + */ +class VirtualNetworkGatewaySku { + /** + * Create a VirtualNetworkGatewaySku. + * @member {string} [name] Gateway SKU name. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {string} [tier] Gateway SKU tier. Possible values include: + * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', + * 'VpnGw2', 'VpnGw3' + * @member {number} [capacity] The capacity. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualNetworkGatewaySku + * + * @returns {object} metadata of VirtualNetworkGatewaySku + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkGatewaySku', + type: { + name: 'Composite', + className: 'VirtualNetworkGatewaySku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkGatewaySku; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkListResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkListResult.js new file mode 100644 index 0000000000..d578f54820 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for the ListVirtualNetworks API service call. + */ +class VirtualNetworkListResult extends Array { + /** + * Create a VirtualNetworkListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkListResult + * + * @returns {object} metadata of VirtualNetworkListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkListResult', + type: { + name: 'Composite', + className: 'VirtualNetworkListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkElementType', + type: { + name: 'Composite', + className: 'VirtualNetwork' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkListUsageResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkListUsageResult.js new file mode 100644 index 0000000000..633640ecb3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkListUsageResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for the virtual networks GetUsage API service call. + */ +class VirtualNetworkListUsageResult extends Array { + /** + * Create a VirtualNetworkListUsageResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkListUsageResult + * + * @returns {object} metadata of VirtualNetworkListUsageResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkListUsageResult', + type: { + name: 'Composite', + className: 'VirtualNetworkListUsageResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkUsageElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkUsage' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkListUsageResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeering.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeering.js new file mode 100644 index 0000000000..813b33c2b0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeering.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Peerings in a virtual network resource. + * + * @extends models['SubResource'] + */ +class VirtualNetworkPeering extends models['SubResource'] { + /** + * Create a VirtualNetworkPeering. + * @member {boolean} [allowVirtualNetworkAccess] Whether the VMs in the + * linked virtual network space would be able to access all the VMs in local + * Virtual network space. + * @member {boolean} [allowForwardedTraffic] Whether the forwarded traffic + * from the VMs in the remote virtual network will be allowed/disallowed. + * @member {boolean} [allowGatewayTransit] If gateway links can be used in + * remote virtual networking to link to this virtual network. + * @member {boolean} [useRemoteGateways] If remote gateways can be used on + * this virtual network. If the flag is set to true, and allowGatewayTransit + * on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag + * set to true. This flag cannot be set if virtual network already has a + * gateway. + * @member {object} [remoteVirtualNetwork] The reference of the remote + * virtual network. The remote virtual network can be in the same or + * different region (preview). See here to register for the preview and learn + * more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @member {string} [remoteVirtualNetwork.id] Resource ID. + * @member {object} [remoteAddressSpace] The reference of the remote virtual + * network address space. + * @member {array} [remoteAddressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * @member {string} [peeringState] The status of the virtual network peering. + * Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible + * values include: 'Initiated', 'Connected', 'Disconnected' + * @member {string} [provisioningState] The provisioning state of the + * resource. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkPeering + * + * @returns {object} metadata of VirtualNetworkPeering + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkPeering', + type: { + name: 'Composite', + className: 'VirtualNetworkPeering', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + allowVirtualNetworkAccess: { + required: false, + serializedName: 'properties.allowVirtualNetworkAccess', + type: { + name: 'Boolean' + } + }, + allowForwardedTraffic: { + required: false, + serializedName: 'properties.allowForwardedTraffic', + type: { + name: 'Boolean' + } + }, + allowGatewayTransit: { + required: false, + serializedName: 'properties.allowGatewayTransit', + type: { + name: 'Boolean' + } + }, + useRemoteGateways: { + required: false, + serializedName: 'properties.useRemoteGateways', + type: { + name: 'Boolean' + } + }, + remoteVirtualNetwork: { + required: false, + serializedName: 'properties.remoteVirtualNetwork', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + remoteAddressSpace: { + required: false, + serializedName: 'properties.remoteAddressSpace', + type: { + name: 'Composite', + className: 'AddressSpace' + } + }, + peeringState: { + required: false, + serializedName: 'properties.peeringState', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkPeering; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeeringListResult.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeeringListResult.js new file mode 100644 index 0000000000..f3ee98739a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkPeeringListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListSubnets API service call. Retrieves all subnets that belong + * to a virtual network. + */ +class VirtualNetworkPeeringListResult extends Array { + /** + * Create a VirtualNetworkPeeringListResult. + * @member {string} [nextLink] The URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkPeeringListResult + * + * @returns {object} metadata of VirtualNetworkPeeringListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkPeeringListResult', + type: { + name: 'Composite', + className: 'VirtualNetworkPeeringListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkPeeringElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkPeering' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkPeeringListResult; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsage.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsage.js new file mode 100644 index 0000000000..d599549cb5 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsage.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Usage details for subnet. + * + */ +class VirtualNetworkUsage { + /** + * Create a VirtualNetworkUsage. + * @member {number} [currentValue] Indicates number of IPs used from the + * Subnet. + * @member {string} [id] Subnet identifier. + * @member {number} [limit] Indicates the size of the subnet. + * @member {object} [name] The name containing common and localized value for + * usage. + * @member {string} [name.localizedValue] Localized subnet size and usage + * string. + * @member {string} [name.value] Subnet size and usage string. + * @member {string} [unit] Usage units. Returns 'Count' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualNetworkUsage + * + * @returns {object} metadata of VirtualNetworkUsage + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkUsage', + type: { + name: 'Composite', + className: 'VirtualNetworkUsage', + modelProperties: { + currentValue: { + required: false, + readOnly: true, + serializedName: 'currentValue', + type: { + name: 'Number' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + limit: { + required: false, + readOnly: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'Composite', + className: 'VirtualNetworkUsageName' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkUsage; diff --git a/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsageName.js b/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsageName.js new file mode 100644 index 0000000000..093951db51 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/virtualNetworkUsageName.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Usage strings container. + * + */ +class VirtualNetworkUsageName { + /** + * Create a VirtualNetworkUsageName. + * @member {string} [localizedValue] Localized subnet size and usage string. + * @member {string} [value] Subnet size and usage string. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualNetworkUsageName + * + * @returns {object} metadata of VirtualNetworkUsageName + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkUsageName', + type: { + name: 'Composite', + className: 'VirtualNetworkUsageName', + modelProperties: { + localizedValue: { + required: false, + readOnly: true, + serializedName: 'localizedValue', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkUsageName; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnClientConfiguration.js b/lib/services/networkManagement2/lib/lib/models/vpnClientConfiguration.js new file mode 100644 index 0000000000..b4f14facc0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnClientConfiguration.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VpnClientConfiguration for P2S client. + * + */ +class VpnClientConfiguration { + /** + * Create a VpnClientConfiguration. + * @member {object} [vpnClientAddressPool] The reference of the address space + * resource which represents Address space for P2S VpnClient. + * @member {array} [vpnClientAddressPool.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * @member {array} [vpnClientRootCertificates] VpnClientRootCertificate for + * virtual network gateway. + * @member {array} [vpnClientRevokedCertificates] VpnClientRevokedCertificate + * for Virtual network gateway. + * @member {array} [vpnClientProtocols] VpnClientProtocols for Virtual + * network gateway. + * @member {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for + * virtual network gateway P2S client. + * @member {string} [radiusServerAddress] The radius server address property + * of the VirtualNetworkGateway resource for vpn client connection. + * @member {string} [radiusServerSecret] The radius secret property of the + * VirtualNetworkGateway resource for vpn client connection. + */ + constructor() { + } + + /** + * Defines the metadata of VpnClientConfiguration + * + * @returns {object} metadata of VpnClientConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnClientConfiguration', + type: { + name: 'Composite', + className: 'VpnClientConfiguration', + modelProperties: { + vpnClientAddressPool: { + required: false, + serializedName: 'vpnClientAddressPool', + type: { + name: 'Composite', + className: 'AddressSpace' + } + }, + vpnClientRootCertificates: { + required: false, + serializedName: 'vpnClientRootCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnClientRootCertificateElementType', + type: { + name: 'Composite', + className: 'VpnClientRootCertificate' + } + } + } + }, + vpnClientRevokedCertificates: { + required: false, + serializedName: 'vpnClientRevokedCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnClientRevokedCertificateElementType', + type: { + name: 'Composite', + className: 'VpnClientRevokedCertificate' + } + } + } + }, + vpnClientProtocols: { + required: false, + serializedName: 'vpnClientProtocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + vpnClientIpsecPolicies: { + required: false, + serializedName: 'vpnClientIpsecPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpsecPolicyElementType', + type: { + name: 'Composite', + className: 'IpsecPolicy' + } + } + } + }, + radiusServerAddress: { + required: false, + serializedName: 'radiusServerAddress', + type: { + name: 'String' + } + }, + radiusServerSecret: { + required: false, + serializedName: 'radiusServerSecret', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnClientConfiguration; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnClientIPsecParameters.js b/lib/services/networkManagement2/lib/lib/models/vpnClientIPsecParameters.js new file mode 100644 index 0000000000..b166295913 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnClientIPsecParameters.js @@ -0,0 +1,122 @@ +/* + * 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'; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + * + */ +class VpnClientIPsecParameters { + /** + * Create a VpnClientIPsecParameters. + * @member {number} saLifeTimeSeconds The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * @member {number} saDataSizeKilobytes The IPSec Security Association (also + * called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * @member {string} ipsecEncryption The IPSec encryption algorithm (IKE phase + * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * @member {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase + * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256' + * @member {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). + * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + * 'GCMAES256', 'GCMAES128' + * @member {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). + * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + * 'GCMAES128' + * @member {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. + * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @member {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child + * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + */ + constructor() { + } + + /** + * Defines the metadata of VpnClientIPsecParameters + * + * @returns {object} metadata of VpnClientIPsecParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnClientIPsecParameters', + type: { + name: 'Composite', + className: 'VpnClientIPsecParameters', + modelProperties: { + saLifeTimeSeconds: { + required: true, + serializedName: 'saLifeTimeSeconds', + type: { + name: 'Number' + } + }, + saDataSizeKilobytes: { + required: true, + serializedName: 'saDataSizeKilobytes', + type: { + name: 'Number' + } + }, + ipsecEncryption: { + required: true, + serializedName: 'ipsecEncryption', + type: { + name: 'String' + } + }, + ipsecIntegrity: { + required: true, + serializedName: 'ipsecIntegrity', + type: { + name: 'String' + } + }, + ikeEncryption: { + required: true, + serializedName: 'ikeEncryption', + type: { + name: 'String' + } + }, + ikeIntegrity: { + required: true, + serializedName: 'ikeIntegrity', + type: { + name: 'String' + } + }, + dhGroup: { + required: true, + serializedName: 'dhGroup', + type: { + name: 'String' + } + }, + pfsGroup: { + required: true, + serializedName: 'pfsGroup', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnClientIPsecParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnClientParameters.js b/lib/services/networkManagement2/lib/lib/models/vpnClientParameters.js new file mode 100644 index 0000000000..f83ecb68a3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnClientParameters.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'; + +/** + * Vpn Client Parameters for package generation + * + */ +class VpnClientParameters { + /** + * Create a VpnClientParameters. + * @member {string} [processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * @member {string} [authenticationMethod] VPN client Authentication Method. + * Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: + * 'EAPTLS', 'EAPMSCHAPv2' + * @member {string} [radiusServerAuthCertificate] The public certificate data + * for the radius server authentication certificate as a Base-64 encoded + * string. Required only if external radius authentication has been + * configured with EAPTLS authentication. + * @member {array} [clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + */ + constructor() { + } + + /** + * Defines the metadata of VpnClientParameters + * + * @returns {object} metadata of VpnClientParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnClientParameters', + type: { + name: 'Composite', + className: 'VpnClientParameters', + modelProperties: { + processorArchitecture: { + required: false, + serializedName: 'processorArchitecture', + type: { + name: 'String' + } + }, + authenticationMethod: { + required: false, + serializedName: 'authenticationMethod', + type: { + name: 'String' + } + }, + radiusServerAuthCertificate: { + required: false, + serializedName: 'radiusServerAuthCertificate', + type: { + name: 'String' + } + }, + clientRootCertificates: { + required: false, + serializedName: 'clientRootCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VpnClientParameters; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnClientRevokedCertificate.js b/lib/services/networkManagement2/lib/lib/models/vpnClientRevokedCertificate.js new file mode 100644 index 0000000000..6765ec0de6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnClientRevokedCertificate.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VPN client revoked certificate of virtual network gateway. + * + * @extends models['SubResource'] + */ +class VpnClientRevokedCertificate extends models['SubResource'] { + /** + * Create a VpnClientRevokedCertificate. + * @member {string} [thumbprint] The revoked VPN client certificate + * thumbprint. + * @member {string} [provisioningState] The provisioning state of the VPN + * client revoked certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VpnClientRevokedCertificate + * + * @returns {object} metadata of VpnClientRevokedCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnClientRevokedCertificate', + type: { + name: 'Composite', + className: 'VpnClientRevokedCertificate', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + thumbprint: { + required: false, + serializedName: 'properties.thumbprint', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnClientRevokedCertificate; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnClientRootCertificate.js b/lib/services/networkManagement2/lib/lib/models/vpnClientRootCertificate.js new file mode 100644 index 0000000000..c37cf3e0db --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnClientRootCertificate.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'; + +const models = require('./index'); + +/** + * VPN client root certificate of virtual network gateway + * + * @extends models['SubResource'] + */ +class VpnClientRootCertificate extends models['SubResource'] { + /** + * Create a VpnClientRootCertificate. + * @member {string} publicCertData The certificate public data. + * @member {string} [provisioningState] The provisioning state of the VPN + * client root certificate resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VpnClientRootCertificate + * + * @returns {object} metadata of VpnClientRootCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnClientRootCertificate', + type: { + name: 'Composite', + className: 'VpnClientRootCertificate', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + publicCertData: { + required: true, + serializedName: 'properties.publicCertData', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnClientRootCertificate; diff --git a/lib/services/networkManagement2/lib/lib/models/vpnDeviceScriptParameters.js b/lib/services/networkManagement2/lib/lib/models/vpnDeviceScriptParameters.js new file mode 100644 index 0000000000..ff0a58c30b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/models/vpnDeviceScriptParameters.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Vpn device configuration script generation parameters + * + */ +class VpnDeviceScriptParameters { + /** + * Create a VpnDeviceScriptParameters. + * @member {string} [vendor] The vendor for the vpn device. + * @member {string} [deviceFamily] The device family for the vpn device. + * @member {string} [firmwareVersion] The firmware version for the vpn + * device. + */ + constructor() { + } + + /** + * Defines the metadata of VpnDeviceScriptParameters + * + * @returns {object} metadata of VpnDeviceScriptParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnDeviceScriptParameters', + type: { + name: 'Composite', + className: 'VpnDeviceScriptParameters', + modelProperties: { + vendor: { + required: false, + serializedName: 'vendor', + type: { + name: 'String' + } + }, + deviceFamily: { + required: false, + serializedName: 'deviceFamily', + type: { + name: 'String' + } + }, + firmwareVersion: { + required: false, + serializedName: 'firmwareVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnDeviceScriptParameters; diff --git a/lib/services/networkManagement2/lib/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/lib/networkManagementClient.d.ts new file mode 100644 index 0000000000..9286c83139 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/networkManagementClient.d.ts @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse, ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class NetworkManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the NetworkManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + applicationGateways: operations.ApplicationGateways; + applicationSecurityGroups: operations.ApplicationSecurityGroups; + ddosProtectionPlans: operations.DdosProtectionPlans; + availableEndpointServices: operations.AvailableEndpointServices; + expressRouteCircuitAuthorizations: operations.ExpressRouteCircuitAuthorizations; + expressRouteCircuitPeerings: operations.ExpressRouteCircuitPeerings; + expressRouteCircuitConnections: operations.ExpressRouteCircuitConnections; + expressRouteCircuits: operations.ExpressRouteCircuits; + expressRouteServiceProviders: operations.ExpressRouteServiceProviders; + expressRouteCrossConnections: operations.ExpressRouteCrossConnections; + expressRouteCrossConnectionPeerings: operations.ExpressRouteCrossConnectionPeerings; + loadBalancers: operations.LoadBalancers; + loadBalancerBackendAddressPools: operations.LoadBalancerBackendAddressPools; + loadBalancerFrontendIPConfigurations: operations.LoadBalancerFrontendIPConfigurations; + inboundNatRules: operations.InboundNatRules; + loadBalancerLoadBalancingRules: operations.LoadBalancerLoadBalancingRules; + loadBalancerNetworkInterfaces: operations.LoadBalancerNetworkInterfaces; + loadBalancerProbes: operations.LoadBalancerProbes; + networkInterfaces: operations.NetworkInterfaces; + networkInterfaceIPConfigurations: operations.NetworkInterfaceIPConfigurations; + networkInterfaceLoadBalancers: operations.NetworkInterfaceLoadBalancers; + networkSecurityGroups: operations.NetworkSecurityGroups; + securityRules: operations.SecurityRules; + defaultSecurityRules: operations.DefaultSecurityRules; + networkWatchers: operations.NetworkWatchers; + packetCaptures: operations.PacketCaptures; + connectionMonitors: operations.ConnectionMonitors; + operations: operations.Operations; + publicIPAddresses: operations.PublicIPAddresses; + routeFilters: operations.RouteFilters; + routeFilterRules: operations.RouteFilterRules; + routeTables: operations.RouteTables; + routes: operations.Routes; + bgpServiceCommunities: operations.BgpServiceCommunities; + usages: operations.Usages; + virtualNetworks: operations.VirtualNetworks; + subnets: operations.Subnets; + virtualNetworkPeerings: operations.VirtualNetworkPeerings; + virtualNetworkGateways: operations.VirtualNetworkGateways; + virtualNetworkGatewayConnections: operations.VirtualNetworkGatewayConnections; + localNetworkGateways: operations.LocalNetworkGateways; + + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for + * use. + * + * @param {string} location The location of the domain name. + * + * @param {string} domainNameLabel The domain name to be verified. It must + * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * + * @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. + */ + checkDnsNameAvailabilityWithHttpOperationResponse(location: string, domainNameLabel: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for + * use. + * + * @param {string} location The location of the domain name. + * + * @param {string} domainNameLabel The domain name to be verified. It must + * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * + * @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 {DnsNameAvailabilityResult} - 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. + * + * {DnsNameAvailabilityResult} [result] - The deserialized result object if an error did not occur. + * See {@link DnsNameAvailabilityResult} 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. + */ + checkDnsNameAvailability(location: string, domainNameLabel: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkDnsNameAvailability(location: string, domainNameLabel: string, callback: ServiceCallback): void; + checkDnsNameAvailability(location: string, domainNameLabel: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +export { NetworkManagementClient, models as NetworkManagementModels }; diff --git a/lib/services/networkManagement2/lib/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/lib/networkManagementClient.js new file mode 100644 index 0000000000..77e297060f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/networkManagementClient.js @@ -0,0 +1,366 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; +const WebResource = msRest.WebResource; + +const models = require('./models'); +const operations = require('./operations'); + + +/** + * Checks whether a domain name in the cloudapp.azure.com zone is available for + * use. + * + * @param {string} location The location of the domain name. + * + * @param {string} domainNameLabel The domain name to be verified. It must + * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * + * @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 DnsNameAvailabilityResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkDnsNameAvailability(location, domainNameLabel, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (domainNameLabel === null || domainNameLabel === undefined || typeof domainNameLabel.valueOf() !== 'string') { + throw new Error('domainNameLabel 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.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}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('domainNameLabel=' + encodeURIComponent(domainNameLabel)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['DnsNameAvailabilityResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 NetworkManagementClient. */ +class NetworkManagementClient extends ServiceClient { + /** + * Create a NetworkManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + */ + constructor(credentials, subscriptionId, baseUri, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2018-02-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.applicationGateways = new operations.ApplicationGateways(this); + this.applicationSecurityGroups = new operations.ApplicationSecurityGroups(this); + this.ddosProtectionPlans = new operations.DdosProtectionPlans(this); + this.availableEndpointServices = new operations.AvailableEndpointServices(this); + this.expressRouteCircuitAuthorizations = new operations.ExpressRouteCircuitAuthorizations(this); + this.expressRouteCircuitPeerings = new operations.ExpressRouteCircuitPeerings(this); + this.expressRouteCircuitConnections = new operations.ExpressRouteCircuitConnections(this); + this.expressRouteCircuits = new operations.ExpressRouteCircuits(this); + this.expressRouteServiceProviders = new operations.ExpressRouteServiceProviders(this); + this.expressRouteCrossConnections = new operations.ExpressRouteCrossConnections(this); + this.expressRouteCrossConnectionPeerings = new operations.ExpressRouteCrossConnectionPeerings(this); + this.loadBalancers = new operations.LoadBalancers(this); + this.loadBalancerBackendAddressPools = new operations.LoadBalancerBackendAddressPools(this); + this.loadBalancerFrontendIPConfigurations = new operations.LoadBalancerFrontendIPConfigurations(this); + this.inboundNatRules = new operations.InboundNatRules(this); + this.loadBalancerLoadBalancingRules = new operations.LoadBalancerLoadBalancingRules(this); + this.loadBalancerNetworkInterfaces = new operations.LoadBalancerNetworkInterfaces(this); + this.loadBalancerProbes = new operations.LoadBalancerProbes(this); + this.networkInterfaces = new operations.NetworkInterfaces(this); + this.networkInterfaceIPConfigurations = new operations.NetworkInterfaceIPConfigurations(this); + this.networkInterfaceLoadBalancers = new operations.NetworkInterfaceLoadBalancers(this); + this.networkSecurityGroups = new operations.NetworkSecurityGroups(this); + this.securityRules = new operations.SecurityRules(this); + this.defaultSecurityRules = new operations.DefaultSecurityRules(this); + this.networkWatchers = new operations.NetworkWatchers(this); + this.packetCaptures = new operations.PacketCaptures(this); + this.connectionMonitors = new operations.ConnectionMonitors(this); + this.operations = new operations.Operations(this); + this.publicIPAddresses = new operations.PublicIPAddresses(this); + this.routeFilters = new operations.RouteFilters(this); + this.routeFilterRules = new operations.RouteFilterRules(this); + this.routeTables = new operations.RouteTables(this); + this.routes = new operations.Routes(this); + this.bgpServiceCommunities = new operations.BgpServiceCommunities(this); + this.usages = new operations.Usages(this); + this.virtualNetworks = new operations.VirtualNetworks(this); + this.subnets = new operations.Subnets(this); + this.virtualNetworkPeerings = new operations.VirtualNetworkPeerings(this); + this.virtualNetworkGateways = new operations.VirtualNetworkGateways(this); + this.virtualNetworkGatewayConnections = new operations.VirtualNetworkGatewayConnections(this); + this.localNetworkGateways = new operations.LocalNetworkGateways(this); + this.models = models; + this._checkDnsNameAvailability = _checkDnsNameAvailability; + msRest.addSerializationMixin(this); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for + * use. + * + * @param {string} location The location of the domain name. + * + * @param {string} domainNameLabel The domain name to be verified. It must + * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * + * @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. + */ + checkDnsNameAvailabilityWithHttpOperationResponse(location, domainNameLabel, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._checkDnsNameAvailability(location, domainNameLabel, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for + * use. + * + * @param {string} location The location of the domain name. + * + * @param {string} domainNameLabel The domain name to be verified. It must + * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * + * @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 {DnsNameAvailabilityResult} - 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 DnsNameAvailabilityResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkDnsNameAvailability(location, domainNameLabel, 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._checkDnsNameAvailability(location, domainNameLabel, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkDnsNameAvailability(location, domainNameLabel, options, optionalCallback); + } + } + +} + +module.exports = NetworkManagementClient; +module.exports['default'] = NetworkManagementClient; +module.exports.NetworkManagementClient = NetworkManagementClient; +module.exports.NetworkManagementModels = models; diff --git a/lib/services/networkManagement2/lib/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/lib/operations/applicationGateways.js new file mode 100644 index 0000000000..fd66cf450b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/applicationGateways.js @@ -0,0 +1,5326 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 _deleteMethod(resourceGroupName, applicationGatewayName, 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.beginDeleteMethod(resourceGroupName, applicationGatewayName, 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); + }); + }); +} + +/** + * Gets the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, applicationGatewayName, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + 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) { + 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['ApplicationGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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['ApplicationGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, applicationGatewayName, parameters, 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.beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, 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['ApplicationGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all application gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['ApplicationGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the application gateways in a subscription. + * + * @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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/applicationGateways'; + 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) { + 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['ApplicationGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 _start(resourceGroupName, applicationGatewayName, 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.beginStart(resourceGroupName, applicationGatewayName, 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); + }); + }); +} + + +/** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stop(resourceGroupName, applicationGatewayName, 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.beginStop(resourceGroupName, applicationGatewayName, 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); + }); + }); +} + + +/** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 ApplicationGatewayBackendHealth} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backendHealth(resourceGroupName, applicationGatewayName, 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.beginBackendHealth(resourceGroupName, applicationGatewayName, 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['ApplicationGatewayBackendHealth']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all available web application firewall rule sets. + * + * @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 + * ApplicationGatewayAvailableWafRuleSetsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAvailableWafRuleSets(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'; + 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) { + 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['ApplicationGatewayAvailableWafRuleSetsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists available Ssl options for configuring Ssl policy. + * + * @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 ApplicationGatewayAvailableSslOptions} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAvailableSslOptions(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'; + 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) { + 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['ApplicationGatewayAvailableSslOptions']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 + * ApplicationGatewayAvailableSslPredefinedPolicies} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAvailableSslPredefinedPolicies(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'; + 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) { + 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['ApplicationGatewayAvailableSslPredefinedPolicies']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets Ssl predefined policy with the specified policy name. + * + * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * + * @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 ApplicationGatewaySslPredefinedPolicy} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSslPredefinedPolicy(predefinedPolicyName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (predefinedPolicyName === null || predefinedPolicyName === undefined || typeof predefinedPolicyName.valueOf() !== 'string') { + throw new Error('predefinedPolicyName cannot be null or undefined and it must be of type string.'); + } + if (this.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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{predefinedPolicyName}', encodeURIComponent(predefinedPolicyName)); + 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) { + 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['ApplicationGatewaySslPredefinedPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 _beginDeleteMethod(resourceGroupName, applicationGatewayName, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplicationGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ApplicationGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationGateway']().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); + }); +} + +/** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 _beginStart(resourceGroupName, applicationGatewayName, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 _beginStop(resourceGroupName, applicationGatewayName, 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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationGateways/{applicationGatewayName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 ApplicationGatewayBackendHealth} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginBackendHealth(resourceGroupName, applicationGatewayName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { + throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/applicationGateways/{applicationGatewayName}/backendhealth'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['ApplicationGatewayBackendHealth']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all application gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationGatewayListResult} for more + * information. + * + * {object} [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) { + 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['ApplicationGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the application gateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['ApplicationGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 + * ApplicationGatewayAvailableSslPredefinedPolicies} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAvailableSslPredefinedPoliciesNext(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) { + 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['ApplicationGatewayAvailableSslPredefinedPolicies']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ApplicationGateways. */ +class ApplicationGateways { + /** + * Create a ApplicationGateways. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._list = _list; + this._listAll = _listAll; + this._start = _start; + this._stop = _stop; + this._backendHealth = _backendHealth; + this._listAvailableWafRuleSets = _listAvailableWafRuleSets; + this._listAvailableSslOptions = _listAvailableSslOptions; + this._listAvailableSslPredefinedPolicies = _listAvailableSslPredefinedPolicies; + this._getSslPredefinedPolicy = _getSslPredefinedPolicy; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginStart = _beginStart; + this._beginStop = _beginStop; + this._beginBackendHealth = _beginBackendHealth; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + this._listAvailableSslPredefinedPoliciesNext = _listAvailableSslPredefinedPoliciesNext; + } + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + deleteMethod(resourceGroupName, applicationGatewayName, 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._deleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Gets the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 {ApplicationGateway} - 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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, applicationGatewayName, 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._get(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationGateway} - 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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationGateway} - 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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, applicationGatewayName, parameters, 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._updateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Lists all application gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all the application gateways in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the application gateways in 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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + start(resourceGroupName, applicationGatewayName, 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._start(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + stop(resourceGroupName, applicationGatewayName, 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._stop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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. + */ + backendHealthWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._backendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 {ApplicationGatewayBackendHealth} - 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 ApplicationGatewayBackendHealth} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backendHealth(resourceGroupName, applicationGatewayName, 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._backendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backendHealth(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Lists all available web application firewall rule sets. + * + * @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. + */ + listAvailableWafRuleSetsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableWafRuleSets(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @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 {ApplicationGatewayAvailableWafRuleSetsResult} - 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 + * ApplicationGatewayAvailableWafRuleSetsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAvailableWafRuleSets(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._listAvailableWafRuleSets(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableWafRuleSets(options, optionalCallback); + } + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @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. + */ + listAvailableSslOptionsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSslOptions(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslOptions} - 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 ApplicationGatewayAvailableSslOptions} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAvailableSslOptions(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._listAvailableSslOptions(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSslOptions(options, optionalCallback); + } + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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. + */ + listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSslPredefinedPolicies(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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 + * ApplicationGatewayAvailableSslPredefinedPolicies} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAvailableSslPredefinedPolicies(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._listAvailableSslPredefinedPolicies(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSslPredefinedPolicies(options, optionalCallback); + } + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * + * @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. + */ + getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSslPredefinedPolicy(predefinedPolicyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * + * @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 {ApplicationGatewaySslPredefinedPolicy} - 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 ApplicationGatewaySslPredefinedPolicy} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSslPredefinedPolicy(predefinedPolicyName, 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._getSslPredefinedPolicy(predefinedPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSslPredefinedPolicy(predefinedPolicyName, options, optionalCallback); + } + } + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, applicationGatewayName, 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._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationGateway} - 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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationGateway} - 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 ApplicationGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStart(resourceGroupName, applicationGatewayName, 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._beginStart(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStop(resourceGroupName, applicationGatewayName, 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._beginStop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStop(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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. + */ + beginBackendHealthWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginBackendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 {ApplicationGatewayBackendHealth} - 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 ApplicationGatewayBackendHealth} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginBackendHealth(resourceGroupName, applicationGatewayName, 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._beginBackendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginBackendHealth(resourceGroupName, applicationGatewayName, options, optionalCallback); + } + } + + /** + * Lists all application gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the application gateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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. + */ + listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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 + * ApplicationGatewayAvailableSslPredefinedPolicies} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAvailableSslPredefinedPoliciesNext(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._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ApplicationGateways; diff --git a/lib/services/networkManagement2/lib/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/lib/operations/applicationSecurityGroups.js new file mode 100644 index 0000000000..e72d672519 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/applicationSecurityGroups.js @@ -0,0 +1,1995 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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 _deleteMethod(resourceGroupName, applicationSecurityGroupName, 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.beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, 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); + }); + }); +} + +/** + * Gets information about the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, applicationSecurityGroupName, 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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { + throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationSecurityGroups/{applicationSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); + 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) { + 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['ApplicationSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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['ApplicationSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all application security groups in a subscription. + * + * @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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/applicationSecurityGroups'; + 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) { + 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['ApplicationSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the application security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationSecurityGroups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['ApplicationSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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 _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, 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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { + throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationSecurityGroups/{applicationSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { + throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/applicationSecurityGroups/{applicationSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplicationSecurityGroup']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ApplicationSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationSecurityGroup']().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); + }); +} + +/** + * Gets all application security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['ApplicationSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the application security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [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) { + 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['ApplicationSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ApplicationSecurityGroups. */ +class ApplicationSecurityGroups { + /** + * Create a ApplicationSecurityGroups. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._listAll = _listAll; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + } + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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. + */ + deleteMethod(resourceGroupName, applicationSecurityGroupName, 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._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); + } + } + + /** + * Gets information about the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, applicationSecurityGroupName, 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._get(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Gets all application security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all application security groups in 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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, 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._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Gets all application security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ApplicationSecurityGroups; diff --git a/lib/services/networkManagement2/lib/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/lib/operations/availableEndpointServices.js new file mode 100644 index 0000000000..e4a6dec6fd --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/availableEndpointServices.js @@ -0,0 +1,467 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * List what values of endpoint services are available for use. + * + * @param {string} location The location to check available endpoint services. + * + * @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 EndpointServicesListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, 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 (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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) { + 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['EndpointServicesListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List what values of endpoint services are available for use. + * + * @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 EndpointServicesListResult} for more + * information. + * + * {object} [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) { + 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['EndpointServicesListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AvailableEndpointServices. */ +class AvailableEndpointServices { + /** + * Create a AvailableEndpointServices. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * List what values of endpoint services are available for use. + * + * @param {string} location The location to check available endpoint services. + * + * @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. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param {string} location The location to check available endpoint services. + * + * @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 {EndpointServicesListResult} - 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 EndpointServicesListResult} for more + * information. + * + * {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(location, 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(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + + /** + * List what values of endpoint services are available for use. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @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 {EndpointServicesListResult} - 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 EndpointServicesListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AvailableEndpointServices; diff --git a/lib/services/networkManagement2/lib/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/lib/operations/bgpServiceCommunities.js new file mode 100644 index 0000000000..444d0a15e7 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/bgpServiceCommunities.js @@ -0,0 +1,457 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the available bgp service communities. + * + * @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 BgpServiceCommunityListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/bgpServiceCommunities'; + 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) { + 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['BgpServiceCommunityListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the available bgp service communities. + * + * @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 BgpServiceCommunityListResult} for more + * information. + * + * {object} [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) { + 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['BgpServiceCommunityListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 BgpServiceCommunities. */ +class BgpServiceCommunities { + /** + * Create a BgpServiceCommunities. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets all the available bgp service communities. + * + * @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. + */ + 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; + }); + }); + } + + /** + * Gets all the available bgp service communities. + * + * @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 {BgpServiceCommunityListResult} - 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 BgpServiceCommunityListResult} for more + * information. + * + * {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); + } + } + + /** + * Gets all the available bgp service communities. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the available bgp service communities. + * + * @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 {BgpServiceCommunityListResult} - 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 BgpServiceCommunityListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = BgpServiceCommunities; diff --git a/lib/services/networkManagement2/lib/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/lib/operations/connectionMonitors.js new file mode 100644 index 0000000000..709e8f1564 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/connectionMonitors.js @@ -0,0 +1,2760 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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['ConnectionMonitorResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a connection monitor by name. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkWatcherName, connectionMonitorName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + 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) { + 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['ConnectionMonitorResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 _deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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.beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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); + }); + }); +} + + +/** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stop(resourceGroupName, networkWatcherName, connectionMonitorName, 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.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, 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); + }); + }); +} + + +/** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 _start(resourceGroupName, networkWatcherName, connectionMonitorName, 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.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, 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); + }); + }); +} + + +/** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 ConnectionMonitorQueryResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _query(resourceGroupName, networkWatcherName, connectionMonitorName, 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.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, 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['ConnectionMonitorQueryResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 ConnectionMonitorListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkWatcherName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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) { + 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['ConnectionMonitorListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ConnectionMonitor']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ConnectionMonitorResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ConnectionMonitorResult']().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); + }); +} + +/** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + 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 !== 202 && 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); + }); +} + +/** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 _beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 ConnectionMonitorQueryResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { + throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ConnectionMonitorQueryResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ConnectionMonitorQueryResult']().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); + }); +} + +/** Class representing a ConnectionMonitors. */ +class ConnectionMonitors { + /** + * Create a ConnectionMonitors. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._stop = _stop; + this._start = _start; + this._query = _query; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginStop = _beginStop; + this._beginStart = _beginStart; + this._beginQuery = _beginQuery; + } + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, optionalCallback); + } + } + + /** + * Gets a connection monitor by name. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a connection monitor by name. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkWatcherName, connectionMonitorName, 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._get(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + stop(resourceGroupName, networkWatcherName, connectionMonitorName, 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._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + start(resourceGroupName, networkWatcherName, connectionMonitorName, 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._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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. + */ + queryWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 {ConnectionMonitorQueryResult} - 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 ConnectionMonitorQueryResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + query(resourceGroupName, networkWatcherName, connectionMonitorName, 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._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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. + */ + listWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 {ConnectionMonitorListResult} - 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 ConnectionMonitorListResult} for more + * information. + * + * {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(resourceGroupName, networkWatcherName, 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(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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. + */ + beginQueryWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 {ConnectionMonitorQueryResult} - 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 ConnectionMonitorQueryResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); + } + } + +} + +module.exports = ConnectionMonitors; diff --git a/lib/services/networkManagement2/lib/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/lib/operations/ddosProtectionPlans.js new file mode 100644 index 0000000000..aa2e109e9d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/ddosProtectionPlans.js @@ -0,0 +1,1974 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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 _deleteMethod(resourceGroupName, ddosProtectionPlanName, 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.beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, 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); + }); + }); +} + +/** + * Gets information about the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, ddosProtectionPlanName, 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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { + throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/ddosProtectionPlans/{ddosProtectionPlanName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); + 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) { + 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['DdosProtectionPlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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['DdosProtectionPlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all DDoS protection plans in a subscription. + * + * @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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/ddosProtectionPlans'; + 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) { + 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['DdosProtectionPlanListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/ddosProtectionPlans'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['DdosProtectionPlanListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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 _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, 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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { + throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/ddosProtectionPlans/{ddosProtectionPlanName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { + throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/ddosProtectionPlans/{ddosProtectionPlanName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DdosProtectionPlan']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['DdosProtectionPlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DdosProtectionPlan']().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); + }); +} + +/** + * Gets all DDoS protection plans in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [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) { + 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['DdosProtectionPlanListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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) { + 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['DdosProtectionPlanListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 DdosProtectionPlans. */ +class DdosProtectionPlans { + /** + * Create a DdosProtectionPlans. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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. + */ + deleteMethod(resourceGroupName, ddosProtectionPlanName, 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._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); + } + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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 {DdosProtectionPlan} - 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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, ddosProtectionPlanName, 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._get(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); + } + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {DdosProtectionPlan} - 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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, optionalCallback); + } + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Gets all DDoS protection plans in 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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} for more + * information. + * + * {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); + } + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, 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._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); + } + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {DdosProtectionPlan} - 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 DdosProtectionPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, optionalCallback); + } + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DdosProtectionPlans; diff --git a/lib/services/networkManagement2/lib/lib/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/lib/operations/defaultSecurityRules.js new file mode 100644 index 0000000000..19435f09e3 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/defaultSecurityRules.js @@ -0,0 +1,728 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all default security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 SecurityRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkSecurityGroupName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + 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) { + 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['SecurityRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified default network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} defaultSecurityRuleName The name of the default security + * rule. + * + * @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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (defaultSecurityRuleName === null || defaultSecurityRuleName === undefined || typeof defaultSecurityRuleName.valueOf() !== 'string') { + throw new Error('defaultSecurityRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{defaultSecurityRuleName}', encodeURIComponent(defaultSecurityRuleName)); + 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) { + 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['SecurityRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all default security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 SecurityRuleListResult} for more + * information. + * + * {object} [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) { + 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['SecurityRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 DefaultSecurityRules. */ +class DefaultSecurityRules { + /** + * Create a DefaultSecurityRules. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Gets all default security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} for more + * information. + * + * {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(resourceGroupName, networkSecurityGroupName, 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(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkSecurityGroupName, options, optionalCallback); + } + } + + /** + * Get the specified default network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} defaultSecurityRuleName The name of the default security + * rule. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified default network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} defaultSecurityRuleName The name of the default security + * rule. + * + * @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 {SecurityRule} - 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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, 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._get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options, optionalCallback); + } + } + + /** + * Gets all default security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {SecurityRuleListResult} - 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 SecurityRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DefaultSecurityRules; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitAuthorizations.js new file mode 100644 index 0000000000..52d2037c8b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitAuthorizations.js @@ -0,0 +1,1676 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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 _deleteMethod(resourceGroupName, circuitName, authorizationName, 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.beginDeleteMethod(resourceGroupName, circuitName, authorizationName, 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); + }); + }); +} + +/** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, circuitName, authorizationName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { + throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); + 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) { + 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['ExpressRouteCircuitAuthorization']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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['ExpressRouteCircuitAuthorization']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all authorizations in an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @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 AuthorizationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, circuitName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/authorizations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + 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) { + 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['AuthorizationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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 _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { + throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { + throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); + } + if (authorizationParameters === null || authorizationParameters === undefined) { + throw new Error('authorizationParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (authorizationParameters !== null && authorizationParameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCircuitAuthorization']().mapper(); + requestModel = client.serialize(requestModelMapper, authorizationParameters, 'authorizationParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(authorizationParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ExpressRouteCircuitAuthorization']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCircuitAuthorization']().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); + }); +} + +/** + * Gets all authorizations in an express route circuit. + * + * @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 AuthorizationListResult} for more + * information. + * + * {object} [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) { + 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['AuthorizationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteCircuitAuthorizations. */ +class ExpressRouteCircuitAuthorizations { + /** + * Create a ExpressRouteCircuitAuthorizations. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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. + */ + deleteMethod(resourceGroupName, circuitName, authorizationName, 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._deleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, circuitName, authorizationName, options, optionalCallback); + } + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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 {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, circuitName, authorizationName, 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._get(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, circuitName, authorizationName, options, optionalCallback); + } + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, authorizationParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, optionalCallback); + } + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @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 {AuthorizationListResult} - 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 AuthorizationListResult} for more + * information. + * + * {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(resourceGroupName, circuitName, 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(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, circuitName, authorizationName, 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._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, optionalCallback); + } + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, authorizationParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, optionalCallback); + } + } + + /** + * Gets all authorizations in an express route circuit. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @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 {AuthorizationListResult} - 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 AuthorizationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCircuitAuthorizations; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitConnections.js new file mode 100644 index 0000000000..996630c055 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitConnections.js @@ -0,0 +1,1348 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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 _deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, 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.beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, 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); + }); + }); +} + +/** + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, circuitName, peeringName, connectionName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + 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) { + 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['ExpressRouteCircuitConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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['ExpressRouteCircuitConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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 _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (expressRouteCircuitConnectionParameters === null || expressRouteCircuitConnectionParameters === undefined) { + throw new Error('expressRouteCircuitConnectionParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (expressRouteCircuitConnectionParameters !== null && expressRouteCircuitConnectionParameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCircuitConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, expressRouteCircuitConnectionParameters, 'expressRouteCircuitConnectionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(expressRouteCircuitConnectionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ExpressRouteCircuitConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCircuitConnection']().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); + }); +} + +/** Class representing a ExpressRouteCircuitConnections. */ +class ExpressRouteCircuitConnections { + /** + * Create a ExpressRouteCircuitConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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. + */ + deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, 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._deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); + } + } + + /** + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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 {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, circuitName, peeringName, connectionName, 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._get(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); + } + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, optionalCallback); + } + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, 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._beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); + } + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCircuitConnections; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitPeerings.js new file mode 100644 index 0000000000..1647d432da --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitPeerings.js @@ -0,0 +1,2330 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 _deleteMethod(resourceGroupName, circuitName, peeringName, 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.beginDeleteMethod(resourceGroupName, circuitName, peeringName, 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); + }); + }); +} + +/** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, circuitName, peeringName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + 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) { + 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['ExpressRouteCircuitPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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['ExpressRouteCircuitPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all peerings in a specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, circuitName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + 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) { + 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['ExpressRouteCircuitPeeringListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 _beginDeleteMethod(resourceGroupName, circuitName, peeringName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (peeringParameters === null || peeringParameters === undefined) { + throw new Error('peeringParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (peeringParameters !== null && peeringParameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCircuitPeering']().mapper(); + requestModel = client.serialize(requestModelMapper, peeringParameters, 'peeringParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(peeringParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ExpressRouteCircuitPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCircuitPeering']().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); + }); +} + +/** + * Gets all peerings in a specified express route circuit. + * + * @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 ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {object} [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) { + 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['ExpressRouteCircuitPeeringListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteCircuitPeerings. */ +class ExpressRouteCircuitPeerings { + /** + * Create a ExpressRouteCircuitPeerings. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + deleteMethod(resourceGroupName, circuitName, peeringName, 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._deleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, circuitName, peeringName, options, optionalCallback); + } + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, circuitName, peeringName, 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._get(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, circuitName, peeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, peeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, optionalCallback); + } + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 {ExpressRouteCircuitPeeringListResult} - 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 ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {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(resourceGroupName, circuitName, 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(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, circuitName, peeringName, 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._beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, peeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, optionalCallback); + } + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @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 {ExpressRouteCircuitPeeringListResult} - 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 ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCircuitPeerings; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuits.js new file mode 100644 index 0000000000..2ec0768228 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCircuits.js @@ -0,0 +1,4511 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 _deleteMethod(resourceGroupName, circuitName, 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.beginDeleteMethod(resourceGroupName, circuitName, 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); + }); + }); +} + +/** + * Gets information about the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of express route circuit. + * + * @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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, circuitName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + 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) { + 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['ExpressRouteCircuit']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, circuitName, parameters, 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.beginCreateOrUpdate(resourceGroupName, circuitName, parameters, 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['ExpressRouteCircuit']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, circuitName, parameters, 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.beginUpdateTags(resourceGroupName, circuitName, parameters, 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['ExpressRouteCircuit']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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['ExpressRouteCircuitsArpTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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['ExpressRouteCircuitsRoutesTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 + * ExpressRouteCircuitsRoutesTableSummaryListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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['ExpressRouteCircuitsRoutesTableSummaryListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all the stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 ExpressRouteCircuitStats} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStats(resourceGroupName, circuitName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/stats'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + 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) { + 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['ExpressRouteCircuitStats']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 ExpressRouteCircuitStats} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getPeeringStats(resourceGroupName, circuitName, peeringName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + 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) { + 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['ExpressRouteCircuitStats']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['ExpressRouteCircuitListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the express route circuits in a subscription. + * + * @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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/expressRouteCircuits'; + 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) { + 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['ExpressRouteCircuitListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 _beginDeleteMethod(resourceGroupName, circuitName, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCircuit']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ExpressRouteCircuit']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCircuit']().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); + }); +} + +/** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, circuitName, parameters, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCircuit']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCircuitsArpTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCircuitsRoutesTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 + * ExpressRouteCircuitsRoutesTableSummaryListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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 (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { + throw new Error('circuitName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCircuitsRoutesTableSummaryListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the express route circuits in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [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) { + 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['ExpressRouteCircuitListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the express route circuits in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['ExpressRouteCircuitListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteCircuits. */ +class ExpressRouteCircuits { + /** + * Create a ExpressRouteCircuits. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listArpTable = _listArpTable; + this._listRoutesTable = _listRoutesTable; + this._listRoutesTableSummary = _listRoutesTableSummary; + this._getStats = _getStats; + this._getPeeringStats = _getPeeringStats; + this._list = _list; + this._listAll = _listAll; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginListArpTable = _beginListArpTable; + this._beginListRoutesTable = _beginListRoutesTable; + this._beginListRoutesTableSummary = _beginListRoutesTableSummary; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + } + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + deleteMethod(resourceGroupName, circuitName, 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._deleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Gets information about the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of express route circuit. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of express route circuit. + * + * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, circuitName, 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._get(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, circuitName, parameters, 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._createOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, circuitName, parameters, options, optionalCallback); + } + } + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuit} - 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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, circuitName, parameters, 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._updateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, circuitName, parameters, options, optionalCallback); + } + } + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listArpTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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 + * ExpressRouteCircuitsRoutesTableSummaryListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + getStatsWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getStats(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 {ExpressRouteCircuitStats} - 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 ExpressRouteCircuitStats} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getStats(resourceGroupName, circuitName, 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._getStats(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getStats(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + getPeeringStatsWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPeeringStats(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCircuitStats} - 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 ExpressRouteCircuitStats} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPeeringStats(resourceGroupName, circuitName, peeringName, 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._getPeeringStats(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPeeringStats(resourceGroupName, circuitName, peeringName, options, optionalCallback); + } + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the express route circuits in 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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, circuitName, 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._beginDeleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, circuitName, options, optionalCallback); + } + } + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, circuitName, parameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, optionalCallback); + } + } + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCircuit} - 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 ExpressRouteCircuit} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, circuitName, parameters, 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._beginUpdateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, circuitName, parameters, options, optionalCallback); + } + } + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListArpTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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 + * ExpressRouteCircuitsRoutesTableSummaryListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCircuits; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnectionPeerings.js new file mode 100644 index 0000000000..3a8e0f4b02 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnectionPeerings.js @@ -0,0 +1,2150 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @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 ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, crossConnectionName, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + 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) { + 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['ExpressRouteCrossConnectionPeeringList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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 _deleteMethod(resourceGroupName, crossConnectionName, peeringName, 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.beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, 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); + }); + }); +} + +/** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, crossConnectionName, peeringName, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + 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) { + 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['ExpressRouteCrossConnectionPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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['ExpressRouteCrossConnectionPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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 _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (peeringParameters === null || peeringParameters === undefined) { + throw new Error('peeringParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (peeringParameters !== null && peeringParameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCrossConnectionPeering']().mapper(); + requestModel = client.serialize(requestModelMapper, peeringParameters, 'peeringParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(peeringParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ExpressRouteCrossConnectionPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCrossConnectionPeering']().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); + }); +} + +/** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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 ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {object} [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) { + 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['ExpressRouteCrossConnectionPeeringList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteCrossConnectionPeerings. */ +class ExpressRouteCrossConnectionPeerings { + /** + * Create a ExpressRouteCrossConnectionPeerings. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, crossConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, crossConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @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 {ExpressRouteCrossConnectionPeeringList} - 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 ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {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(resourceGroupName, crossConnectionName, 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(resourceGroupName, crossConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, crossConnectionName, options, optionalCallback); + } + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + deleteMethod(resourceGroupName, crossConnectionName, peeringName, 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._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); + } + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, crossConnectionName, peeringName, 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._get(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, optionalCallback); + } + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, 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._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, optionalCallback); + } + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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 {ExpressRouteCrossConnectionPeeringList} - 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 ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCrossConnectionPeerings; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnections.js new file mode 100644 index 0000000000..aa4f1a8d0d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnections.js @@ -0,0 +1,3466 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/expressRouteCrossConnections'; + 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) { + 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['ExpressRouteCrossConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['ExpressRouteCrossConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection (service key of the circuit). + * + * @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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, crossConnectionName, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + 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) { + 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['ExpressRouteCrossConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, crossConnectionName, parameters, 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.beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, 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['ExpressRouteCrossConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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.beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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['ExpressRouteCrossConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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['ExpressRouteCircuitsArpTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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['ExpressRouteCrossConnectionsRoutesTableSummaryListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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['ExpressRouteCircuitsRoutesTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ExpressRouteCrossConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCrossConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (crossConnectionParameters === null || crossConnectionParameters === undefined) { + throw new Error('crossConnectionParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (crossConnectionParameters !== null && crossConnectionParameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, crossConnectionParameters, 'crossConnectionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(crossConnectionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ExpressRouteCrossConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCircuitsArpTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCrossConnectionsRoutesTableSummaryListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { + throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); + } + if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { + throw new Error('peeringName cannot be null or undefined and it must be of type string.'); + } + if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { + throw new Error('devicePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); + requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); + requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ExpressRouteCircuitsRoutesTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [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) { + 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['ExpressRouteCrossConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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) { + 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['ExpressRouteCrossConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteCrossConnections. */ +class ExpressRouteCrossConnections { + /** + * Create a ExpressRouteCrossConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listArpTable = _listArpTable; + this._listRoutesTableSummary = _listRoutesTableSummary; + this._listRoutesTable = _listRoutesTable; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginListArpTable = _beginListArpTable; + this._beginListRoutesTableSummary = _beginListRoutesTableSummary; + this._beginListRoutesTable = _beginListRoutesTable; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in 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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {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); + } + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection (service key of the circuit). + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, crossConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, crossConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection (service key of the circuit). + * + * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, crossConnectionName, 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._get(resourceGroupName, crossConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, crossConnectionName, options, optionalCallback); + } + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, crossConnectionName, parameters, 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._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, optionalCallback); + } + } + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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. + */ + listArpTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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 + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, 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._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, optionalCallback); + } + } + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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. + */ + beginListArpTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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 + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); + } + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteCrossConnections; diff --git a/lib/services/networkManagement2/lib/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/lib/operations/expressRouteServiceProviders.js new file mode 100644 index 0000000000..c0c647acd9 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/expressRouteServiceProviders.js @@ -0,0 +1,457 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the available express route service providers. + * + * @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 ExpressRouteServiceProviderListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/expressRouteServiceProviders'; + 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) { + 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['ExpressRouteServiceProviderListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the available express route service providers. + * + * @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 ExpressRouteServiceProviderListResult} for + * more information. + * + * {object} [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) { + 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['ExpressRouteServiceProviderListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ExpressRouteServiceProviders. */ +class ExpressRouteServiceProviders { + /** + * Create a ExpressRouteServiceProviders. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets all the available express route service providers. + * + * @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. + */ + 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; + }); + }); + } + + /** + * Gets all the available express route service providers. + * + * @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 {ExpressRouteServiceProviderListResult} - 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 ExpressRouteServiceProviderListResult} for + * more information. + * + * {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); + } + } + + /** + * Gets all the available express route service providers. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the available express route service providers. + * + * @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 {ExpressRouteServiceProviderListResult} - 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 ExpressRouteServiceProviderListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ExpressRouteServiceProviders; diff --git a/lib/services/networkManagement2/lib/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/lib/operations/inboundNatRules.js new file mode 100644 index 0000000000..df67087433 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/inboundNatRules.js @@ -0,0 +1,1815 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 InboundNatRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/inboundNatRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['InboundNatRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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 _deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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.beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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); + }); + }); +} + +/** + * Gets the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, inboundNatRuleName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { + throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InboundNatRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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['InboundNatRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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 _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { + throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { + throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); + } + if (inboundNatRuleParameters === null || inboundNatRuleParameters === undefined) { + throw new Error('inboundNatRuleParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (inboundNatRuleParameters !== null && inboundNatRuleParameters !== undefined) { + let requestModelMapper = new client.models['InboundNatRule']().mapper(); + requestModel = client.serialize(requestModelMapper, inboundNatRuleParameters, 'inboundNatRuleParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(inboundNatRuleParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['InboundNatRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InboundNatRule']().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); + }); +} + +/** + * Gets all the inbound nat rules in a load balancer. + * + * @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 InboundNatRuleListResult} for more + * information. + * + * {object} [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) { + 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['InboundNatRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 InboundNatRules. */ +class InboundNatRules { + /** + * Create a InboundNatRules. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {InboundNatRuleListResult} - 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 InboundNatRuleListResult} for more + * information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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. + */ + deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); + } + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {InboundNatRule} - 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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, inboundNatRuleName, 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._get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); + } + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InboundNatRule} - 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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, optionalCallback); + } + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); + } + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InboundNatRule} - 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 InboundNatRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, optionalCallback); + } + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @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 {InboundNatRuleListResult} - 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 InboundNatRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = InboundNatRules; diff --git a/lib/services/networkManagement2/lib/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/lib/operations/index.d.ts new file mode 100644 index 0000000000..296df33692 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/index.d.ts @@ -0,0 +1,30651 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * ApplicationGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ApplicationGateways { + + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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 {ApplicationGateway} - 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. + * + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGateway} - 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. + * + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGateway} - 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. + * + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} 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. + */ + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all application gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all application gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGatewayListResult} - 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. + * + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the application gateways in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the application gateways in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGatewayListResult} - 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. + * + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + start(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + stop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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. + */ + backendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 {ApplicationGatewayBackendHealth} - 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. + * + * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayBackendHealth} 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. + */ + backendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + backendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + backendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available web application firewall rule sets. + * + * @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. + */ + listAvailableWafRuleSetsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available web application firewall rule sets. + * + * @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 {ApplicationGatewayAvailableWafRuleSetsResult} - 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. + * + * {ApplicationGatewayAvailableWafRuleSetsResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ApplicationGatewayAvailableWafRuleSetsResult} 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. + */ + listAvailableWafRuleSets(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableWafRuleSets(callback: ServiceCallback): void; + listAvailableWafRuleSets(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @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. + */ + listAvailableSslOptionsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslOptions} - 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. + * + * {ApplicationGatewayAvailableSslOptions} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayAvailableSslOptions} 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. + */ + listAvailableSslOptions(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslOptions(callback: ServiceCallback): void; + listAvailableSslOptions(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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. + */ + listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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. + * + * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link + * ApplicationGatewayAvailableSslPredefinedPolicies} 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. + */ + listAvailableSslPredefinedPolicies(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslPredefinedPolicies(callback: ServiceCallback): void; + listAvailableSslPredefinedPolicies(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * + * @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. + */ + getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * + * @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 {ApplicationGatewaySslPredefinedPolicy} - 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. + * + * {ApplicationGatewaySslPredefinedPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewaySslPredefinedPolicy} 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. + */ + getSslPredefinedPolicy(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSslPredefinedPolicy(predefinedPolicyName: string, callback: ServiceCallback): void; + getSslPredefinedPolicy(predefinedPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. + * + * @param {object} [parameters.sku] SKU of the application gateway resource. + * + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF' + * + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. + * + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. + * + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. + * + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' + * + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. + * + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. + * + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. + * + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. + * + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. + * + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. + * + * @param {array} [parameters.probes] Probes of the application gateway + * resource. + * + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. + * + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. + * + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGateway} - 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. + * + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified application gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} parameters Parameters supplied to update application gateway + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGateway} - 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. + * + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} 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. + */ + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts the specified application gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStart(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops the specified application gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @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. + */ + beginStop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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. + */ + beginBackendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the backend health of the specified application gateway in a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * + * @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 {ApplicationGatewayBackendHealth} - 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. + * + * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayBackendHealth} 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. + */ + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all application gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all application gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGatewayListResult} - 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. + * + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the application gateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the application gateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationGatewayListResult} - 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. + * + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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. + */ + listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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. + * + * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link + * ApplicationGatewayAvailableSslPredefinedPolicies} 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. + */ + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, callback: ServiceCallback): void; + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ApplicationSecurityGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ApplicationSecurityGroups { + + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroup} - 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. + * + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroup} - 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. + * + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all application security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all application security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroupListResult} - 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. + * + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroupListResult} - 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. + * + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an application security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroup} - 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. + * + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all application security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all application security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroupListResult} - 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. + * + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the application security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationSecurityGroupListResult} - 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. + * + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DdosProtectionPlans + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface DdosProtectionPlans { + + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @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 {DdosProtectionPlan} - 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. + * + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlan} - 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. + * + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlanListResult} - 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. + * + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlanListResult} - 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. + * + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a DDoS protection plan. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlan} - 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. + * + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlanListResult} - 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. + * + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DdosProtectionPlanListResult} - 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. + * + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AvailableEndpointServices + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface AvailableEndpointServices { + + + /** + * List what values of endpoint services are available for use. + * + * @param {string} location The location to check available endpoint services. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List what values of endpoint services are available for use. + * + * @param {string} location The location to check available endpoint services. + * + * @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 {EndpointServicesListResult} - 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. + * + * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EndpointServicesListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List what values of endpoint services are available for use. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List what values of endpoint services are available for use. + * + * @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 {EndpointServicesListResult} - 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. + * + * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EndpointServicesListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCircuitAuthorizations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuitAuthorizations { + + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @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 {ExpressRouteCircuitAuthorization} - 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. + * + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitAuthorization} - 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. + * + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all authorizations in an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all authorizations in an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @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 {AuthorizationListResult} - 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. + * + * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified authorization from the specified express route + * circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitAuthorization} - 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. + * + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all authorizations in an express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all authorizations in an express route circuit. + * + * @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 {AuthorizationListResult} - 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. + * + * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCircuitPeerings + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuitPeerings { + + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCircuitPeering} - 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. + * + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitPeering} - 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. + * + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all peerings in a specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all peerings in a specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 {ExpressRouteCircuitPeeringListResult} - 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. + * + * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitPeering} - 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. + * + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all peerings in a specified express route circuit. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all peerings in a specified express route circuit. + * + * @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 {ExpressRouteCircuitPeeringListResult} - 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. + * + * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeeringListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCircuitConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuitConnections { + + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @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 {ExpressRouteCircuitConnection} - 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. + * + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitConnection} - 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. + * + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * + * @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 {ExpressRouteCircuitConnection} - 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. + * + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCircuits + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuits { + + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of express route circuit. + * + * @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 {ExpressRouteCircuit} - 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. + * + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuit} - 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. + * + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuit} - 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. + * + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} 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. + */ + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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. + * + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} 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. + */ + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * 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. + */ + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. + */ + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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. + */ + getStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @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 {ExpressRouteCircuitStats} - 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. + * + * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitStats} 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. + */ + getStats(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStats(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + getStats(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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. + */ + getPeeringStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCircuitStats} - 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. + * + * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitStats} 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. + */ + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuitListResult} - 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. + * + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the express route circuits in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the express route circuits in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuitListResult} - 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. + * + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuit} - 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. + * + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an express route circuit tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuit} - 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. + * + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} 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. + */ + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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. + * + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} 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. + */ + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * 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. + */ + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. + */ + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the express route circuits in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuitListResult} - 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. + * + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the express route circuits in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the express route circuits in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCircuitListResult} - 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. + * + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteServiceProviders + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteServiceProviders { + + + /** + * Gets all the available express route service providers. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the available express route service providers. + * + * @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 {ExpressRouteServiceProviderListResult} - 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. + * + * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteServiceProviderListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the available express route service providers. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the available express route service providers. + * + * @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 {ExpressRouteServiceProviderListResult} - 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. + * + * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteServiceProviderListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCrossConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCrossConnections { + + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnectionListResult} - 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. + * + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnectionListResult} - 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. + * + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection (service key of the circuit). + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection (service key of the circuit). + * + * @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 {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} 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. + */ + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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. + */ + listArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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. + * + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} 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. + */ + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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. + * + * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * 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. + */ + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + listRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * 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. + */ + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an express route cross connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} 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. + */ + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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. + */ + beginListArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * + * @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 {ExpressRouteCircuitsArpTableListResult} - 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. + * + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} 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. + */ + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the route table summary associated with the express route cross + * connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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. + * + * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * 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. + */ + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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. + */ + beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device. + * + * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. + * + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * 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. + */ + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnectionListResult} - 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. + * + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ExpressRouteCrossConnectionListResult} - 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. + * + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCrossConnectionPeerings + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCrossConnectionPeerings { + + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @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 {ExpressRouteCrossConnectionPeeringList} - 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. + * + * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @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 {ExpressRouteCrossConnectionPeering} - 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. + * + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 {ExpressRouteCrossConnectionPeering} - 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. + * + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. + * + * @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 {ExpressRouteCrossConnectionPeering} - 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. + * + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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 {ExpressRouteCrossConnectionPeeringList} - 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. + * + * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeeringList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancers + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancers { + + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancer} - 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. + * + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancer} - 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. + * + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancer} - 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. + * + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} 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. + */ + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancers in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancers in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancerListResult} - 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. + * + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancerListResult} - 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. + * + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancer} - 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. + * + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancer} - 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. + * + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} 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. + */ + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancers in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancers in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancerListResult} - 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. + * + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancerListResult} - 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. + * + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerBackendAddressPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerBackendAddressPools { + + + /** + * Gets all the load balancer backed address pools. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer backed address pools. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerBackendAddressPoolListResult} - 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. + * + * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets load balancer backend address pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} backendAddressPoolName The name of the backend address pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets load balancer backend address pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} backendAddressPoolName The name of the backend address pool. + * + * @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 {BackendAddressPool} - 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. + * + * {BackendAddressPool} [result] - The deserialized result object if an error did not occur. + * See {@link BackendAddressPool} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancer backed address pools. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer backed address pools. + * + * @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 {LoadBalancerBackendAddressPoolListResult} - 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. + * + * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerFrontendIPConfigurations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerFrontendIPConfigurations { + + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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. + * + * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets load balancer frontend IP configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets load balancer frontend IP configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. + * + * @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 {FrontendIPConfiguration} - 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. + * + * {FrontendIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendIPConfiguration} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer frontend IP configurations. + * + * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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. + * + * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * InboundNatRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface InboundNatRules { + + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {InboundNatRuleListResult} - 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. + * + * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {InboundNatRule} - 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. + * + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @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 {InboundNatRule} - 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. + * + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @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 {InboundNatRule} - 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. + * + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @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 {InboundNatRuleListResult} - 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. + * + * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerLoadBalancingRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerLoadBalancingRules { + + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerLoadBalancingRuleListResult} - 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. + * + * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified load balancer load balancing rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} loadBalancingRuleName The name of the load balancing rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified load balancer load balancing rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} loadBalancingRuleName The name of the load balancing rule. + * + * @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 {LoadBalancingRule} - 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. + * + * {LoadBalancingRule} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancing rules in a load balancer. + * + * @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 {LoadBalancerLoadBalancingRuleListResult} - 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. + * + * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerNetworkInterfaces + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerNetworkInterfaces { + + + /** + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets associated load balancer network interfaces. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets associated load balancer network interfaces. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerProbes + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerProbes { + + + /** + * Gets all the load balancer probes. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer probes. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerProbeListResult} - 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. + * + * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerProbeListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets load balancer probe. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets load balancer probe. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. + * + * @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 {Probe} - 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. + * + * {Probe} [result] - The deserialized result object if an error did not occur. + * See {@link Probe} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, probeName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, probeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the load balancer probes. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer probes. + * + * @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 {LoadBalancerProbeListResult} - 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. + * + * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerProbeListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkInterfaces + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkInterfaces { + + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} 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. + */ + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveRouteListResult} - 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. + * + * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveRouteListResult} 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. + */ + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveNetworkSecurityGroupListResult} - 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. + * + * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveNetworkSecurityGroupListResult} 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. + */ + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @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. + */ + listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} 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. + */ + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceIPConfigurationListResult} - 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. + * + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * 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. + */ + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceIPConfiguration} - 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. + * + * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfiguration} 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. + */ + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterface} - 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. + * + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} 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. + */ + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveRouteListResult} - 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. + * + * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveRouteListResult} 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. + */ + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveNetworkSecurityGroupListResult} - 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. + * + * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveNetworkSecurityGroupListResult} 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. + */ + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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 {NetworkInterfaceListResult} - 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. + * + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. + */ + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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. + * + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * 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. + */ + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkInterfaceIPConfigurations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkInterfaceIPConfigurations { + + + /** + * Get all ip configurations in a network interface + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get all ip configurations in a network interface + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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. + * + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified network interface ip configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified network interface ip configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration 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 {NetworkInterfaceIPConfiguration} - 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. + * + * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfiguration} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get all ip configurations in a network interface + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get all ip configurations in a network interface + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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. + * + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkInterfaceLoadBalancers + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkInterfaceLoadBalancers { + + + /** + * List all load balancers in a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List all load balancers in a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {NetworkInterfaceLoadBalancerListResult} - 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. + * + * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List all load balancers in a network interface. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List all load balancers in a network interface. + * + * @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 {NetworkInterfaceLoadBalancerListResult} - 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. + * + * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkSecurityGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkSecurityGroups { + + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroup} - 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. + * + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroup} - 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. + * + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroup} - 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. + * + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} 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. + */ + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroupListResult} - 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. + * + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroupListResult} - 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. + * + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroup} - 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. + * + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroup} - 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. + * + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} 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. + */ + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroupListResult} - 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. + * + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkSecurityGroupListResult} - 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. + * + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SecurityRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface SecurityRules { + + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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 {SecurityRule} - 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. + * + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @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 {SecurityRule} - 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. + * + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityRuleListResult} - 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. + * + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @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 {SecurityRule} - 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. + * + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityRuleListResult} - 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. + * + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DefaultSecurityRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface DefaultSecurityRules { + + + /** + * Gets all default security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all default security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityRuleListResult} - 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. + * + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified default network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} defaultSecurityRuleName The name of the default security + * rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified default network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} defaultSecurityRuleName The name of the default security + * rule. + * + * @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 {SecurityRule} - 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. + * + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all default security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all default security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityRuleListResult} - 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. + * + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkWatchers + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkWatchers { + + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkWatcher} - 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. + * + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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 {NetworkWatcher} - 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. + * + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkWatcher} - 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. + * + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} 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. + */ + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkWatcherListResult} - 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. + * + * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network watchers by subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network watchers by subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkWatcherListResult} - 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. + * + * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. + * + * @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 {Topology} - 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. + * + * {Topology} [result] - The deserialized result object if an error did not occur. + * See {@link Topology} 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. + */ + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, callback: ServiceCallback): void; + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 {VerificationIPFlowResult} - 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. + * + * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. + * See {@link VerificationIPFlowResult} 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. + */ + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 {NextHopResult} - 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. + * + * {NextHopResult} [result] - The deserialized result object if an error did not occur. + * See {@link NextHopResult} 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. + */ + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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. + */ + getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 {SecurityGroupViewResult} - 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. + * + * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityGroupViewResult} 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. + */ + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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. + */ + getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 {TroubleshootingResult} - 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. + * + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. + */ + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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. + */ + getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 {TroubleshootingResult} - 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. + * + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. + */ + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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. + */ + setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 {FlowLogInformation} - 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. + * + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. + */ + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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. + */ + getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 {FlowLogInformation} - 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. + * + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. + */ + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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. + */ + checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 {ConnectivityInformation} - 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. + * + * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectivityInformation} 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. + */ + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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. + */ + getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 {AzureReachabilityReport} - 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. + * + * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. + * See {@link AzureReachabilityReport} 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. + */ + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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. + */ + listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 {AvailableProvidersList} - 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. + * + * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableProvidersList} 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. + */ + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 {VerificationIPFlowResult} - 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. + * + * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. + * See {@link VerificationIPFlowResult} 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. + */ + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + beginGetNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 {NextHopResult} - 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. + * + * {NextHopResult} [result] - The deserialized result object if an error did not occur. + * See {@link NextHopResult} 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. + */ + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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. + */ + beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 {SecurityGroupViewResult} - 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. + * + * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityGroupViewResult} 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. + */ + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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. + */ + beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 {TroubleshootingResult} - 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. + * + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. + */ + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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. + */ + beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 {TroubleshootingResult} - 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. + * + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. + */ + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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. + */ + beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 {FlowLogInformation} - 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. + * + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. + */ + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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. + */ + beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 {FlowLogInformation} - 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. + * + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. + */ + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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. + */ + beginCheckConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 {ConnectivityInformation} - 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. + * + * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectivityInformation} 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. + */ + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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. + */ + beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 {AzureReachabilityReport} - 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. + * + * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. + * See {@link AzureReachabilityReport} 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. + */ + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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. + */ + beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 {AvailableProvidersList} - 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. + * + * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableProvidersList} 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. + */ + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * PacketCaptures + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface PacketCaptures { + + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 {PacketCaptureResult} - 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. + * + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} 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. + */ + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a packet capture session by name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a packet capture session by name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 {PacketCaptureResult} - 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. + * + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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. + */ + getStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 {PacketCaptureQueryStatusResult} - 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. + * + * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureQueryStatusResult} 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. + */ + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher 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. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 {PacketCaptureListResult} - 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. + * + * {PacketCaptureListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 {PacketCaptureResult} - 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. + * + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} 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. + */ + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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. + */ + beginGetStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 {PacketCaptureQueryStatusResult} - 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. + * + * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureQueryStatusResult} 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. + */ + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ConnectionMonitors + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ConnectionMonitors { + + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 {ConnectionMonitorResult} - 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. + * + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a connection monitor by name. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a connection monitor by name. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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 {ConnectionMonitorResult} - 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. + * + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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. + */ + queryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 {ConnectionMonitorQueryResult} - 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. + * + * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorQueryResult} 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. + */ + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 {ConnectionMonitorListResult} - 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. + * + * {ConnectionMonitorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @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 {ConnectionMonitorResult} - 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. + * + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Stops the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @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. + */ + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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. + */ + beginQueryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query a snapshot of the most recent connection states. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. + * + * @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 {ConnectionMonitorQueryResult} - 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. + * + * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorQueryResult} 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. + */ + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available Network Rest API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available Network Rest API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the available Network Rest API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available Network Rest API operations. + * + * @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 {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * PublicIPAddresses + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface PublicIPAddresses { + + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} 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. + */ + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The network interface name. + * + * @param {string} ipConfigurationName The IP configuration 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. + */ + listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The network interface name. + * + * @param {string} ipConfigurationName The IP configuration 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 {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the IP configuration. + * + * @param {string} publicIpAddressName The name of the public IP Address. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the IP configuration. + * + * @param {string} publicIpAddressName The name of the public IP Address. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} 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. + */ + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddress} - 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. + * + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} 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. + */ + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @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. + */ + listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @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 {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @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 {PublicIPAddressListResult} - 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. + * + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. + */ + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RouteFilters + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface RouteFilters { + + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilter} - 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. + * + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilter} - 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. + * + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @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 {RouteFilter} - 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. + * + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route filters in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route filters in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilterListResult} - 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. + * + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route filters in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route filters in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilterListResult} - 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. + * + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilter} - 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. + * + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @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 {RouteFilter} - 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. + * + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} 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. + */ + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route filters in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route filters in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilterListResult} - 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. + * + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route filters in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route filters in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteFilterListResult} - 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. + * + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RouteFilterRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface RouteFilterRules { + + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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 {RouteFilterRule} - 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. + * + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 {RouteFilterRule} - 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. + * + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 {RouteFilterRule} - 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. + * + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + listByRouteFilterWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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 {RouteFilterRuleListResult} - 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. + * + * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRuleListResult} 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. + */ + listByRouteFilter(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRouteFilter(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + listByRouteFilter(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 {RouteFilterRule} - 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. + * + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 {RouteFilterRule} - 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. + * + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} 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. + */ + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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. + */ + listByRouteFilterNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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 {RouteFilterRuleListResult} - 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. + * + * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRuleListResult} 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. + */ + listByRouteFilterNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRouteFilterNext(nextPageLink: string, callback: ServiceCallback): void; + listByRouteFilterNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RouteTables + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface RouteTables { + + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTable} - 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. + * + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeTableName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTable} - 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. + * + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTable} - 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. + * + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} 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. + */ + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTableListResult} - 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. + * + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTableListResult} - 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. + * + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTable} - 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. + * + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTable} - 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. + * + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} 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. + */ + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTableListResult} - 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. + * + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RouteTableListResult} - 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. + * + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Routes + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Routes { + + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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 {Route} - 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. + * + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @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 {Route} - 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. + * + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all routes in a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all routes in a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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 {RouteListResult} - 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. + * + * {RouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @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 {Route} - 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. + * + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all routes in a route table. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all routes in a route table. + * + * @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 {RouteListResult} - 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. + * + * {RouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * BgpServiceCommunities + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface BgpServiceCommunities { + + + /** + * Gets all the available bgp service communities. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the available bgp service communities. + * + * @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 {BgpServiceCommunityListResult} - 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. + * + * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpServiceCommunityListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the available bgp service communities. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the available bgp service communities. + * + * @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 {BgpServiceCommunityListResult} - 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. + * + * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpServiceCommunityListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Usages + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Usages { + + + /** + * List network usages for a subscription. + * + * @param {string} location The location where resource usage is queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List network usages for a subscription. + * + * @param {string} location The location where resource usage is queried. + * + * @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 {UsagesListResult} - 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. + * + * {UsagesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link UsagesListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List network usages for a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List network usages for a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {UsagesListResult} - 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. + * + * {UsagesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link UsagesListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworks + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworks { + + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} 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. + */ + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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. + */ + checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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 {IPAddressAvailabilityResult} - 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. + * + * {IPAddressAvailabilityResult} [result] - The deserialized result object if an error did not occur. + * See {@link IPAddressAvailabilityResult} 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. + */ + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listUsageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListUsageResult} - 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. + * + * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListUsageResult} 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. + */ + listUsage(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsage(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + listUsage(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} 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. + */ + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists usage stats. + * + * @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. + */ + listUsageNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists usage stats. + * + * @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 {VirtualNetworkListUsageResult} - 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. + * + * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListUsageResult} 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. + */ + listUsageNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsageNext(nextPageLink: string, callback: ServiceCallback): void; + listUsageNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Subnets + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Subnets { + + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SubnetListResult} - 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. + * + * {SubnetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubnetListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all subnets in a virtual network. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subnets in a virtual network. + * + * @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 {SubnetListResult} - 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. + * + * {SubnetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubnetListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkPeerings + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkPeerings { + + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkPeeringListResult} - 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. + * + * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeeringListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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 {VirtualNetworkPeeringListResult} - 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. + * + * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeeringListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkGateways { + + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayListResult} - 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. + * + * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + listConnectionsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. + * + * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListConnectionsResult} + * 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. + */ + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + resetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + reset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + reset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + reset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generatevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + getBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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. + * + * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpPeerStatusListResult} 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. + */ + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + supportedVpnDevicesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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. + */ + vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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 {String} - 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. + * + * {String} [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. + */ + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, callback: ServiceCallback): void; + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + beginResetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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. + * + * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpPeerStatusListResult} 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. + */ + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayListResult} - 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. + * + * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the connections in a virtual network gateway. + * + * @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. + */ + listConnectionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the connections in a virtual network gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. + * + * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListConnectionsResult} + * 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. + */ + listConnectionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnectionsNext(nextPageLink: string, callback: ServiceCallback): void; + listConnectionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkGatewayConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkGatewayConnections { + + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnection} - 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. + * + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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 {VirtualNetworkGatewayConnection} - 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. + * + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnectionListEntity} - 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. + * + * {VirtualNetworkGatewayConnectionListEntity} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListEntity} + * 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. + */ + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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. + */ + setSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 {ConnectionSharedKey} - 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. + * + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} 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. + */ + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key 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. + */ + getSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key 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 {ConnectionSharedKey} - 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. + * + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} 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. + */ + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnectionListResult} - 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. + * + * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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. + */ + resetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 {ConnectionResetSharedKey} - 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. + * + * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionResetSharedKey} 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. + */ + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnection} - 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. + * + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnectionListEntity} - 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. + * + * {VirtualNetworkGatewayConnectionListEntity} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListEntity} + * 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. + */ + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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. + */ + beginSetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 {ConnectionSharedKey} - 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. + * + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} 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. + */ + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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. + */ + beginResetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 {ConnectionResetSharedKey} - 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. + * + * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionResetSharedKey} 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. + */ + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @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 {VirtualNetworkGatewayConnectionListResult} - 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. + * + * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LocalNetworkGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LocalNetworkGateways { + + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified local network gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified local network gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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 {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} 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. + */ + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGatewayListResult} - 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. + * + * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} 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. + */ + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGatewayListResult} - 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. + * + * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/networkManagement2/lib/lib/operations/index.js b/lib/services/networkManagement2/lib/lib/operations/index.js new file mode 100644 index 0000000000..b71044c90d --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/index.js @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.ApplicationGateways = require('./applicationGateways'); +exports.ApplicationSecurityGroups = require('./applicationSecurityGroups'); +exports.DdosProtectionPlans = require('./ddosProtectionPlans'); +exports.AvailableEndpointServices = require('./availableEndpointServices'); +exports.ExpressRouteCircuitAuthorizations = require('./expressRouteCircuitAuthorizations'); +exports.ExpressRouteCircuitPeerings = require('./expressRouteCircuitPeerings'); +exports.ExpressRouteCircuitConnections = require('./expressRouteCircuitConnections'); +exports.ExpressRouteCircuits = require('./expressRouteCircuits'); +exports.ExpressRouteServiceProviders = require('./expressRouteServiceProviders'); +exports.ExpressRouteCrossConnections = require('./expressRouteCrossConnections'); +exports.ExpressRouteCrossConnectionPeerings = require('./expressRouteCrossConnectionPeerings'); +exports.LoadBalancers = require('./loadBalancers'); +exports.LoadBalancerBackendAddressPools = require('./loadBalancerBackendAddressPools'); +exports.LoadBalancerFrontendIPConfigurations = require('./loadBalancerFrontendIPConfigurations'); +exports.InboundNatRules = require('./inboundNatRules'); +exports.LoadBalancerLoadBalancingRules = require('./loadBalancerLoadBalancingRules'); +exports.LoadBalancerNetworkInterfaces = require('./loadBalancerNetworkInterfaces'); +exports.LoadBalancerProbes = require('./loadBalancerProbes'); +exports.NetworkInterfaces = require('./networkInterfaces'); +exports.NetworkInterfaceIPConfigurations = require('./networkInterfaceIPConfigurations'); +exports.NetworkInterfaceLoadBalancers = require('./networkInterfaceLoadBalancers'); +exports.NetworkSecurityGroups = require('./networkSecurityGroups'); +exports.SecurityRules = require('./securityRules'); +exports.DefaultSecurityRules = require('./defaultSecurityRules'); +exports.NetworkWatchers = require('./networkWatchers'); +exports.PacketCaptures = require('./packetCaptures'); +exports.ConnectionMonitors = require('./connectionMonitors'); +exports.Operations = require('./operations'); +exports.PublicIPAddresses = require('./publicIPAddresses'); +exports.RouteFilters = require('./routeFilters'); +exports.RouteFilterRules = require('./routeFilterRules'); +exports.RouteTables = require('./routeTables'); +exports.Routes = require('./routes'); +exports.BgpServiceCommunities = require('./bgpServiceCommunities'); +exports.Usages = require('./usages'); +exports.VirtualNetworks = require('./virtualNetworks'); +exports.Subnets = require('./subnets'); +exports.VirtualNetworkPeerings = require('./virtualNetworkPeerings'); +exports.VirtualNetworkGateways = require('./virtualNetworkGateways'); +exports.VirtualNetworkGatewayConnections = require('./virtualNetworkGatewayConnections'); +exports.LocalNetworkGateways = require('./localNetworkGateways'); diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancerBackendAddressPools.js new file mode 100644 index 0000000000..48c39799aa --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancerBackendAddressPools.js @@ -0,0 +1,719 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the load balancer backed address pools. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/backendAddressPools'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['LoadBalancerBackendAddressPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets load balancer backend address pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} backendAddressPoolName The name of the backend address pool. + * + * @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 BackendAddressPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (backendAddressPoolName === null || backendAddressPoolName === undefined || typeof backendAddressPoolName.valueOf() !== 'string') { + throw new Error('backendAddressPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{backendAddressPoolName}', encodeURIComponent(backendAddressPoolName)); + 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) { + 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['BackendAddressPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancer backed address pools. + * + * @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 LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {object} [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) { + 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['LoadBalancerBackendAddressPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancerBackendAddressPools. */ +class LoadBalancerBackendAddressPools { + /** + * Create a LoadBalancerBackendAddressPools. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerBackendAddressPoolListResult} - 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 LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets load balancer backend address pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} backendAddressPoolName The name of the backend address pool. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, backendAddressPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} backendAddressPoolName The name of the backend address pool. + * + * @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 {BackendAddressPool} - 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 BackendAddressPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, backendAddressPoolName, 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._get(resourceGroupName, loadBalancerName, backendAddressPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, backendAddressPoolName, options, optionalCallback); + } + } + + /** + * Gets all the load balancer backed address pools. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @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 {LoadBalancerBackendAddressPoolListResult} - 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 LoadBalancerBackendAddressPoolListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancerBackendAddressPools; diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancerFrontendIPConfigurations.js new file mode 100644 index 0000000000..fd396ac90b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -0,0 +1,728 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['LoadBalancerFrontendIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets load balancer frontend IP configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. + * + * @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 FrontendIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (frontendIPConfigurationName === null || frontendIPConfigurationName === undefined || typeof frontendIPConfigurationName.valueOf() !== 'string') { + throw new Error('frontendIPConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{frontendIPConfigurationName}', encodeURIComponent(frontendIPConfigurationName)); + 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) { + 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['FrontendIPConfiguration']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancer frontend IP configurations. + * + * @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 + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {object} [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) { + 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['LoadBalancerFrontendIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancerFrontendIPConfigurations. */ +class LoadBalancerFrontendIPConfigurations { + /** + * Create a LoadBalancerFrontendIPConfigurations. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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 + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. + * + * @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 {FrontendIPConfiguration} - 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 FrontendIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, 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._get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options, optionalCallback); + } + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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 + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancerFrontendIPConfigurations; diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancerLoadBalancingRules.js new file mode 100644 index 0000000000..40590cf2c2 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancerLoadBalancingRules.js @@ -0,0 +1,719 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['LoadBalancerLoadBalancingRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the specified load balancer load balancing rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} loadBalancingRuleName The name of the load balancing rule. + * + * @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 LoadBalancingRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancingRuleName === null || loadBalancingRuleName === undefined || typeof loadBalancingRuleName.valueOf() !== 'string') { + throw new Error('loadBalancingRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{loadBalancingRuleName}', encodeURIComponent(loadBalancingRuleName)); + 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) { + 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['LoadBalancingRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancing rules in a load balancer. + * + * @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 LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {object} [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) { + 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['LoadBalancerLoadBalancingRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancerLoadBalancingRules. */ +class LoadBalancerLoadBalancingRules { + /** + * Create a LoadBalancerLoadBalancingRules. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerLoadBalancingRuleListResult} - 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 LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} loadBalancingRuleName The name of the load balancing rule. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, loadBalancingRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, loadBalancingRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} loadBalancingRuleName The name of the load balancing rule. + * + * @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 {LoadBalancingRule} - 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 LoadBalancingRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, loadBalancingRuleName, 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._get(resourceGroupName, loadBalancerName, loadBalancingRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, loadBalancingRuleName, options, optionalCallback); + } + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @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 {LoadBalancerLoadBalancingRuleListResult} - 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 LoadBalancerLoadBalancingRuleListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancerLoadBalancingRules; diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancerNetworkInterfaces.js new file mode 100644 index 0000000000..543a490d40 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancerNetworkInterfaces.js @@ -0,0 +1,477 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/networkInterfaces'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets associated load balancer network interfaces. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancerNetworkInterfaces. */ +class LoadBalancerNetworkInterfaces { + /** + * Create a LoadBalancerNetworkInterfaces. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets associated load balancer network interfaces. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancerNetworkInterfaces; diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancerProbes.js new file mode 100644 index 0000000000..4f03ac9afc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancerProbes.js @@ -0,0 +1,719 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the load balancer probes. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 LoadBalancerProbeListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/probes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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) { + 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['LoadBalancerProbeListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets load balancer probe. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. + * + * @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 Probe} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, probeName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (probeName === null || probeName === undefined || typeof probeName.valueOf() !== 'string') { + throw new Error('probeName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{probeName}', encodeURIComponent(probeName)); + 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) { + 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['Probe']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancer probes. + * + * @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 LoadBalancerProbeListResult} for more + * information. + * + * {object} [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) { + 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['LoadBalancerProbeListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancerProbes. */ +class LoadBalancerProbes { + /** + * Create a LoadBalancerProbes. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Gets all the load balancer probes. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer probes. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 {LoadBalancerProbeListResult} - 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 LoadBalancerProbeListResult} for more + * information. + * + * {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(resourceGroupName, loadBalancerName, 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(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets load balancer probe. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, probeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, probeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets load balancer probe. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. + * + * @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 {Probe} - 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 Probe} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, probeName, 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._get(resourceGroupName, loadBalancerName, probeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, probeName, options, optionalCallback); + } + } + + /** + * Gets all the load balancer probes. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancer probes. + * + * @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 {LoadBalancerProbeListResult} - 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 LoadBalancerProbeListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancerProbes; diff --git a/lib/services/networkManagement2/lib/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/lib/operations/loadBalancers.js new file mode 100644 index 0000000000..8bd21d2254 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/loadBalancers.js @@ -0,0 +1,2701 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 _deleteMethod(resourceGroupName, loadBalancerName, 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.beginDeleteMethod(resourceGroupName, loadBalancerName, 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); + }); + }); +} + +/** + * Gets the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, loadBalancerName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/loadBalancers/{loadBalancerName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancer']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, loadBalancerName, parameters, 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.beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, 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['LoadBalancer']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, loadBalancerName, parameters, 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.beginUpdateTags(resourceGroupName, loadBalancerName, parameters, 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['LoadBalancer']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all the load balancers in a subscription. + * + * @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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/loadBalancers'; + 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) { + 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['LoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancers in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['LoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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 _beginDeleteMethod(resourceGroupName, loadBalancerName, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['LoadBalancer']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['LoadBalancer']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancer']().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); + }); +} + +/** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, 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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { + throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/loadBalancers/{loadBalancerName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancer']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancers in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['LoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the load balancers in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LoadBalancerListResult} for more + * information. + * + * {object} [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) { + 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['LoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancers. */ +class LoadBalancers { + /** + * Create a LoadBalancers. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listAll = _listAll; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + } + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + deleteMethod(resourceGroupName, loadBalancerName, 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._deleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Gets the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {LoadBalancer} - 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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, loadBalancerName, 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._get(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LoadBalancer} - 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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, loadBalancerName, parameters, 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._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); + } + } + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LoadBalancer} - 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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, loadBalancerName, parameters, 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._updateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the load balancers in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancers in 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 {LoadBalancerListResult} - 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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {LoadBalancerListResult} - 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 LoadBalancerListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, loadBalancerName, 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._beginDeleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, loadBalancerName, options, optionalCallback); + } + } + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a load balancer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LoadBalancer} - 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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, 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._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); + } + } + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a load balancer tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LoadBalancer} - 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 LoadBalancer} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, loadBalancerName, parameters, 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._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the load balancers in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LoadBalancerListResult} - 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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LoadBalancerListResult} - 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 LoadBalancerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancers; diff --git a/lib/services/networkManagement2/lib/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/lib/operations/localNetworkGateways.js new file mode 100644 index 0000000000..9d43427a97 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/localNetworkGateways.js @@ -0,0 +1,2191 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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['LocalNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets the specified local network gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, localNetworkGatewayName, 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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { + throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { + if (localNetworkGatewayName.length < 1) + { + throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/localNetworkGateways/{localNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); + 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) { + 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['LocalNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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 _deleteMethod(resourceGroupName, localNetworkGatewayName, 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.beginDeleteMethod(resourceGroupName, localNetworkGatewayName, 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); + }); + }); +} + + +/** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, localNetworkGatewayName, parameters, 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.beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, 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['LocalNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all the local network gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 LocalNetworkGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/localNetworkGateways'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['LocalNetworkGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { + throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { + if (localNetworkGatewayName.length < 1) + { + throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/localNetworkGateways/{localNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['LocalNetworkGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['LocalNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LocalNetworkGateway']().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); + }); +} + +/** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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 _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, 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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { + throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { + if (localNetworkGatewayName.length < 1) + { + throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/localNetworkGateways/{localNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); + 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 !== 202 && 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); + }); +} + +/** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, 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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { + throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { + if (localNetworkGatewayName.length < 1) + { + throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/localNetworkGateways/{localNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LocalNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the local network gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 LocalNetworkGatewayListResult} for more + * information. + * + * {object} [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) { + 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['LocalNetworkGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LocalNetworkGateways. */ +class LocalNetworkGateways { + /** + * Create a LocalNetworkGateways. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._updateTags = _updateTags; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdateTags = _beginUpdateTags; + this._listNext = _listNext; + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LocalNetworkGateway} - 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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, localNetworkGatewayName, 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._get(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, localNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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. + */ + deleteMethod(resourceGroupName, localNetworkGatewayName, 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._deleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, localNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LocalNetworkGateway} - 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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, localNetworkGatewayName, parameters, 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._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {LocalNetworkGatewayListResult} - 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 LocalNetworkGatewayListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LocalNetworkGateway} - 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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, localNetworkGatewayName, 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._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a local network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LocalNetworkGateway} - 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 LocalNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {LocalNetworkGatewayListResult} - 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 LocalNetworkGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LocalNetworkGateways; diff --git a/lib/services/networkManagement2/lib/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/lib/operations/networkInterfaceIPConfigurations.js new file mode 100644 index 0000000000..db53f4db14 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/networkInterfaceIPConfigurations.js @@ -0,0 +1,721 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Get all ip configurations in a network interface + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkInterfaceName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + 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) { + 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['NetworkInterfaceIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the specified network interface ip configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration 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 NetworkInterfaceIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { + throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); + 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) { + 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['NetworkInterfaceIPConfiguration']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get all ip configurations in a network interface + * + * @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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [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) { + 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['NetworkInterfaceIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 NetworkInterfaceIPConfigurations. */ +class NetworkInterfaceIPConfigurations { + /** + * Create a NetworkInterfaceIPConfigurations. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Get all ip configurations in a network interface + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all ip configurations in a network interface + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {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(resourceGroupName, networkInterfaceName, 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(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets the specified network interface ip configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration 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. + */ + getWithHttpOperationResponse(resourceGroupName, networkInterfaceName, ipConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration 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 {NetworkInterfaceIPConfiguration} - 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 NetworkInterfaceIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkInterfaceName, ipConfigurationName, 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._get(resourceGroupName, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkInterfaceName, ipConfigurationName, options, optionalCallback); + } + } + + /** + * Get all ip configurations in a network interface + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all ip configurations in a network interface + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = NetworkInterfaceIPConfigurations; diff --git a/lib/services/networkManagement2/lib/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/lib/operations/networkInterfaceLoadBalancers.js new file mode 100644 index 0000000000..db1e16ac06 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/networkInterfaceLoadBalancers.js @@ -0,0 +1,477 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * List all load balancers in a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkInterfaceName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + 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) { + 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['NetworkInterfaceLoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List all load balancers in a network interface. + * + * @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 NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {object} [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) { + 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['NetworkInterfaceLoadBalancerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 NetworkInterfaceLoadBalancers. */ +class NetworkInterfaceLoadBalancers { + /** + * Create a NetworkInterfaceLoadBalancers. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * List all load balancers in a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List all load balancers in a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {NetworkInterfaceLoadBalancerListResult} - 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 NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {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(resourceGroupName, networkInterfaceName, 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(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * List all load balancers in a network interface. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List all load balancers in a network interface. + * + * @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 {NetworkInterfaceLoadBalancerListResult} - 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 NetworkInterfaceLoadBalancerListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = NetworkInterfaceLoadBalancers; diff --git a/lib/services/networkManagement2/lib/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/lib/operations/networkInterfaces.js new file mode 100644 index 0000000000..c24fdf2233 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/networkInterfaces.js @@ -0,0 +1,5674 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 _deleteMethod(resourceGroupName, networkInterfaceName, 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.beginDeleteMethod(resourceGroupName, networkInterfaceName, 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); + }); + }); +} + +/** + * Gets information about the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/networkInterfaces/{networkInterfaceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, networkInterfaceName, parameters, 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.beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, 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['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all network interfaces in a subscription. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/networkInterfaces'; + 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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network interfaces in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 EffectiveRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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['EffectiveRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 EffectiveNetworkSecurityGroupListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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['EffectiveNetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network interfaces in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterfaceIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 NetworkInterfaceIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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 expand = (options && options.expand !== undefined) ? options.expand : 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { + throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterfaceIPConfiguration']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 _beginDeleteMethod(resourceGroupName, networkInterfaceName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NetworkInterface']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterface']().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); + }); +} + +/** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkInterface']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 EffectiveRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['EffectiveRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 EffectiveNetworkSecurityGroupListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['EffectiveNetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network interfaces in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkInterfaceListResult} for more + * information. + * + * {object} [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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetVMNetworkInterfacesNext(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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network interfaces in a virtual machine scale set. + * + * @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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetNetworkInterfacesNext(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) { + 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['NetworkInterfaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetIpConfigurationsNext(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) { + 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['NetworkInterfaceIPConfigurationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 NetworkInterfaces. */ +class NetworkInterfaces { + /** + * Create a NetworkInterfaces. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listAll = _listAll; + this._list = _list; + this._getEffectiveRouteTable = _getEffectiveRouteTable; + this._listEffectiveNetworkSecurityGroups = _listEffectiveNetworkSecurityGroups; + this._listVirtualMachineScaleSetVMNetworkInterfaces = _listVirtualMachineScaleSetVMNetworkInterfaces; + this._listVirtualMachineScaleSetNetworkInterfaces = _listVirtualMachineScaleSetNetworkInterfaces; + this._getVirtualMachineScaleSetNetworkInterface = _getVirtualMachineScaleSetNetworkInterface; + this._listVirtualMachineScaleSetIpConfigurations = _listVirtualMachineScaleSetIpConfigurations; + this._getVirtualMachineScaleSetIpConfiguration = _getVirtualMachineScaleSetIpConfiguration; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginGetEffectiveRouteTable = _beginGetEffectiveRouteTable; + this._beginListEffectiveNetworkSecurityGroups = _beginListEffectiveNetworkSecurityGroups; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + this._listVirtualMachineScaleSetVMNetworkInterfacesNext = _listVirtualMachineScaleSetVMNetworkInterfacesNext; + this._listVirtualMachineScaleSetNetworkInterfacesNext = _listVirtualMachineScaleSetNetworkInterfacesNext; + this._listVirtualMachineScaleSetIpConfigurationsNext = _listVirtualMachineScaleSetIpConfigurationsNext; + } + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + deleteMethod(resourceGroupName, networkInterfaceName, 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._deleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets information about the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkInterfaceName, 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._get(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); + } + } + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, networkInterfaceName, parameters, 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._updateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in 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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveRouteListResult} - 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 EffectiveRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveNetworkSecurityGroupListResult} - 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 EffectiveNetworkSecurityGroupListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @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. + */ + listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, 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._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, 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._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback); + } + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {NetworkInterfaceIPConfiguration} - 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 NetworkInterfaceIPConfiguration} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, optionalCallback); + } + } + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkInterfaceName, 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._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); + } + } + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network interface tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkInterface} - 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 NetworkInterface} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, 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._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); + } + } + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveRouteListResult} - 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 EffectiveRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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. + */ + beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @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 {EffectiveNetworkSecurityGroupListResult} - 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 EffectiveNetworkSecurityGroupListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetVMNetworkInterfacesNext(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._listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetNetworkInterfacesNext(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._listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine + * scale set. + * + * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetIpConfigurationsNext(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._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = NetworkInterfaces; diff --git a/lib/services/networkManagement2/lib/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/lib/operations/networkSecurityGroups.js new file mode 100644 index 0000000000..60dd20b7a6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/networkSecurityGroups.js @@ -0,0 +1,2548 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 _deleteMethod(resourceGroupName, networkSecurityGroupName, 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.beginDeleteMethod(resourceGroupName, networkSecurityGroupName, 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); + }); + }); +} + +/** + * Gets the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkSecurityGroupName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/networkSecurityGroups/{networkSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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['NetworkSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, networkSecurityGroupName, parameters, 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.beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, 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['NetworkSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all network security groups in a subscription. + * + * @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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/networkSecurityGroups'; + 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) { + 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['NetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['NetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NetworkSecurityGroup']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['NetworkSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkSecurityGroup']().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); + }); +} + +/** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['NetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [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) { + 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['NetworkSecurityGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 NetworkSecurityGroups. */ +class NetworkSecurityGroups { + /** + * Create a NetworkSecurityGroups. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listAll = _listAll; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + } + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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. + */ + deleteMethod(resourceGroupName, networkSecurityGroupName, 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._deleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkSecurityGroupName, options, optionalCallback); + } + } + + /** + * Gets the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkSecurityGroupName, 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._get(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkSecurityGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkSecurityGroup} - 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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, networkSecurityGroupName, parameters, 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._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Gets all network security groups in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups in 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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all network security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkSecurityGroupName, 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._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network security group tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkSecurityGroup} - 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 NetworkSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, 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._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); + } + } + + /** + * Gets all network security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all network security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = NetworkSecurityGroups; diff --git a/lib/services/networkManagement2/lib/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/lib/operations/networkWatchers.js new file mode 100644 index 0000000000..8e0d4873fa --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/networkWatchers.js @@ -0,0 +1,7202 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NetworkWatcher']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['NetworkWatcher']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkWatcher']().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); + }); +} + +/** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkWatcherName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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) { + 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['NetworkWatcher']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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 _deleteMethod(resourceGroupName, networkWatcherName, 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.beginDeleteMethod(resourceGroupName, networkWatcherName, 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); + }); + }); +} + +/** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkWatcher']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 NetworkWatcherListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['NetworkWatcherListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all network watchers by subscription. + * + * @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 NetworkWatcherListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/networkWatchers'; + 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) { + 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['NetworkWatcherListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. + * + * @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 Topology} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getTopology(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/topology'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TopologyParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Topology']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 VerificationIPFlowResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _verifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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.beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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['VerificationIPFlowResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 NextHopResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getNextHop(resourceGroupName, networkWatcherName, parameters, 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.beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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['NextHopResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 SecurityGroupViewResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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['SecurityGroupViewResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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.beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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['TroubleshootingResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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['TroubleshootingResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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['FlowLogInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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['FlowLogInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 ConnectivityInformation} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkConnectivity(resourceGroupName, networkWatcherName, parameters, 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.beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, 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['ConnectivityInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 AzureReachabilityReport} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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['AzureReachabilityReport']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 AvailableProvidersList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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.beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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['AvailableProvidersList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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 _beginDeleteMethod(resourceGroupName, networkWatcherName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 !== 202 && 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); + }); +} + +/** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 VerificationIPFlowResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VerificationIPFlowParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['VerificationIPFlowResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VerificationIPFlowResult']().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); + }); +} + +/** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 NextHopResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/nextHop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NextHopParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['NextHopResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NextHopResult']().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); + }); +} + +/** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 SecurityGroupViewResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/securityGroupView'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SecurityGroupViewParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['SecurityGroupViewResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecurityGroupViewResult']().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); + }); +} + +/** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/troubleshoot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TroubleshootingParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['TroubleshootingResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TroubleshootingResult']().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); + }); +} + +/** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['QueryTroubleshootingParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['TroubleshootingResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TroubleshootingResult']().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); + }); +} + +/** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/configureFlowLog'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['FlowLogInformation']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['FlowLogInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FlowLogInformation']().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); + }); +} + +/** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['FlowLogStatusParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['FlowLogInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FlowLogInformation']().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); + }); +} + +/** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 ConnectivityInformation} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/connectivityCheck'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ConnectivityParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ConnectivityInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ConnectivityInformation']().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); + }); +} + +/** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 AzureReachabilityReport} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AzureReachabilityReportParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['AzureReachabilityReport']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AzureReachabilityReport']().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); + }); +} + +/** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 AvailableProvidersList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/availableProvidersList'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AvailableProvidersListParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['AvailableProvidersList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AvailableProvidersList']().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); + }); +} + +/** Class representing a NetworkWatchers. */ +class NetworkWatchers { + /** + * Create a NetworkWatchers. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._updateTags = _updateTags; + this._list = _list; + this._listAll = _listAll; + this._getTopology = _getTopology; + this._verifyIPFlow = _verifyIPFlow; + this._getNextHop = _getNextHop; + this._getVMSecurityRules = _getVMSecurityRules; + this._getTroubleshooting = _getTroubleshooting; + this._getTroubleshootingResult = _getTroubleshootingResult; + this._setFlowLogConfiguration = _setFlowLogConfiguration; + this._getFlowLogStatus = _getFlowLogStatus; + this._checkConnectivity = _checkConnectivity; + this._getAzureReachabilityReport = _getAzureReachabilityReport; + this._listAvailableProviders = _listAvailableProviders; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginVerifyIPFlow = _beginVerifyIPFlow; + this._beginGetNextHop = _beginGetNextHop; + this._beginGetVMSecurityRules = _beginGetVMSecurityRules; + this._beginGetTroubleshooting = _beginGetTroubleshooting; + this._beginGetTroubleshootingResult = _beginGetTroubleshootingResult; + this._beginSetFlowLogConfiguration = _beginSetFlowLogConfiguration; + this._beginGetFlowLogStatus = _beginGetFlowLogStatus; + this._beginCheckConnectivity = _beginCheckConnectivity; + this._beginGetAzureReachabilityReport = _beginGetAzureReachabilityReport; + this._beginListAvailableProviders = _beginListAvailableProviders; + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {NetworkWatcher} - 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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkWatcherName, parameters, 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._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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 {NetworkWatcher} - 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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkWatcherName, 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._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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. + */ + deleteMethod(resourceGroupName, networkWatcherName, 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._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkWatcher} - 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 NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, networkWatcherName, parameters, 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._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {NetworkWatcherListResult} - 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 NetworkWatcherListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all network watchers by 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. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network watchers by 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 {NetworkWatcherListResult} - 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 NetworkWatcherListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getTopologyWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Topology} - 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 Topology} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getTopology(resourceGroupName, networkWatcherName, parameters, 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._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + verifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 {VerificationIPFlowResult} - 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 VerificationIPFlowResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + verifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + getNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 {NextHopResult} - 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 NextHopResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getNextHop(resourceGroupName, networkWatcherName, parameters, 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._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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. + */ + getVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 {SecurityGroupViewResult} - 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 SecurityGroupViewResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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. + */ + getTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 {TroubleshootingResult} - 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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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. + */ + getTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 {TroubleshootingResult} - 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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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. + */ + setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 {FlowLogInformation} - 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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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. + */ + getFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 {FlowLogInformation} - 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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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. + */ + checkConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 {ConnectivityInformation} - 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 ConnectivityInformation} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkConnectivity(resourceGroupName, networkWatcherName, parameters, 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._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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. + */ + getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 {AzureReachabilityReport} - 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 AzureReachabilityReport} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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. + */ + listAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 {AvailableProvidersList} - 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 AvailableProvidersList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkWatcherName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * + * @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 {VerificationIPFlowResult} - 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 VerificationIPFlowResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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. + */ + beginGetNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * + * @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 {NextHopResult} - 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 NextHopResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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. + */ + beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. + * + * @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 {SecurityGroupViewResult} - 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 SecurityGroupViewResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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. + */ + beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Initiate troubleshooting on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * + * @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 {TroubleshootingResult} - 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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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. + */ + beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. + * + * @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 {TroubleshootingResult} - 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 TroubleshootingResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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. + */ + beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Configures flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @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 {FlowLogInformation} - 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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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. + */ + beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Queries status of flow log on a specified resource. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define a resource to query flow + * log status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow logging status. + * + * @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 {FlowLogInformation} - 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 FlowLogInformation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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. + */ + beginCheckConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @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 {ConnectivityInformation} - 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 ConnectivityInformation} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, 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._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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. + */ + beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. + * + * @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 {AzureReachabilityReport} - 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 AzureReachabilityReport} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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. + */ + beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. + * + * @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 {AvailableProvidersList} - 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 AvailableProvidersList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + +} + +module.exports = NetworkWatchers; diff --git a/lib/services/networkManagement2/lib/lib/operations/operations.js b/lib/services/networkManagement2/lib/lib/operations/operations.js new file mode 100644 index 0000000000..fb99365869 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/operations.js @@ -0,0 +1,449 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all of the available Network Rest API operations. + * + * @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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.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('/') ? '' : '/') + 'providers/Microsoft.Network/operations'; + 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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Network Rest API operations. + * + * @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 OperationListResult} for more information. + * + * {object} [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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @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 {OperationListResult} - 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 OperationListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the available Network Rest API operations. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @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 {OperationListResult} - 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/networkManagement2/lib/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/lib/operations/packetCaptures.js new file mode 100644 index 0000000000..0e78bd995f --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/packetCaptures.js @@ -0,0 +1,2323 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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['PacketCaptureResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a packet capture session by name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkWatcherName, packetCaptureName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { + throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); + 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) { + 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['PacketCaptureResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 _deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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.beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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); + }); + }); +} + + +/** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stop(resourceGroupName, networkWatcherName, packetCaptureName, 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.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, 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); + }); + }); +} + + +/** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 PacketCaptureQueryStatusResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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['PacketCaptureQueryStatusResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all packet capture sessions within the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 PacketCaptureListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkWatcherName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + 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) { + 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['PacketCaptureListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { + throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['PacketCapture']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 201) { + 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PacketCaptureResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { + throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); + 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 !== 202 && 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); + }); +} + +/** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { + throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 PacketCaptureQueryStatusResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { + throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['PacketCaptureQueryStatusResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PacketCaptureQueryStatusResult']().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); + }); +} + +/** Class representing a PacketCaptures. */ +class PacketCaptures { + /** + * Create a PacketCaptures. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._stop = _stop; + this._getStatus = _getStatus; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginStop = _beginStop; + this._beginGetStatus = _beginGetStatus; + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 {PacketCaptureResult} - 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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, optionalCallback); + } + } + + /** + * Gets a packet capture session by name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a packet capture session by name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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 {PacketCaptureResult} - 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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkWatcherName, packetCaptureName, 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._get(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + stop(resourceGroupName, networkWatcherName, packetCaptureName, 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._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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. + */ + getStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 {PacketCaptureQueryStatusResult} - 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 PacketCaptureQueryStatusResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher 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. + */ + listWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher 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 {PacketCaptureListResult} - 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 PacketCaptureListResult} for more + * information. + * + * {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(resourceGroupName, networkWatcherName, 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(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] + * + * @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 {PacketCaptureResult} - 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 PacketCaptureResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginStopWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stops a specified packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @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. + */ + beginStop(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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. + */ + beginGetStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} packetCaptureName The name given to the packet capture + * session. + * + * @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 {PacketCaptureQueryStatusResult} - 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 PacketCaptureQueryStatusResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); + } + } + +} + +module.exports = PacketCaptures; diff --git a/lib/services/networkManagement2/lib/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/lib/operations/publicIPAddresses.js new file mode 100644 index 0000000000..d571cbb250 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/publicIPAddresses.js @@ -0,0 +1,3981 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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 _deleteMethod(resourceGroupName, publicIpAddressName, 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.beginDeleteMethod(resourceGroupName, publicIpAddressName, 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); + }); + }); +} + +/** + * Gets the specified public IP address in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, publicIpAddressName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { + throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/publicIPAddresses/{publicIpAddressName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, publicIpAddressName, parameters, 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.beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, 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['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all the public IP addresses in a subscription. + * + * @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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/publicIPAddresses'; + 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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all public IP addresses in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/publicIPAddresses'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The network interface name. + * + * @param {string} ipConfigurationName The IP configuration 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { + throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified public IP address in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the IP configuration. + * + * @param {string} publicIpAddressName The name of the public IP Address. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, 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 expand = (options && options.expand !== undefined) ? options.expand : 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { + throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); + } + if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { + throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); + } + if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { + throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { + throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); + requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); + requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); + requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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 _beginDeleteMethod(resourceGroupName, publicIpAddressName, 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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { + throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/publicIPAddresses/{publicIpAddressName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { + throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/publicIPAddresses/{publicIpAddressName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['PublicIPAddress']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddress']().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); + }); +} + +/** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, 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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { + throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/publicIPAddresses/{publicIpAddressName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicIPAddress']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the public IP addresses in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all public IP addresses in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 PublicIPAddressListResult} for more + * information. + * + * {object} [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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetPublicIPAddressesNext(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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVirtualMachineScaleSetVMPublicIPAddressesNext(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) { + 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['PublicIPAddressListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 PublicIPAddresses. */ +class PublicIPAddresses { + /** + * Create a PublicIPAddresses. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listAll = _listAll; + this._list = _list; + this._listVirtualMachineScaleSetPublicIPAddresses = _listVirtualMachineScaleSetPublicIPAddresses; + this._listVirtualMachineScaleSetVMPublicIPAddresses = _listVirtualMachineScaleSetVMPublicIPAddresses; + this._getVirtualMachineScaleSetPublicIPAddress = _getVirtualMachineScaleSetPublicIPAddress; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + this._listVirtualMachineScaleSetPublicIPAddressesNext = _listVirtualMachineScaleSetPublicIPAddressesNext; + this._listVirtualMachineScaleSetVMPublicIPAddressesNext = _listVirtualMachineScaleSetVMPublicIPAddressesNext; + } + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, publicIpAddressName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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. + */ + deleteMethod(resourceGroupName, publicIpAddressName, 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._deleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, publicIpAddressName, options, optionalCallback); + } + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, publicIpAddressName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, publicIpAddressName, 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._get(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, publicIpAddressName, options, optionalCallback); + } + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); + } + } + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, publicIpAddressName, parameters, 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._updateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the public IP addresses in 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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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. + */ + listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, 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._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback); + } + } + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The network interface name. + * + * @param {string} ipConfigurationName The IP configuration 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. + */ + listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The network interface name. + * + * @param {string} ipConfigurationName The IP configuration 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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, optionalCallback); + } + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the IP configuration. + * + * @param {string} publicIpAddressName The name of the public IP Address. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the IP configuration. + * + * @param {string} publicIpAddressName The name of the public IP Address. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, 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._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, optionalCallback); + } + } + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, publicIpAddressName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the subnet. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, publicIpAddressName, 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._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, optionalCallback); + } + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. + * + * @param {object} [parameters.sku] The public IP address SKU. + * + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' + * + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' + * + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' + * + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. + * + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + * + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. + * + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. + * + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. + * + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); + } + } + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates public IP address tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PublicIPAddress} - 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 PublicIPAddress} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, 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._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); + } + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @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. + */ + listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale + * set level. + * + * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetPublicIPAddressesNext(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._listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @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. + */ + listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. + * + * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVirtualMachineScaleSetVMPublicIPAddressesNext(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._listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = PublicIPAddresses; diff --git a/lib/services/networkManagement2/lib/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/lib/operations/routeFilterRules.js new file mode 100644 index 0000000000..f75f1724e6 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/routeFilterRules.js @@ -0,0 +1,2162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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 _deleteMethod(resourceGroupName, routeFilterName, ruleName, 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.beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, 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); + }); + }); +} + +/** + * Gets the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, routeFilterName, ruleName, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + 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) { + 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['RouteFilterRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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['RouteFilterRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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['RouteFilterRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all RouteFilterRules in a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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 RouteFilterRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByRouteFilter(resourceGroupName, routeFilterName, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}/routeFilterRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + 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) { + 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['RouteFilterRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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 _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); + } + if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) + { + routeFilterRuleParameters = {}; + } + // 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName cannot be null or undefined and it must be of type string.'); + } + if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { + throw new Error('routeFilterRuleParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (routeFilterRuleParameters !== null && routeFilterRuleParameters !== undefined) { + let requestModelMapper = new client.models['RouteFilterRule']().mapper(); + requestModel = client.serialize(requestModelMapper, routeFilterRuleParameters, 'routeFilterRuleParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routeFilterRuleParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['RouteFilterRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteFilterRule']().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); + }); +} + +/** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); + } + if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) + { + routeFilterRuleParameters = {}; + } + // 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName cannot be null or undefined and it must be of type string.'); + } + if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { + throw new Error('routeFilterRuleParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (routeFilterRuleParameters !== null && routeFilterRuleParameters !== undefined) { + let requestModelMapper = new client.models['PatchRouteFilterRule']().mapper(); + requestModel = client.serialize(requestModelMapper, routeFilterRuleParameters, 'routeFilterRuleParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routeFilterRuleParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteFilterRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all RouteFilterRules in a route filter. + * + * @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 RouteFilterRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByRouteFilterNext(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) { + 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['RouteFilterRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 RouteFilterRules. */ +class RouteFilterRules { + /** + * Create a RouteFilterRules. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._listByRouteFilter = _listByRouteFilter; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._listByRouteFilterNext = _listByRouteFilterNext; + } + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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. + */ + deleteMethod(resourceGroupName, routeFilterName, ruleName, 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._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); + } + } + + /** + * Gets the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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 {RouteFilterRule} - 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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, routeFilterName, ruleName, 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._get(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); + } + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilterRule} - 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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); + } + } + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilterRule} - 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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); + } + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + listByRouteFilterWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRouteFilter(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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 {RouteFilterRuleListResult} - 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 RouteFilterRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByRouteFilter(resourceGroupName, routeFilterName, 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._listByRouteFilter(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRouteFilter(resourceGroupName, routeFilterName, options, optionalCallback); + } + } + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the rule. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, 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._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); + } + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilterRule} - 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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); + } + } + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilterRule} - 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 RouteFilterRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); + } + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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. + */ + listByRouteFilterNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRouteFilterNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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 {RouteFilterRuleListResult} - 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 RouteFilterRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByRouteFilterNext(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._listByRouteFilterNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRouteFilterNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RouteFilterRules; diff --git a/lib/services/networkManagement2/lib/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/lib/operations/routeFilters.js new file mode 100644 index 0000000000..3dc57d7eb0 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/routeFilters.js @@ -0,0 +1,2510 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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 _deleteMethod(resourceGroupName, routeFilterName, 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.beginDeleteMethod(resourceGroupName, routeFilterName, 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); + }); + }); +} + +/** + * Gets the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. + * + * @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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, routeFilterName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/routeFilters/{routeFilterName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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.beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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['RouteFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, routeFilterName, routeFilterParameters, 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.beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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['RouteFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all route filters in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['RouteFilterListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route filters in a subscription. + * + * @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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/routeFilters'; + 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) { + 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['RouteFilterListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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 _beginDeleteMethod(resourceGroupName, routeFilterName, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (routeFilterParameters === null || routeFilterParameters === undefined) { + throw new Error('routeFilterParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (routeFilterParameters !== null && routeFilterParameters !== undefined) { + let requestModelMapper = new client.models['RouteFilter']().mapper(); + requestModel = client.serialize(requestModelMapper, routeFilterParameters, 'routeFilterParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routeFilterParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['RouteFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteFilter']().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); + }); +} + +/** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { + throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); + } + if (routeFilterParameters === null || routeFilterParameters === undefined) { + throw new Error('routeFilterParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeFilters/{routeFilterName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (routeFilterParameters !== null && routeFilterParameters !== undefined) { + let requestModelMapper = new client.models['PatchRouteFilter']().mapper(); + requestModel = client.serialize(requestModelMapper, routeFilterParameters, 'routeFilterParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routeFilterParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route filters in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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) { + 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['RouteFilterListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route filters in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteFilterListResult} for more information. + * + * {object} [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) { + 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['RouteFilterListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 RouteFilters. */ +class RouteFilters { + /** + * Create a RouteFilters. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + deleteMethod(resourceGroupName, routeFilterName, 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._deleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, routeFilterName, options, optionalCallback); + } + } + + /** + * Gets the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. + * + * @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 {RouteFilter} - 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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, routeFilterName, 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._get(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, routeFilterName, options, optionalCallback); + } + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilter} - 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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); + } + } + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilter} - 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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, routeFilterName, routeFilterParameters, 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._update(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); + } + } + + /** + * Gets all route filters in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {RouteFilterListResult} - 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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all route filters in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Gets all route filters in 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 {RouteFilterListResult} - 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 RouteFilterListResult} for more information. + * + * {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); + } + } + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, routeFilterName, 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._beginDeleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, routeFilterName, options, optionalCallback); + } + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {string} [routeFilterParameters.location] Resource location. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilter} - 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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); + } + } + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. + * + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteFilter} - 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 RouteFilter} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); + } + } + + /** + * Gets all route filters in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteFilterListResult} - 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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all route filters in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route filters in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteFilterListResult} - 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 RouteFilterListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RouteFilters; diff --git a/lib/services/networkManagement2/lib/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/lib/operations/routeTables.js new file mode 100644 index 0000000000..4a5ee2f20a --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/routeTables.js @@ -0,0 +1,2495 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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 _deleteMethod(resourceGroupName, routeTableName, 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.beginDeleteMethod(resourceGroupName, routeTableName, 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); + }); + }); +} + +/** + * Gets the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, routeTableName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/routeTables/{routeTableName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteTable']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, routeTableName, parameters, 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.beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, 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['RouteTable']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, routeTableName, parameters, 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.beginUpdateTags(resourceGroupName, routeTableName, parameters, 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['RouteTable']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all route tables in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['RouteTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route tables in a subscription. + * + * @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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/routeTables'; + 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) { + 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['RouteTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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 _beginDeleteMethod(resourceGroupName, routeTableName, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + 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 !== 202 && 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); + }); +} + +/** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['RouteTable']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['RouteTable']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteTable']().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); + }); +} + +/** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, routeTableName, parameters, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RouteTable']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route tables in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteTableListResult} for more information. + * + * {object} [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) { + 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['RouteTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all route tables in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['RouteTableListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 RouteTables. */ +class RouteTables { + /** + * Create a RouteTables. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._list = _list; + this._listAll = _listAll; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + } + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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. + */ + deleteMethod(resourceGroupName, routeTableName, 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._deleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, routeTableName, options, optionalCallback); + } + } + + /** + * Gets the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, routeTableName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, routeTableName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {RouteTable} - 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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, routeTableName, 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._get(resourceGroupName, routeTableName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, routeTableName, options, optionalCallback); + } + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteTable} - 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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, routeTableName, parameters, 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._createOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, routeTableName, parameters, options, optionalCallback); + } + } + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteTable} - 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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, routeTableName, parameters, 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._updateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, routeTableName, parameters, options, optionalCallback); + } + } + + /** + * Gets all route tables in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {RouteTableListResult} - 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 RouteTableListResult} for more information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all route tables in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables in 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 {RouteTableListResult} - 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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, routeTableName, 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._beginDeleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, routeTableName, options, optionalCallback); + } + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteTable} - 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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, 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._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, optionalCallback); + } + } + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RouteTable} - 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 RouteTable} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, routeTableName, parameters, 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._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, optionalCallback); + } + } + + /** + * Gets all route tables in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteTableListResult} - 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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all route tables in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all route tables in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {RouteTableListResult} - 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 RouteTableListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RouteTables; diff --git a/lib/services/networkManagement2/lib/lib/operations/routes.js b/lib/services/networkManagement2/lib/lib/operations/routes.js new file mode 100644 index 0000000000..cdb3db5d01 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/routes.js @@ -0,0 +1,1708 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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 _deleteMethod(resourceGroupName, routeTableName, routeName, 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.beginDeleteMethod(resourceGroupName, routeTableName, routeName, 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); + }); + }); +} + +/** + * Gets the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, routeTableName, routeName, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + 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) { + 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['Route']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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['Route']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all routes in a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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 RouteListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, routeTableName, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}/routes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + 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) { + 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['RouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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 _beginDeleteMethod(resourceGroupName, routeTableName, routeName, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { + throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (routeParameters === null || routeParameters === undefined) { + throw new Error('routeParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/routeTables/{routeTableName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (routeParameters !== null && routeParameters !== undefined) { + let requestModelMapper = new client.models['Route']().mapper(); + requestModel = client.serialize(requestModelMapper, routeParameters, 'routeParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routeParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['Route']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Route']().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); + }); +} + +/** + * Gets all routes in a route table. + * + * @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 RouteListResult} for more information. + * + * {object} [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) { + 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['RouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Routes. */ +class Routes { + /** + * Create a Routes. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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. + */ + deleteMethod(resourceGroupName, routeTableName, routeName, 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._deleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, routeTableName, routeName, options, optionalCallback); + } + } + + /** + * Gets the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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 {Route} - 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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, routeTableName, routeName, 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._get(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, routeTableName, routeName, options, optionalCallback); + } + } + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, routeParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Route} - 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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, optionalCallback); + } + } + + /** + * Gets all routes in a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, routeTableName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, routeTableName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all routes in a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @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 {RouteListResult} - 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 RouteListResult} for more information. + * + * {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(resourceGroupName, routeTableName, 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(resourceGroupName, routeTableName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, routeTableName, options, optionalCallback); + } + } + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, routeTableName, routeName, 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._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, optionalCallback); + } + } + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, routeParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Route} - 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 Route} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, optionalCallback); + } + } + + /** + * Gets all routes in a route table. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all routes in a route table. + * + * @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 {RouteListResult} - 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 RouteListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Routes; diff --git a/lib/services/networkManagement2/lib/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/lib/operations/securityRules.js new file mode 100644 index 0000000000..a1ed0bc9bc --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/securityRules.js @@ -0,0 +1,2006 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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 _deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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.beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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); + }); + }); +} + +/** + * Get the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { + throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); + 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) { + 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['SecurityRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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['SecurityRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 SecurityRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, networkSecurityGroupName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + 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) { + 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['SecurityRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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 _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { + throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { + throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { + throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); + } + if (securityRuleParameters === null || securityRuleParameters === undefined) { + throw new Error('securityRuleParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); + requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (securityRuleParameters !== null && securityRuleParameters !== undefined) { + let requestModelMapper = new client.models['SecurityRule']().mapper(); + requestModel = client.serialize(requestModelMapper, securityRuleParameters, 'securityRuleParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(securityRuleParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['SecurityRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecurityRule']().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); + }); +} + +/** + * Gets all security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 SecurityRuleListResult} for more + * information. + * + * {object} [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) { + 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['SecurityRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 SecurityRules. */ +class SecurityRules { + /** + * Create a SecurityRules. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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. + */ + deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); + } + } + + /** + * Get the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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 {SecurityRule} - 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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkSecurityGroupName, securityRuleName, 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._get(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); + } + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecurityRule} - 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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, optionalCallback); + } + } + + /** + * Gets all security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} for more + * information. + * + * {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(resourceGroupName, networkSecurityGroupName, 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(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, networkSecurityGroupName, options, optionalCallback); + } + } + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network security rule. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); + } + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. + * + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. + * + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' + * + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. + * + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. + * + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. + * + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. + * + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. + * + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecurityRule} - 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 SecurityRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, optionalCallback); + } + } + + /** + * Gets all security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {SecurityRuleListResult} - 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 SecurityRuleListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = SecurityRules; diff --git a/lib/services/networkManagement2/lib/lib/operations/subnets.js b/lib/services/networkManagement2/lib/lib/operations/subnets.js new file mode 100644 index 0000000000..d0ba19ebaa --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/subnets.js @@ -0,0 +1,1991 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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 _deleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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.beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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); + }); + }); +} + +/** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualNetworkName, subnetName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { + throw new Error('subnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Subnet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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['Subnet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubnetListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, virtualNetworkName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/subnets'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + 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) { + 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['SubnetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { + throw new Error('subnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { + throw new Error('subnetName cannot be null or undefined and it must be of type string.'); + } + if (subnetParameters === null || subnetParameters === undefined) { + throw new Error('subnetParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (subnetParameters !== null && subnetParameters !== undefined) { + let requestModelMapper = new client.models['Subnet']().mapper(); + requestModel = client.serialize(requestModelMapper, subnetParameters, 'subnetParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(subnetParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['Subnet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Subnet']().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); + }); +} + +/** + * Gets all subnets in a virtual network. + * + * @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 SubnetListResult} for more information. + * + * {object} [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) { + 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['SubnetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Subnets. */ +class Subnets { + /** + * Create a Subnets. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); + } + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {Subnet} - 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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualNetworkName, subnetName, 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._get(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); + } + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Subnet} - 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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, optionalCallback); + } + } + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + listWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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 {SubnetListResult} - 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 SubnetListResult} for more information. + * + * {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(resourceGroupName, virtualNetworkName, 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(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); + } + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Subnet} - 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 Subnet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, optionalCallback); + } + } + + /** + * Gets all subnets in a virtual network. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @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 {SubnetListResult} - 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 SubnetListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Subnets; diff --git a/lib/services/networkManagement2/lib/lib/operations/usages.js b/lib/services/networkManagement2/lib/lib/operations/usages.js new file mode 100644 index 0000000000..e3a083f0ba --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/usages.js @@ -0,0 +1,469 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * List network usages for a subscription. + * + * @param {string} location The location where resource usage is queried. + * + * @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 UsagesListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, 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 (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/locations/{location}/usages'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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) { + 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['UsagesListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List network usages 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 UsagesListResult} for more information. + * + * {object} [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) { + 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['UsagesListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Usages. */ +class Usages { + /** + * Create a Usages. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * List network usages for a subscription. + * + * @param {string} location The location where resource usage is queried. + * + * @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. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List network usages for a subscription. + * + * @param {string} location The location where resource usage is queried. + * + * @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 {UsagesListResult} - 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 UsagesListResult} for more information. + * + * {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(location, 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(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + + /** + * List network usages for a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List network usages 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} [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 {UsagesListResult} - 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 UsagesListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Usages; diff --git a/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGatewayConnections.js new file mode 100644 index 0000000000..e40db35d68 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGatewayConnections.js @@ -0,0 +1,4221 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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['VirtualNetworkGatewayConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualNetworkGatewayConnectionName, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + 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) { + 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['VirtualNetworkGatewayConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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 _deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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.beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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); + }); + }); +} + + +/** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetworkGatewayConnectionListEntity} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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['VirtualNetworkGatewayConnectionListEntity']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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['ConnectionSharedKey']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key 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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + 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) { + 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['ConnectionSharedKey']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['VirtualNetworkGatewayConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 ConnectionResetSharedKey} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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['ConnectionResetSharedKey']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualNetworkGatewayConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualNetworkGatewayConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetworkGatewayConnection']().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); + }); +} + +/** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + 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 !== 202 && 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); + }); +} + +/** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetworkGatewayConnectionListEntity} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetworkGatewayConnectionListEntity']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ConnectionSharedKey']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ConnectionSharedKey']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ConnectionSharedKey']().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); + }); +} + +/** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 ConnectionResetSharedKey} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ConnectionResetSharedKey']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['ConnectionResetSharedKey']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @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 VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {object} [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) { + 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['VirtualNetworkGatewayConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualNetworkGatewayConnections. */ +class VirtualNetworkGatewayConnections { + /** + * Create a VirtualNetworkGatewayConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._updateTags = _updateTags; + this._setSharedKey = _setSharedKey; + this._getSharedKey = _getSharedKey; + this._list = _list; + this._resetSharedKey = _resetSharedKey; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdateTags = _beginUpdateTags; + this._beginSetSharedKey = _beginSetSharedKey; + this._beginResetSharedKey = _beginResetSharedKey; + this._listNext = _listNext; + } + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualNetworkGatewayConnectionName, 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._get(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); + } + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkGatewayConnectionListEntity} - 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 VirtualNetworkGatewayConnectionListEntity} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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. + */ + setSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 {ConnectionSharedKey} - 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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key 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. + */ + getSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key 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 {ConnectionSharedKey} - 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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); + } + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualNetworkGatewayConnectionListResult} - 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 VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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. + */ + resetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 {ConnectionResetSharedKey} - 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 ConnectionResetSharedKey} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); + } + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkGatewayConnectionListEntity} - 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 VirtualNetworkGatewayConnectionListEntity} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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. + */ + beginSetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. + * + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. + * + * @param {string} parameters.value The virtual network connection shared key + * value. + * + * @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 {ConnectionSharedKey} - 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 ConnectionSharedKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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. + */ + beginResetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. + * + * @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 {ConnectionResetSharedKey} - 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 ConnectionResetSharedKey} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @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 {VirtualNetworkGatewayConnectionListResult} - 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 VirtualNetworkGatewayConnectionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualNetworkGatewayConnections; diff --git a/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGateways.js new file mode 100644 index 0000000000..c649890237 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkGateways.js @@ -0,0 +1,7822 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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) { + 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 _deleteMethod(resourceGroupName, virtualNetworkGatewayName, 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.beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, 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); + }); + }); +} + + +/** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 VirtualNetworkGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['VirtualNetworkGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 VirtualNetworkGatewayListConnectionsResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listConnections(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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) { + 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['VirtualNetworkGatewayListConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _reset(resourceGroupName, virtualNetworkGatewayName, 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.beginReset(resourceGroupName, virtualNetworkGatewayName, 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + * + * {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 _generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + * + * {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 _generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + * + * {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 _getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 BgpPeerStatusListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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['BgpPeerStatusListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + * + * {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 _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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['GatewayRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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['GatewayRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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['VpnClientIPsecParameters']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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['VpnClientIPsecParameters']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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. + * + * {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 _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VpnDeviceScriptParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualNetworkGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetworkGateway']().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); + }); +} + +/** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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 !== 202 && 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); + }); +} + +/** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginReset(resourceGroupName, virtualNetworkGatewayName, 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 gatewayVip = (options && options.gatewayVip !== undefined) ? options.gatewayVip : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (gatewayVip !== null && gatewayVip !== undefined && typeof gatewayVip.valueOf() !== 'string') { + throw new Error('gatewayVip must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (gatewayVip !== null && gatewayVip !== undefined) { + queryParameters.push('gatewayVip=' + encodeURIComponent(gatewayVip)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['VirtualNetworkGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + * + * {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 _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VpnClientParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + * + * {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 _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VpnClientParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + * + * {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 _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 BgpPeerStatusListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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 peer = (options && options.peer !== undefined) ? options.peer : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (peer !== null && peer !== undefined && typeof peer.valueOf() !== 'string') { + throw new Error('peer must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (peer !== null && peer !== undefined) { + queryParameters.push('peer=' + encodeURIComponent(peer)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['BgpPeerStatusListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['GatewayRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (peer === null || peer === undefined || typeof peer.valueOf() !== 'string') { + throw new Error('peer cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('peer=' + encodeURIComponent(peer)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['GatewayRouteListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (vpnclientIpsecParams === null || vpnclientIpsecParams === undefined) { + throw new Error('vpnclientIpsecParams cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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 (vpnclientIpsecParams !== null && vpnclientIpsecParams !== undefined) { + let requestModelMapper = new client.models['VpnClientIPsecParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnclientIpsecParams, 'vpnclientIpsecParams'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnclientIpsecParams, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['VpnClientIPsecParameters']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { + throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); + 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; + // 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['VpnClientIPsecParameters']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkGatewayListResult} for more + * information. + * + * {object} [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) { + 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['VirtualNetworkGatewayListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the connections in a virtual network gateway. + * + * @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 VirtualNetworkGatewayListConnectionsResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listConnectionsNext(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) { + 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['VirtualNetworkGatewayListConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualNetworkGateways. */ +class VirtualNetworkGateways { + /** + * Create a VirtualNetworkGateways. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._updateTags = _updateTags; + this._list = _list; + this._listConnections = _listConnections; + this._reset = _reset; + this._generatevpnclientpackage = _generatevpnclientpackage; + this._generateVpnProfile = _generateVpnProfile; + this._getVpnProfilePackageUrl = _getVpnProfilePackageUrl; + this._getBgpPeerStatus = _getBgpPeerStatus; + this._supportedVpnDevices = _supportedVpnDevices; + this._getLearnedRoutes = _getLearnedRoutes; + this._getAdvertisedRoutes = _getAdvertisedRoutes; + this._setVpnclientIpsecParameters = _setVpnclientIpsecParameters; + this._getVpnclientIpsecParameters = _getVpnclientIpsecParameters; + this._vpnDeviceConfigurationScript = _vpnDeviceConfigurationScript; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdateTags = _beginUpdateTags; + this._beginReset = _beginReset; + this._beginGeneratevpnclientpackage = _beginGeneratevpnclientpackage; + this._beginGenerateVpnProfile = _beginGenerateVpnProfile; + this._beginGetVpnProfilePackageUrl = _beginGetVpnProfilePackageUrl; + this._beginGetBgpPeerStatus = _beginGetBgpPeerStatus; + this._beginGetLearnedRoutes = _beginGetLearnedRoutes; + this._beginGetAdvertisedRoutes = _beginGetAdvertisedRoutes; + this._beginSetVpnclientIpsecParameters = _beginSetVpnclientIpsecParameters; + this._beginGetVpnclientIpsecParameters = _beginGetVpnclientIpsecParameters; + this._listNext = _listNext; + this._listConnectionsNext = _listConnectionsNext; + } + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualNetworkGatewayName, 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._get(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualNetworkGatewayName, 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._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualNetworkGatewayListResult} - 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 VirtualNetworkGatewayListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + listConnectionsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConnections(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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 VirtualNetworkGatewayListConnectionsResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listConnections(resourceGroupName, virtualNetworkGatewayName, 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._listConnections(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConnections(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + resetWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + reset(resourceGroupName, virtualNetworkGatewayName, 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._reset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reset(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generatevpnclientpackageWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {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. + */ + generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generateVpnProfileWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {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. + */ + generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {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. + */ + getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + getBgpPeerStatusWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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 BgpPeerStatusListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + supportedVpnDevicesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {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. + */ + supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, 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._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); + } + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); + } + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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. + */ + vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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 {String} - 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. + * + * {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. + */ + vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + beginResetWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginReset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginReset(resourceGroupName, virtualNetworkGatewayName, 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._beginReset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginReset(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {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. + */ + beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {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. + */ + beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); + } + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {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. + */ + beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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 BgpPeerStatusListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); + } + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); + } + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + } + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkGatewayListResult} - 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 VirtualNetworkGatewayListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @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. + */ + listConnectionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConnectionsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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 VirtualNetworkGatewayListConnectionsResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listConnectionsNext(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._listConnectionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConnectionsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualNetworkGateways; diff --git a/lib/services/networkManagement2/lib/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkPeerings.js new file mode 100644 index 0000000000..2bf0999f6b --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/virtualNetworkPeerings.js @@ -0,0 +1,1883 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 _deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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.beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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); + }); + }); +} + +/** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { + throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); + 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) { + 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['VirtualNetworkPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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['VirtualNetworkPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeeringListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, virtualNetworkName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + 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) { + 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['VirtualNetworkPeeringListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { + throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { + throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkPeeringParameters === null || virtualNetworkPeeringParameters === undefined) { + throw new Error('virtualNetworkPeeringParameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (virtualNetworkPeeringParameters !== null && virtualNetworkPeeringParameters !== undefined) { + let requestModelMapper = new client.models['VirtualNetworkPeering']().mapper(); + requestModel = client.serialize(requestModelMapper, virtualNetworkPeeringParameters, 'virtualNetworkPeeringParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(virtualNetworkPeeringParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualNetworkPeering']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetworkPeering']().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); + }); +} + +/** + * Gets all virtual network peerings in a virtual network. + * + * @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 VirtualNetworkPeeringListResult} for more + * information. + * + * {object} [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) { + 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['VirtualNetworkPeeringListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualNetworkPeerings. */ +class VirtualNetworkPeerings { + /** + * Create a VirtualNetworkPeerings. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + } + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); + } + } + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 {VirtualNetworkPeering} - 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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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._get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkPeering} - 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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, optionalCallback); + } + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + listWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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 {VirtualNetworkPeeringListResult} - 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 VirtualNetworkPeeringListResult} for more + * information. + * + * {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(resourceGroupName, virtualNetworkName, 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(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); + } + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetworkPeering} - 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 VirtualNetworkPeering} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, optionalCallback); + } + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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 {VirtualNetworkPeeringListResult} - 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 VirtualNetworkPeeringListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualNetworkPeerings; diff --git a/lib/services/networkManagement2/lib/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/lib/operations/virtualNetworks.js new file mode 100644 index 0000000000..412ea8f563 --- /dev/null +++ b/lib/services/networkManagement2/lib/lib/operations/virtualNetworks.js @@ -0,0 +1,3360 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {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 _deleteMethod(resourceGroupName, virtualNetworkName, 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.beginDeleteMethod(resourceGroupName, virtualNetworkName, 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); + }); + }); +} + +/** + * Gets the specified virtual network by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualNetworkName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.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.Network/virtualNetworks/{virtualNetworkName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetwork']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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['VirtualNetwork']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, virtualNetworkName, parameters, 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.beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, 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['VirtualNetwork']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets all virtual networks in a subscription. + * + * @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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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}/providers/Microsoft.Network/virtualNetworks'; + 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) { + 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['VirtualNetworkListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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) { + 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['VirtualNetworkListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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 IPAddressAvailabilityResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkIPAddressAvailability(resourceGroupName, virtualNetworkName, 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 ipAddress = (options && options.ipAddress !== undefined) ? options.ipAddress : undefined; + // Validate + try { + if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { + throw new Error('ipAddress 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (ipAddress !== null && ipAddress !== undefined) { + queryParameters.push('ipAddress=' + encodeURIComponent(ipAddress)); + } + 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) { + 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['IPAddressAvailabilityResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListUsageResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listUsage(resourceGroupName, virtualNetworkName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + 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) { + 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['VirtualNetworkListUsageResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + 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 !== 202 && 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); + }); +} + +/** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualNetwork']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualNetwork']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetwork']().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); + }); +} + +/** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, 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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { + throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualNetworks/{virtualNetworkName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualNetwork']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['VirtualNetworkListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 VirtualNetworkListResult} for more + * information. + * + * {object} [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) { + 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['VirtualNetworkListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists usage stats. + * + * @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 VirtualNetworkListUsageResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listUsageNext(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) { + 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['VirtualNetworkListUsageResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualNetworks. */ +class VirtualNetworks { + /** + * Create a VirtualNetworks. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._listAll = _listAll; + this._list = _list; + this._checkIPAddressAvailability = _checkIPAddressAvailability; + this._listUsage = _listUsage; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._listAllNext = _listAllNext; + this._listNext = _listNext; + this._listUsageNext = _listUsageNext; + } + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + deleteMethod(resourceGroupName, virtualNetworkName, 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._deleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Gets the specified virtual network by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @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 {VirtualNetwork} - 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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualNetworkName, 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._get(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetwork} - 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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); + } + } + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetwork} - 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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, virtualNetworkName, parameters, 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._updateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); + } + } + + /** + * Gets all virtual networks in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual networks in 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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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. + */ + checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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 {IPAddressAvailabilityResult} - 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 IPAddressAvailabilityResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkIPAddressAvailability(resourceGroupName, virtualNetworkName, 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._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + listUsageWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsage(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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 {VirtualNetworkListUsageResult} - 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 VirtualNetworkListUsageResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listUsage(resourceGroupName, virtualNetworkName, 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._listUsage(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsage(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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. + */ + beginDeleteMethod(resourceGroupName, virtualNetworkName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, optionalCallback); + } + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetwork} - 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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); + } + } + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualNetwork} - 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 VirtualNetwork} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); + } + } + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists usage stats. + * + * @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. + */ + listUsageNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsageNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists usage stats. + * + * @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 {VirtualNetworkListUsageResult} - 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 VirtualNetworkListUsageResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listUsageNext(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._listUsageNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsageNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualNetworks; diff --git a/lib/services/networkManagement2/lib/models/applicationGateway.js b/lib/services/networkManagement2/lib/models/applicationGateway.js index 47ddea3f90..e6578da902 100644 --- a/lib/services/networkManagement2/lib/models/applicationGateway.js +++ b/lib/services/networkManagement2/lib/models/applicationGateway.js @@ -23,9 +23,9 @@ class ApplicationGateway extends models['Resource'] { * @member {object} [sku] SKU of the application gateway resource. * @member {string} [sku.name] Name of an application gateway SKU. Possible * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large' + * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * @member {string} [sku.tier] Tier of an application gateway. Possible - * values include: 'Standard', 'WAF' + * values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * @member {number} [sku.capacity] Capacity (instance count) of an * application gateway. * @member {object} [sslPolicy] SSL policy of the application gateway @@ -88,6 +88,14 @@ class ApplicationGateway extends models['Resource'] { * Maxium request body size for WAF. * @member {boolean} [enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. + * @member {boolean} [enableFips] Whether FIPS is enabled on the application + * gateway resource. + * @member {object} [autoscaleConfiguration] Autoscale Configuration. + * @member {object} [autoscaleConfiguration.bounds] Autoscale bounds + * @member {number} [autoscaleConfiguration.bounds.min] Lower bound on number + * of Application Gateway instances. + * @member {number} [autoscaleConfiguration.bounds.max] Upper bound on number + * of Application Gateway instances. * @member {string} [resourceGuid] Resource GUID property of the application * gateway resource. * @member {string} [provisioningState] Provisioning state of the application @@ -95,6 +103,8 @@ class ApplicationGateway extends models['Resource'] { * 'Failed'. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. + * @member {array} [zones] A list of availability zones denoting where the + * resource needs to come from. */ constructor() { super(); @@ -377,6 +387,21 @@ class ApplicationGateway extends models['Resource'] { name: 'Boolean' } }, + enableFips: { + required: false, + serializedName: 'properties.enableFips', + type: { + name: 'Boolean' + } + }, + autoscaleConfiguration: { + required: false, + serializedName: 'properties.autoscaleConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayAutoscaleConfiguration' + } + }, resourceGuid: { required: false, serializedName: 'properties.resourceGuid', @@ -397,6 +422,20 @@ class ApplicationGateway extends models['Resource'] { type: { name: 'String' } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js b/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js index 14cb3e2832..5836499b6b 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js @@ -24,8 +24,8 @@ class ApplicationGatewayAuthenticationCertificate extends models['SubResource'] * @member {string} [provisioningState] Provisioning state of the * authentication certificate resource. Possible values are: 'Updating', * 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the authentication certificate that is + * unique within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleBounds.js b/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleBounds.js new file mode 100644 index 0000000000..65931cdbf8 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleBounds.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Application Gateway autoscale bounds on number of Application Gateway + * instance. + * + */ +class ApplicationGatewayAutoscaleBounds { + /** + * Create a ApplicationGatewayAutoscaleBounds. + * @member {number} min Lower bound on number of Application Gateway + * instances. + * @member {number} max Upper bound on number of Application Gateway + * instances. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayAutoscaleBounds + * + * @returns {object} metadata of ApplicationGatewayAutoscaleBounds + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAutoscaleBounds', + type: { + name: 'Composite', + className: 'ApplicationGatewayAutoscaleBounds', + modelProperties: { + min: { + required: true, + serializedName: 'min', + type: { + name: 'Number' + } + }, + max: { + required: true, + serializedName: 'max', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAutoscaleBounds; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js new file mode 100644 index 0000000000..1cdf898a49 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application Gateway autoscale configuration. + * + */ +class ApplicationGatewayAutoscaleConfiguration { + /** + * Create a ApplicationGatewayAutoscaleConfiguration. + * @member {object} bounds Autoscale bounds + * @member {number} [bounds.min] Lower bound on number of Application Gateway + * instances. + * @member {number} [bounds.max] Upper bound on number of Application Gateway + * instances. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationGatewayAutoscaleConfiguration + * + * @returns {object} metadata of ApplicationGatewayAutoscaleConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationGatewayAutoscaleConfiguration', + type: { + name: 'Composite', + className: 'ApplicationGatewayAutoscaleConfiguration', + modelProperties: { + bounds: { + required: true, + serializedName: 'bounds', + type: { + name: 'Composite', + className: 'ApplicationGatewayAutoscaleBounds' + } + } + } + } + }; + } +} + +module.exports = ApplicationGatewayAutoscaleConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js b/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js index 0d2c74fe8d..91f0108d3f 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js @@ -121,7 +121,7 @@ class ApplicationGatewayAvailableSslOptions extends models['Resource'] { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'ApplicationGatewaySslCipherSuiteElementType', type: { name: 'String' } @@ -135,7 +135,7 @@ class ApplicationGatewayAvailableSslOptions extends models['Resource'] { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'ApplicationGatewaySslProtocolElementType', type: { name: 'String' } diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js index 54daf5779f..17c091ffd8 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js @@ -26,8 +26,8 @@ class ApplicationGatewayBackendAddressPool extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the backend * address pool resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Resource that is unique within a resource group. - * This name can be used to access the resource. + * @member {string} [name] Name of the backend address pool that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js index 082f243482..8cc553dbe8 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js @@ -21,9 +21,11 @@ class ApplicationGatewayBackendHealthHttpSettings { * Create a ApplicationGatewayBackendHealthHttpSettings. * @member {object} [backendHttpSettings] Reference of an * ApplicationGatewayBackendHttpSettings resource. - * @member {number} [backendHttpSettings.port] Port - * @member {string} [backendHttpSettings.protocol] Protocol. Possible values - * include: 'Http', 'Https' + * @member {number} [backendHttpSettings.port] The destination port on the + * backend. + * @member {string} [backendHttpSettings.protocol] The protocol used to + * communicate with the backend. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https' * @member {string} [backendHttpSettings.cookieBasedAffinity] Cookie based * affinity. Possible values include: 'Enabled', 'Disabled' * @member {number} [backendHttpSettings.requestTimeout] Request timeout in @@ -58,9 +60,8 @@ class ApplicationGatewayBackendHealthHttpSettings { * @member {string} [backendHttpSettings.provisioningState] Provisioning * state of the backend http settings resource. Possible values are: * 'Updating', 'Deleting', and 'Failed'. - * @member {string} [backendHttpSettings.name] Name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @member {string} [backendHttpSettings.name] Name of the backend http + * settings that is unique within an Application Gateway. * @member {string} [backendHttpSettings.etag] A unique read-only string that * changes whenever the resource is updated. * @member {string} [backendHttpSettings.type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js index 15cdacf101..12e33bee6b 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js @@ -27,8 +27,8 @@ class ApplicationGatewayBackendHealthPool { * @member {string} [backendAddressPool.provisioningState] Provisioning state * of the backend address pool resource. Possible values are: 'Updating', * 'Deleting', and 'Failed'. - * @member {string} [backendAddressPool.name] Resource that is unique within - * a resource group. This name can be used to access the resource. + * @member {string} [backendAddressPool.name] Name of the backend address + * pool that is unique within an Application Gateway. * @member {string} [backendAddressPool.etag] A unique read-only string that * changes whenever the resource is updated. * @member {string} [backendAddressPool.type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js index 5d294aaa9c..fe3cf2b152 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js @@ -20,9 +20,10 @@ const models = require('./index'); class ApplicationGatewayBackendHttpSettings extends models['SubResource'] { /** * Create a ApplicationGatewayBackendHttpSettings. - * @member {number} [port] Port - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {number} [port] The destination port on the backend. + * @member {string} [protocol] The protocol used to communicate with the + * backend. Possible values are 'Http' and 'Https'. Possible values include: + * 'Http', 'Https' * @member {string} [cookieBasedAffinity] Cookie based affinity. Possible * values include: 'Enabled', 'Disabled' * @member {number} [requestTimeout] Request timeout in seconds. Application @@ -52,8 +53,8 @@ class ApplicationGatewayBackendHttpSettings extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the backend * http settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the backend http settings that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js index 36c3964d12..67aba664c9 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js @@ -30,8 +30,8 @@ class ApplicationGatewayFrontendIPConfiguration extends models['SubResource'] { * @member {string} [publicIPAddress.id] Resource ID. * @member {string} [provisioningState] Provisioning state of the public IP * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the frontend IP configuration that is + * unique within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js index 1eff4ee554..fcd3586a0b 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js @@ -23,8 +23,8 @@ class ApplicationGatewayFrontendPort extends models['SubResource'] { * @member {number} [port] Frontend port * @member {string} [provisioningState] Provisioning state of the frontend * port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the frontend port that is unique within an + * Application Gateway * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js b/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js index edd2db76d3..72b5481ad9 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js @@ -26,8 +26,8 @@ class ApplicationGatewayHttpListener extends models['SubResource'] { * @member {object} [frontendPort] Frontend port resource of an application * gateway. * @member {string} [frontendPort.id] Resource ID. - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {string} [protocol] Protocol of the HTTP listener. Possible values + * are 'Http' and 'Https'. Possible values include: 'Http', 'Https' * @member {string} [hostName] Host name of HTTP listener. * @member {object} [sslCertificate] SSL certificate resource of an * application gateway. @@ -37,8 +37,8 @@ class ApplicationGatewayHttpListener extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the HTTP * listener resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the HTTP listener that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js index 6e170ed225..e8b43dce54 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js @@ -27,8 +27,8 @@ class ApplicationGatewayIPConfiguration extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the application * gateway subnet resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the IP configuration that is unique within + * an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js index 7f52241d11..2d32927d50 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js @@ -32,8 +32,8 @@ class ApplicationGatewayPathRule extends models['SubResource'] { * @member {string} [redirectConfiguration.id] Resource ID. * @member {string} [provisioningState] Path rule of URL path map resource. * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the path rule that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js b/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js index 78e535c3b8..df581e90a0 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js @@ -20,8 +20,8 @@ const models = require('./index'); class ApplicationGatewayProbe extends models['SubResource'] { /** * Create a ApplicationGatewayProbe. - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {string} [protocol] The protocol used for the probe. Possible + * values are 'Http' and 'Https'. Possible values include: 'Http', 'Https' * @member {string} [host] Host name to send the probe to. * @member {string} [path] Relative path of probe. Valid path starts from * '/'. Probe is sent to ://: @@ -48,8 +48,8 @@ class ApplicationGatewayProbe extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the backend * http settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the probe that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js index 9e1947b563..73285d6a03 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js @@ -35,8 +35,8 @@ class ApplicationGatewayRedirectConfiguration extends models['SubResource'] { * @member {array} [urlPathMaps] Url path maps specifying default redirect * configuration. * @member {array} [pathRules] Path rules specifying redirect configuration. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the redirect configuration that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js index 22878d6912..50ee73657f 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js @@ -25,8 +25,8 @@ class ApplicationGatewayRequestRoutingRule extends models['SubResource'] { * @member {object} [backendAddressPool] Backend address pool resource of the * application gateway. * @member {string} [backendAddressPool.id] Resource ID. - * @member {object} [backendHttpSettings] Frontend port resource of the - * application gateway. + * @member {object} [backendHttpSettings] Backend http settings resource of + * the application gateway. * @member {string} [backendHttpSettings.id] Resource ID. * @member {object} [httpListener] Http listener resource of the application * gateway. @@ -40,8 +40,8 @@ class ApplicationGatewayRequestRoutingRule extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the request * routing rule resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the request routing rule that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySku.js b/lib/services/networkManagement2/lib/models/applicationGatewaySku.js index 2bf5af52f6..7e76996b52 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySku.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewaySku.js @@ -19,9 +19,9 @@ class ApplicationGatewaySku { * Create a ApplicationGatewaySku. * @member {string} [name] Name of an application gateway SKU. Possible * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large' + * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * @member {string} [tier] Tier of an application gateway. Possible values - * include: 'Standard', 'WAF' + * include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * @member {number} [capacity] Capacity (instance count) of an application * gateway. */ diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js index 0c13a53284..7881235bf0 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js @@ -29,8 +29,8 @@ class ApplicationGatewaySslCertificate extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the SSL * certificate resource Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the SSL certificate that is unique within + * an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js index 1d1e7bdd49..14f4a8e3bb 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js @@ -54,7 +54,7 @@ class ApplicationGatewaySslPolicy { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'ApplicationGatewaySslProtocolElementType', type: { name: 'String' } @@ -82,7 +82,7 @@ class ApplicationGatewaySslPolicy { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'ApplicationGatewaySslCipherSuiteElementType', type: { name: 'String' } diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js index 8c522f4c52..0d3688ed67 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js @@ -20,7 +20,7 @@ const models = require('./index'); class ApplicationGatewaySslPredefinedPolicy extends models['SubResource'] { /** * Create a ApplicationGatewaySslPredefinedPolicy. - * @member {string} [name] Name of Ssl predefined policy. + * @member {string} [name] Name of the Ssl predefined policy. * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the * specified order for application gateway. * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to @@ -66,7 +66,7 @@ class ApplicationGatewaySslPredefinedPolicy extends models['SubResource'] { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'ApplicationGatewaySslCipherSuiteElementType', type: { name: 'String' } diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js b/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js index c49cf43292..29032c22f2 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js @@ -34,8 +34,8 @@ class ApplicationGatewayUrlPathMap extends models['SubResource'] { * @member {string} [provisioningState] Provisioning state of the backend * http settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the URL path map that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. * @member {string} [type] Type of the resource. diff --git a/lib/services/networkManagement2/lib/models/azureFirewall.js b/lib/services/networkManagement2/lib/models/azureFirewall.js new file mode 100644 index 0000000000..977817bd58 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewall.js @@ -0,0 +1,163 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Azure Firewall resource + * + * @extends models['Resource'] + */ +class AzureFirewall extends models['Resource'] { + /** + * Create a AzureFirewall. + * @member {array} [applicationRuleCollections] Collection of application + * rule collections used by a Azure Firewall. + * @member {array} [networkRuleCollections] Collection of network rule + * collections used by a Azure Firewall. + * @member {array} [ipConfigurations] IP configuration of the Azure Firewall + * resource. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureFirewall + * + * @returns {object} metadata of AzureFirewall + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewall', + type: { + name: 'Composite', + className: 'AzureFirewall', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + applicationRuleCollections: { + required: false, + serializedName: 'properties.applicationRuleCollections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallApplicationRuleCollectionElementType', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRuleCollection' + } + } + } + }, + networkRuleCollections: { + required: false, + serializedName: 'properties.networkRuleCollections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallNetworkRuleCollectionElementType', + type: { + name: 'Composite', + className: 'AzureFirewallNetworkRuleCollection' + } + } + } + }, + ipConfigurations: { + required: false, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallIPConfigurationElementType', + type: { + name: 'Composite', + className: 'AzureFirewallIPConfiguration' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewall; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js new file mode 100644 index 0000000000..309a13d64f --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties of an application rule. + * + */ +class AzureFirewallApplicationRule { + /** + * Create a AzureFirewallApplicationRule. + * @member {string} [name] Name of the application rule. + * @member {string} [description] Description of the rule. + * @member {array} [sourceAddresses] List of source IP addresses for this + * rule. + * @member {array} [protocols] Array of ApplicationRuleProtocols. + * @member {array} [targetUrls] List of URLs for this rule. + */ + constructor() { + } + + /** + * Defines the metadata of AzureFirewallApplicationRule + * + * @returns {object} metadata of AzureFirewallApplicationRule + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallApplicationRule', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRule', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + sourceAddresses: { + required: false, + serializedName: 'sourceAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + protocols: { + required: false, + serializedName: 'protocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallApplicationRuleProtocolElementType', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRuleProtocol' + } + } + } + }, + targetUrls: { + required: false, + serializedName: 'targetUrls', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureFirewallApplicationRule; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js new file mode 100644 index 0000000000..4e883e0ad6 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Application rule collection resource + * + * @extends models['SubResource'] + */ +class AzureFirewallApplicationRuleCollection extends models['SubResource'] { + /** + * Create a AzureFirewallApplicationRuleCollection. + * @member {number} [priority] Priority of the application rule collection + * resource. + * @member {object} [action] The action type of a rule collection + * @member {string} [action.type] The type of action. Possible values + * include: 'Allow', 'Deny' + * @member {array} [rules] Collection of rules used by a application rule + * collection. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureFirewallApplicationRuleCollection + * + * @returns {object} metadata of AzureFirewallApplicationRuleCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallApplicationRuleCollection', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRuleCollection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'properties.priority', + constraints: { + InclusiveMaximum: 65000, + InclusiveMinimum: 100 + }, + type: { + name: 'Number' + } + }, + action: { + required: false, + serializedName: 'properties.action', + type: { + name: 'Composite', + className: 'AzureFirewallRCAction' + } + }, + rules: { + required: false, + serializedName: 'properties.rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallApplicationRuleElementType', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRule' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallApplicationRuleCollection; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js new file mode 100644 index 0000000000..92347d2624 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * Properties of the application rule protocol. + * + */ +class AzureFirewallApplicationRuleProtocol { + /** + * Create a AzureFirewallApplicationRuleProtocol. + * @member {string} [protocolType] Protocol type. Possible values include: + * 'Http', 'Https' + * @member {number} [port] Port number for the protocol, cannot be greater + * than 64000. This field is optional. + */ + constructor() { + } + + /** + * Defines the metadata of AzureFirewallApplicationRuleProtocol + * + * @returns {object} metadata of AzureFirewallApplicationRuleProtocol + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallApplicationRuleProtocol', + type: { + name: 'Composite', + className: 'AzureFirewallApplicationRuleProtocol', + modelProperties: { + protocolType: { + required: false, + serializedName: 'protocolType', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + constraints: { + InclusiveMaximum: 64000, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallApplicationRuleProtocol; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js b/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js new file mode 100644 index 0000000000..c3f6ec2326 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * IP configuration of an Azure Firewall. + * + * @extends models['SubResource'] + */ +class AzureFirewallIPConfiguration extends models['SubResource'] { + /** + * Create a AzureFirewallIPConfiguration. + * @member {string} [privateIPAddress] The Firewall Internal Load Balancer IP + * to be used as the next hop in User Defined Routes. + * @member {object} [subnet] Reference of the subnet resource. This resource + * must be named 'AzureFirewallSubnet'. + * @member {string} [subnet.id] Resource ID. + * @member {object} [internalPublicIpAddress] Reference of the PublicIP + * resource. This field is a mandatory input. + * @member {string} [internalPublicIpAddress.id] Resource ID. + * @member {object} [publicIPAddress] Reference of the PublicIP resource. + * This field is populated in the output. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever + * the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureFirewallIPConfiguration + * + * @returns {object} metadata of AzureFirewallIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallIPConfiguration', + type: { + name: 'Composite', + className: 'AzureFirewallIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + privateIPAddress: { + required: false, + serializedName: 'properties.privateIPAddress', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + internalPublicIpAddress: { + required: false, + serializedName: 'properties.internalPublicIpAddress', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + publicIPAddress: { + required: false, + serializedName: 'properties.publicIPAddress', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallListResult.js b/lib/services/networkManagement2/lib/models/azureFirewallListResult.js new file mode 100644 index 0000000000..fb1febc884 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallListResult.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Response for ListAzureFirewalls API service call. + */ +class AzureFirewallListResult extends Array { + /** + * Create a AzureFirewallListResult. + * @member {string} [nextLink] URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureFirewallListResult + * + * @returns {object} metadata of AzureFirewallListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallListResult', + type: { + name: 'Composite', + className: 'AzureFirewallListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallElementType', + type: { + name: 'Composite', + className: 'AzureFirewall' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallListResult; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js new file mode 100644 index 0000000000..216cc019c1 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js @@ -0,0 +1,121 @@ +/* + * 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'; + +/** + * Properties of the network rule. + * + */ +class AzureFirewallNetworkRule { + /** + * Create a AzureFirewallNetworkRule. + * @member {string} [name] Name of the network rule. + * @member {string} [description] Description of the rule. + * @member {array} [protocols] Array of AzureFirewallNetworkRuleProtocols. + * @member {array} [sourceAddresses] List of source IP addresses for this + * rule. + * @member {array} [destinationAddresses] List of destination IP addresses. + * @member {array} [destinationPorts] List of destination ports. + */ + constructor() { + } + + /** + * Defines the metadata of AzureFirewallNetworkRule + * + * @returns {object} metadata of AzureFirewallNetworkRule + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallNetworkRule', + type: { + name: 'Composite', + className: 'AzureFirewallNetworkRule', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + protocols: { + required: false, + serializedName: 'protocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallNetworkRuleProtocolElementType', + type: { + name: 'String' + } + } + } + }, + sourceAddresses: { + required: false, + serializedName: 'sourceAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationAddresses: { + required: false, + serializedName: 'destinationAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + destinationPorts: { + required: false, + serializedName: 'destinationPorts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureFirewallNetworkRule; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js new file mode 100644 index 0000000000..7a073e2e1f --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network rule collection resource + * + * @extends models['SubResource'] + */ +class AzureFirewallNetworkRuleCollection extends models['SubResource'] { + /** + * Create a AzureFirewallNetworkRuleCollection. + * @member {number} [priority] Priority of the network rule collection + * resource. + * @member {object} [action] The action type of a rule collection + * @member {string} [action.type] The type of action. Possible values + * include: 'Allow', 'Deny' + * @member {array} [rules] Collection of rules used by a network rule + * collection. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureFirewallNetworkRuleCollection + * + * @returns {object} metadata of AzureFirewallNetworkRuleCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallNetworkRuleCollection', + type: { + name: 'Composite', + className: 'AzureFirewallNetworkRuleCollection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'properties.priority', + constraints: { + InclusiveMaximum: 65000, + InclusiveMinimum: 100 + }, + type: { + name: 'Number' + } + }, + action: { + required: false, + serializedName: 'properties.action', + type: { + name: 'Composite', + className: 'AzureFirewallRCAction' + } + }, + rules: { + required: false, + serializedName: 'properties.rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureFirewallNetworkRuleElementType', + type: { + name: 'Composite', + className: 'AzureFirewallNetworkRule' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallNetworkRuleCollection; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js b/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js new file mode 100644 index 0000000000..24277357c5 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * Properties of the AzureFirewallRCAction. + * + */ +class AzureFirewallRCAction { + /** + * Create a AzureFirewallRCAction. + * @member {string} [type] The type of action. Possible values include: + * 'Allow', 'Deny' + */ + constructor() { + } + + /** + * Defines the metadata of AzureFirewallRCAction + * + * @returns {object} metadata of AzureFirewallRCAction + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureFirewallRCAction', + type: { + name: 'Composite', + className: 'AzureFirewallRCAction', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureFirewallRCAction; diff --git a/lib/services/networkManagement2/lib/models/connectionSharedKey.js b/lib/services/networkManagement2/lib/models/connectionSharedKey.js index a74b9eeeca..ad71412918 100644 --- a/lib/services/networkManagement2/lib/models/connectionSharedKey.js +++ b/lib/services/networkManagement2/lib/models/connectionSharedKey.js @@ -10,16 +10,20 @@ 'use strict'; +const models = require('./index'); + /** * Response for GetConnectionSharedKey API service call * + * @extends models['SubResource'] */ -class ConnectionSharedKey { +class ConnectionSharedKey extends models['SubResource'] { /** * Create a ConnectionSharedKey. * @member {string} value The virtual network connection shared key value. */ constructor() { + super(); } /** @@ -36,6 +40,13 @@ class ConnectionSharedKey { name: 'Composite', className: 'ConnectionSharedKey', modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, value: { required: true, serializedName: 'value', diff --git a/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js b/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js index d246e24d1f..562069dfc6 100644 --- a/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js +++ b/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js @@ -15,11 +15,16 @@ const models = require('./index'); /** * A DDoS protection plan in a resource group. * - * @extends models['Resource'] + * @extends models['BaseResource'] */ -class DdosProtectionPlan extends models['Resource'] { +class DdosProtectionPlan extends models['BaseResource'] { /** * Create a DdosProtectionPlan. + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. * @member {string} [resourceGuid] The resource GUID property of the DDoS * protection plan resource. It uniquely identifies the resource, even if the * user changes its name or migrate the resource across subscriptions or @@ -52,6 +57,7 @@ class DdosProtectionPlan extends models['Resource'] { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' diff --git a/lib/services/networkManagement2/lib/models/deviceProperties.js b/lib/services/networkManagement2/lib/models/deviceProperties.js new file mode 100644 index 0000000000..c9652c5cd9 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/deviceProperties.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of properties of the device. + * + */ +class DeviceProperties { + /** + * Create a DeviceProperties. + * @member {string} [deviceVendor] Name of the device Vendor. + * @member {string} [deviceModel] Model of the device. + * @member {number} [linkSpeedInMbps] Link speed. + */ + constructor() { + } + + /** + * Defines the metadata of DeviceProperties + * + * @returns {object} metadata of DeviceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'DeviceProperties', + type: { + name: 'Composite', + className: 'DeviceProperties', + modelProperties: { + deviceVendor: { + required: false, + serializedName: 'deviceVendor', + type: { + name: 'String' + } + }, + deviceModel: { + required: false, + serializedName: 'deviceModel', + type: { + name: 'String' + } + }, + linkSpeedInMbps: { + required: false, + serializedName: 'linkSpeedInMbps', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DeviceProperties; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js index 5eb3544870..4fc37d0452 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js @@ -17,8 +17,8 @@ class ExpressRouteCircuitArpTable { /** * Create a ExpressRouteCircuitArpTable. - * @member {number} [age] Age - * @member {string} [interfaceProperty] Interface + * @member {number} [age] Entry age in minutes + * @member {string} [interfaceProperty] Interface address * @member {string} [ipAddress] The IP address. * @member {string} [macAddress] The MAC address. */ diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js index d3a4e5f351..aca3c55463 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js @@ -17,11 +17,13 @@ class ExpressRouteCircuitRoutesTable { /** * Create a ExpressRouteCircuitRoutesTable. - * @member {string} [network] network - * @member {string} [nextHop] nextHop - * @member {string} [locPrf] locPrf - * @member {number} [weight] weight. - * @member {string} [path] path + * @member {string} [network] IP address of a network entity + * @member {string} [nextHop] NextHop address + * @member {string} [locPrf] Local preference value as set with the set + * local-preference route-map configuration command + * @member {number} [weight] Route Weight. + * @member {string} [path] Autonomous system paths to the destination + * network. */ constructor() { } diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js index 9faca22420..a7c16eec66 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js @@ -17,7 +17,7 @@ class ExpressRouteCircuitRoutesTableSummary { /** * Create a ExpressRouteCircuitRoutesTableSummary. - * @member {string} [neighbor] Neighbor + * @member {string} [neighbor] IP address of the neighbor. * @member {number} [v] BGP version number spoken to the neighbor. * @member {number} [as] Autonomous system number. * @member {string} [upDown] The length of time that the BGP session has been diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js index 21e3b6f300..180429e70e 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js @@ -130,7 +130,6 @@ class ExpressRouteCrossConnection extends models['Resource'] { }, peeringLocation: { required: false, - readOnly: true, serializedName: 'properties.peeringLocation', type: { name: 'String' @@ -138,7 +137,6 @@ class ExpressRouteCrossConnection extends models['Resource'] { }, bandwidthInMbps: { required: false, - readOnly: true, serializedName: 'properties.bandwidthInMbps', type: { name: 'Number' @@ -146,7 +144,6 @@ class ExpressRouteCrossConnection extends models['Resource'] { }, expressRouteCircuit: { required: false, - readOnly: true, serializedName: 'properties.expressRouteCircuit', type: { name: 'Composite', diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js index 31abfbf098..1fe2499774 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js @@ -221,7 +221,6 @@ class ExpressRouteCrossConnectionPeering extends models['SubResource'] { }, gatewayManagerEtag: { required: false, - readOnly: true, serializedName: 'properties.gatewayManagerEtag', type: { name: 'String' diff --git a/lib/services/networkManagement2/lib/models/flowLogInformation.js b/lib/services/networkManagement2/lib/models/flowLogInformation.js index 9efb176e4e..2ec3d71a8e 100644 --- a/lib/services/networkManagement2/lib/models/flowLogInformation.js +++ b/lib/services/networkManagement2/lib/models/flowLogInformation.js @@ -13,14 +13,15 @@ const models = require('./index'); /** - * Information on the configuration of flow log. + * Information on the configuration of flow log and traffic analytics + * (optional) . * */ class FlowLogInformation { /** * Create a FlowLogInformation. * @member {string} targetResourceId The ID of the resource to configure for - * flow logging. + * flow log and traffic analytics (optional) . * @member {string} storageId ID of the storage account which is used to * store the flow log. * @member {boolean} enabled Flag to enable/disable flow logging. @@ -29,6 +30,21 @@ class FlowLogInformation { * records. * @member {boolean} [retentionPolicy.enabled] Flag to enable/disable * retention. + * @member {object} [flowAnalyticsConfiguration] + * @member {object} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration] + * @member {boolean} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled] + * Flag to enable/disable traffic analytics. + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId] + * The resource guid of the attached workspace + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion] + * The location of the attached workspace + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] + * Resource Id of the attached workspace */ constructor() { } @@ -75,6 +91,14 @@ class FlowLogInformation { name: 'Composite', className: 'RetentionPolicyParameters' } + }, + flowAnalyticsConfiguration: { + required: false, + serializedName: 'flowAnalyticsConfiguration', + type: { + name: 'Composite', + className: 'TrafficAnalyticsProperties' + } } } } diff --git a/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js b/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js index 0f9221918d..f3ebc41d6e 100644 --- a/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js +++ b/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js @@ -11,14 +11,15 @@ 'use strict'; /** - * Parameters that define a resource to query flow log status. + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. * */ class FlowLogStatusParameters { /** * Create a FlowLogStatusParameters. * @member {string} targetResourceId The target resource where getting the - * flow logging status. + * flow log and traffic analytics (optional) status. */ constructor() { } diff --git a/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js b/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js new file mode 100644 index 0000000000..43fd740986 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of Vpn-Sites + * + */ +class GetVpnSitesConfigurationRequest { + /** + * Create a GetVpnSitesConfigurationRequest. + * @member {array} [vpnSites] List of resource-ids of the vpn-sites for which + * config is to be downloaded. + * @member {string} [outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + */ + constructor() { + } + + /** + * Defines the metadata of GetVpnSitesConfigurationRequest + * + * @returns {object} metadata of GetVpnSitesConfigurationRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'GetVpnSitesConfigurationRequest', + type: { + name: 'Composite', + className: 'GetVpnSitesConfigurationRequest', + modelProperties: { + vpnSites: { + required: false, + serializedName: 'vpnSites', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + outputBlobSasUrl: { + required: false, + serializedName: 'outputBlobSasUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GetVpnSitesConfigurationRequest; diff --git a/lib/services/networkManagement2/lib/models/httpConfiguration.js b/lib/services/networkManagement2/lib/models/httpConfiguration.js new file mode 100644 index 0000000000..7c285c13f1 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/httpConfiguration.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * HTTP configuration of the connectivity check. + * + */ +class HTTPConfiguration { + /** + * Create a HTTPConfiguration. + * @member {string} [method] HTTP method. Possible values include: 'Get' + * @member {array} [headers] List of HTTP headers. + * @member {array} [validStatusCodes] Valid status codes. + */ + constructor() { + } + + /** + * Defines the metadata of HTTPConfiguration + * + * @returns {object} metadata of HTTPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'HTTPConfiguration', + type: { + name: 'Composite', + className: 'HTTPConfiguration', + modelProperties: { + method: { + required: false, + serializedName: 'method', + type: { + name: 'String' + } + }, + headers: { + required: false, + serializedName: 'headers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HTTPHeaderElementType', + type: { + name: 'Composite', + className: 'HTTPHeader' + } + } + } + }, + validStatusCodes: { + required: false, + serializedName: 'validStatusCodes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = HTTPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js b/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js new file mode 100644 index 0000000000..b534f34173 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * HubVirtualNetworkConnection Resource. + * + * @extends models['Resource'] + */ +class HubVirtualNetworkConnection extends models['Resource'] { + /** + * Create a HubVirtualNetworkConnection. + * @member {object} [remoteVirtualNetwork] Reference to the remote virtual + * network. + * @member {string} [remoteVirtualNetwork.id] Resource ID. + * @member {boolean} [allowHubToRemoteVnetTransit] VirtualHub to RemoteVnet + * transit to enabled or not. + * @member {boolean} [allowRemoteVnetToUseHubVnetGateways] Allow RemoteVnet + * to use Virtual Hub's gateways. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HubVirtualNetworkConnection + * + * @returns {object} metadata of HubVirtualNetworkConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'HubVirtualNetworkConnection', + type: { + name: 'Composite', + className: 'HubVirtualNetworkConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + remoteVirtualNetwork: { + required: false, + serializedName: 'properties.remoteVirtualNetwork', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + allowHubToRemoteVnetTransit: { + required: false, + serializedName: 'properties.allowHubToRemoteVnetTransit', + type: { + name: 'Boolean' + } + }, + allowRemoteVnetToUseHubVnetGateways: { + required: false, + serializedName: 'properties.allowRemoteVnetToUseHubVnetGateways', + type: { + name: 'Boolean' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HubVirtualNetworkConnection; diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index e620b9e1f6..dc2fde51e5 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -28,6 +28,214 @@ export interface SubResource extends BaseResource { id?: string; } +/** + * @class + * Initializes a new instance of the AzureFirewallIPConfiguration class. + * @constructor + * IP configuration of an Azure Firewall. + * + * @member {string} [privateIPAddress] The Firewall Internal Load Balancer IP + * to be used as the next hop in User Defined Routes. + * @member {object} [subnet] Reference of the subnet resource. This resource + * must be named 'AzureFirewallSubnet'. + * @member {string} [subnet.id] Resource ID. + * @member {object} [internalPublicIpAddress] Reference of the PublicIP + * resource. This field is a mandatory input. + * @member {string} [internalPublicIpAddress.id] Resource ID. + * @member {object} [publicIPAddress] Reference of the PublicIP resource. This + * field is populated in the output. + * @member {string} [publicIPAddress.id] Resource ID. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [name] Name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] A unique read-only string that changes whenever the + * resource is updated. + */ +export interface AzureFirewallIPConfiguration extends SubResource { + privateIPAddress?: string; + subnet?: SubResource; + internalPublicIpAddress?: SubResource; + publicIPAddress?: SubResource; + provisioningState?: string; + name?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallRCAction class. + * @constructor + * Properties of the AzureFirewallRCAction. + * + * @member {string} [type] The type of action. Possible values include: + * 'Allow', 'Deny' + */ +export interface AzureFirewallRCAction { + type?: string; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallApplicationRuleProtocol class. + * @constructor + * Properties of the application rule protocol. + * + * @member {string} [protocolType] Protocol type. Possible values include: + * 'Http', 'Https' + * @member {number} [port] Port number for the protocol, cannot be greater than + * 64000. This field is optional. + */ +export interface AzureFirewallApplicationRuleProtocol { + protocolType?: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallApplicationRule class. + * @constructor + * Properties of an application rule. + * + * @member {string} [name] Name of the application rule. + * @member {string} [description] Description of the rule. + * @member {array} [sourceAddresses] List of source IP addresses for this rule. + * @member {array} [protocols] Array of ApplicationRuleProtocols. + * @member {array} [targetUrls] List of URLs for this rule. + */ +export interface AzureFirewallApplicationRule { + name?: string; + description?: string; + sourceAddresses?: string[]; + protocols?: AzureFirewallApplicationRuleProtocol[]; + targetUrls?: string[]; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallApplicationRuleCollection class. + * @constructor + * Application rule collection resource + * + * @member {number} [priority] Priority of the application rule collection + * resource. + * @member {object} [action] The action type of a rule collection + * @member {string} [action.type] The type of action. Possible values include: + * 'Allow', 'Deny' + * @member {array} [rules] Collection of rules used by a application rule + * collection. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface AzureFirewallApplicationRuleCollection extends SubResource { + priority?: number; + action?: AzureFirewallRCAction; + rules?: AzureFirewallApplicationRule[]; + provisioningState?: string; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallNetworkRule class. + * @constructor + * Properties of the network rule. + * + * @member {string} [name] Name of the network rule. + * @member {string} [description] Description of the rule. + * @member {array} [protocols] Array of AzureFirewallNetworkRuleProtocols. + * @member {array} [sourceAddresses] List of source IP addresses for this rule. + * @member {array} [destinationAddresses] List of destination IP addresses. + * @member {array} [destinationPorts] List of destination ports. + */ +export interface AzureFirewallNetworkRule { + name?: string; + description?: string; + protocols?: string[]; + sourceAddresses?: string[]; + destinationAddresses?: string[]; + destinationPorts?: string[]; +} + +/** + * @class + * Initializes a new instance of the AzureFirewallNetworkRuleCollection class. + * @constructor + * Network rule collection resource + * + * @member {number} [priority] Priority of the network rule collection + * resource. + * @member {object} [action] The action type of a rule collection + * @member {string} [action.type] The type of action. Possible values include: + * 'Allow', 'Deny' + * @member {array} [rules] Collection of rules used by a network rule + * collection. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [name] Gets name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface AzureFirewallNetworkRuleCollection extends SubResource { + priority?: number; + action?: AzureFirewallRCAction; + rules?: AzureFirewallNetworkRule[]; + provisioningState?: string; + name?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Common resource representation. + * + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + */ +export interface Resource extends BaseResource { + id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the AzureFirewall class. + * @constructor + * Azure Firewall resource + * + * @member {array} [applicationRuleCollections] Collection of application rule + * collections used by a Azure Firewall. + * @member {array} [networkRuleCollections] Collection of network rule + * collections used by a Azure Firewall. + * @member {array} [ipConfigurations] IP configuration of the Azure Firewall + * resource. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface AzureFirewall extends Resource { + applicationRuleCollections?: AzureFirewallApplicationRuleCollection[]; + networkRuleCollections?: AzureFirewallNetworkRuleCollection[]; + ipConfigurations?: AzureFirewallIPConfiguration[]; + provisioningState?: string; + readonly etag?: string; +} + /** * @class * Initializes a new instance of the BackendAddressPool class. @@ -332,26 +540,6 @@ export interface InboundNatRule extends SubResource { etag?: string; } -/** - * @class - * Initializes a new instance of the Resource class. - * @constructor - * Common resource representation. - * - * @member {string} [id] Resource ID. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} [location] Resource location. - * @member {object} [tags] Resource tags. - */ -export interface Resource extends BaseResource { - id?: string; - readonly name?: string; - readonly type?: string; - location?: string; - tags?: { [propertyName: string]: string }; -} - /** * @class * Initializes a new instance of the ApplicationSecurityGroup class. @@ -1267,8 +1455,8 @@ export interface ApplicationGatewayBackendAddress { * @member {string} [provisioningState] Provisioning state of the backend * address pool resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Resource that is unique within a resource group. - * This name can be used to access the resource. + * @member {string} [name] Name of the backend address pool that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1305,9 +1493,10 @@ export interface ApplicationGatewayConnectionDraining { * @constructor * Backend address pool settings of an application gateway. * - * @member {number} [port] Port - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {number} [port] The destination port on the backend. + * @member {string} [protocol] The protocol used to communicate with the + * backend. Possible values are 'Http' and 'Https'. Possible values include: + * 'Http', 'Https' * @member {string} [cookieBasedAffinity] Cookie based affinity. Possible * values include: 'Enabled', 'Disabled' * @member {number} [requestTimeout] Request timeout in seconds. Application @@ -1337,8 +1526,8 @@ export interface ApplicationGatewayConnectionDraining { * @member {string} [provisioningState] Provisioning state of the backend http * settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the backend http settings that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1604,9 +1793,11 @@ export interface ApplicationGatewayBackendHealthServer { * * @member {object} [backendHttpSettings] Reference of an * ApplicationGatewayBackendHttpSettings resource. - * @member {number} [backendHttpSettings.port] Port - * @member {string} [backendHttpSettings.protocol] Protocol. Possible values - * include: 'Http', 'Https' + * @member {number} [backendHttpSettings.port] The destination port on the + * backend. + * @member {string} [backendHttpSettings.protocol] The protocol used to + * communicate with the backend. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https' * @member {string} [backendHttpSettings.cookieBasedAffinity] Cookie based * affinity. Possible values include: 'Enabled', 'Disabled' * @member {number} [backendHttpSettings.requestTimeout] Request timeout in @@ -1640,9 +1831,8 @@ export interface ApplicationGatewayBackendHealthServer { * @member {string} [backendHttpSettings.provisioningState] Provisioning state * of the backend http settings resource. Possible values are: 'Updating', * 'Deleting', and 'Failed'. - * @member {string} [backendHttpSettings.name] Name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @member {string} [backendHttpSettings.name] Name of the backend http + * settings that is unique within an Application Gateway. * @member {string} [backendHttpSettings.etag] A unique read-only string that * changes whenever the resource is updated. * @member {string} [backendHttpSettings.type] Type of the resource. @@ -1668,8 +1858,8 @@ export interface ApplicationGatewayBackendHealthHttpSettings { * @member {string} [backendAddressPool.provisioningState] Provisioning state * of the backend address pool resource. Possible values are: 'Updating', * 'Deleting', and 'Failed'. - * @member {string} [backendAddressPool.name] Resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [backendAddressPool.name] Name of the backend address pool + * that is unique within an Application Gateway. * @member {string} [backendAddressPool.etag] A unique read-only string that * changes whenever the resource is updated. * @member {string} [backendAddressPool.type] Type of the resource. @@ -1701,9 +1891,9 @@ export interface ApplicationGatewayBackendHealth { * * @member {string} [name] Name of an application gateway SKU. Possible values * include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large' + * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * @member {string} [tier] Tier of an application gateway. Possible values - * include: 'Standard', 'WAF' + * include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * @member {number} [capacity] Capacity (instance count) of an application * gateway. */ @@ -1753,8 +1943,8 @@ export interface ApplicationGatewaySslPolicy { * @member {string} [provisioningState] Provisioning state of the application * gateway subnet resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the IP configuration that is unique within + * an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1777,8 +1967,8 @@ export interface ApplicationGatewayIPConfiguration extends SubResource { * @member {string} [provisioningState] Provisioning state of the * authentication certificate resource. Possible values are: 'Updating', * 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the authentication certificate that is + * unique within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1806,8 +1996,8 @@ export interface ApplicationGatewayAuthenticationCertificate extends SubResource * @member {string} [provisioningState] Provisioning state of the SSL * certificate resource Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the SSL certificate that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1838,8 +2028,8 @@ export interface ApplicationGatewaySslCertificate extends SubResource { * @member {string} [publicIPAddress.id] Resource ID. * @member {string} [provisioningState] Provisioning state of the public IP * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the frontend IP configuration that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1864,8 +2054,8 @@ export interface ApplicationGatewayFrontendIPConfiguration extends SubResource { * @member {number} [port] Frontend port * @member {string} [provisioningState] Provisioning state of the frontend port * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the frontend port that is unique within an + * Application Gateway * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1890,8 +2080,8 @@ export interface ApplicationGatewayFrontendPort extends SubResource { * @member {object} [frontendPort] Frontend port resource of an application * gateway. * @member {string} [frontendPort.id] Resource ID. - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {string} [protocol] Protocol of the HTTP listener. Possible values + * are 'Http' and 'Https'. Possible values include: 'Http', 'Https' * @member {string} [hostName] Host name of HTTP listener. * @member {object} [sslCertificate] SSL certificate resource of an application * gateway. @@ -1900,8 +2090,8 @@ export interface ApplicationGatewayFrontendPort extends SubResource { * is https. Enables SNI for multi-hosting. * @member {string} [provisioningState] Provisioning state of the HTTP listener * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the HTTP listener that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1937,8 +2127,8 @@ export interface ApplicationGatewayHttpListener extends SubResource { * @member {string} [redirectConfiguration.id] Resource ID. * @member {string} [provisioningState] Path rule of URL path map resource. * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the path rule that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -1976,8 +2166,8 @@ export interface ApplicationGatewayProbeHealthResponseMatch { * @constructor * Probe of the application gateway. * - * @member {string} [protocol] Protocol. Possible values include: 'Http', - * 'Https' + * @member {string} [protocol] The protocol used for the probe. Possible values + * are 'Http' and 'Https'. Possible values include: 'Http', 'Https' * @member {string} [host] Host name to send the probe to. * @member {string} [path] Relative path of probe. Valid path starts from '/'. * Probe is sent to ://: @@ -2003,8 +2193,8 @@ export interface ApplicationGatewayProbeHealthResponseMatch { * @member {string} [provisioningState] Provisioning state of the backend http * settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the probe that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -2036,7 +2226,7 @@ export interface ApplicationGatewayProbe extends SubResource { * @member {object} [backendAddressPool] Backend address pool resource of the * application gateway. * @member {string} [backendAddressPool.id] Resource ID. - * @member {object} [backendHttpSettings] Frontend port resource of the + * @member {object} [backendHttpSettings] Backend http settings resource of the * application gateway. * @member {string} [backendHttpSettings.id] Resource ID. * @member {object} [httpListener] Http listener resource of the application @@ -2051,8 +2241,8 @@ export interface ApplicationGatewayProbe extends SubResource { * @member {string} [provisioningState] Provisioning state of the request * routing rule resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the request routing rule that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -2091,8 +2281,8 @@ export interface ApplicationGatewayRequestRoutingRule extends SubResource { * @member {array} [urlPathMaps] Url path maps specifying default redirect * configuration. * @member {array} [pathRules] Path rules specifying redirect configuration. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the redirect configuration that is unique + * within an Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -2131,8 +2321,8 @@ export interface ApplicationGatewayRedirectConfiguration extends SubResource { * @member {string} [provisioningState] Provisioning state of the backend http * settings resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. - * @member {string} [name] Name of the resource that is unique within a - * resource group. This name can be used to access the resource. + * @member {string} [name] Name of the URL path map that is unique within an + * Application Gateway. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. * @member {string} [type] Type of the resource. @@ -2192,6 +2382,37 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration { maxRequestBodySize?: number; } +/** + * @class + * Initializes a new instance of the ApplicationGatewayAutoscaleBounds class. + * @constructor + * Application Gateway autoscale bounds on number of Application Gateway + * instance. + * + * @member {number} min Lower bound on number of Application Gateway instances. + * @member {number} max Upper bound on number of Application Gateway instances. + */ +export interface ApplicationGatewayAutoscaleBounds { + min: number; + max: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationGatewayAutoscaleConfiguration class. + * @constructor + * Application Gateway autoscale configuration. + * + * @member {object} bounds Autoscale bounds + * @member {number} [bounds.min] Lower bound on number of Application Gateway + * instances. + * @member {number} [bounds.max] Upper bound on number of Application Gateway + * instances. + */ +export interface ApplicationGatewayAutoscaleConfiguration { + bounds: ApplicationGatewayAutoscaleBounds; +} + /** * @class * Initializes a new instance of the ApplicationGateway class. @@ -2201,9 +2422,9 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration { * @member {object} [sku] SKU of the application gateway resource. * @member {string} [sku.name] Name of an application gateway SKU. Possible * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large' + * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * @member {string} [sku.tier] Tier of an application gateway. Possible values - * include: 'Standard', 'WAF' + * include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * @member {number} [sku.capacity] Capacity (instance count) of an application * gateway. * @member {object} [sslPolicy] SSL policy of the application gateway resource. @@ -2264,12 +2485,22 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration { * Maxium request body size for WAF. * @member {boolean} [enableHttp2] Whether HTTP2 is enabled on the application * gateway resource. + * @member {boolean} [enableFips] Whether FIPS is enabled on the application + * gateway resource. + * @member {object} [autoscaleConfiguration] Autoscale Configuration. + * @member {object} [autoscaleConfiguration.bounds] Autoscale bounds + * @member {number} [autoscaleConfiguration.bounds.min] Lower bound on number + * of Application Gateway instances. + * @member {number} [autoscaleConfiguration.bounds.max] Upper bound on number + * of Application Gateway instances. * @member {string} [resourceGuid] Resource GUID property of the application * gateway resource. * @member {string} [provisioningState] Provisioning state of the application * gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. + * @member {array} [zones] A list of availability zones denoting where the + * resource needs to come from. */ export interface ApplicationGateway extends Resource { sku?: ApplicationGatewaySku; @@ -2289,9 +2520,12 @@ export interface ApplicationGateway extends Resource { redirectConfigurations?: ApplicationGatewayRedirectConfiguration[]; webApplicationFirewallConfiguration?: ApplicationGatewayWebApplicationFirewallConfiguration; enableHttp2?: boolean; + enableFips?: boolean; + autoscaleConfiguration?: ApplicationGatewayAutoscaleConfiguration; resourceGuid?: string; provisioningState?: string; etag?: string; + zones?: string[]; } /** @@ -2389,7 +2623,7 @@ export interface ApplicationGatewayAvailableSslOptions extends Resource { * @constructor * An Ssl predefined policy * - * @member {string} [name] Name of Ssl predefined policy. + * @member {string} [name] Name of the Ssl predefined policy. * @member {array} [cipherSuites] Ssl cipher suites to be enabled in the * specified order for application gateway. * @member {string} [minProtocolVersion] Minimum version of Ssl protocol to be @@ -2432,6 +2666,11 @@ export interface DnsNameAvailabilityResult { * @constructor * A DDoS protection plan in a resource group. * + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. * @member {string} [resourceGuid] The resource GUID property of the DDoS * protection plan resource. It uniquely identifies the resource, even if the * user changes its name or migrate the resource across subscriptions or @@ -2444,7 +2683,12 @@ export interface DnsNameAvailabilityResult { * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. */ -export interface DdosProtectionPlan extends Resource { +export interface DdosProtectionPlan extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; readonly resourceGuid?: string; readonly provisioningState?: string; readonly virtualNetworks?: SubResource[]; @@ -2890,8 +3134,8 @@ export interface ExpressRouteCircuit extends Resource { * @constructor * The ARP table associated with the ExpressRouteCircuit. * - * @member {number} [age] Age - * @member {string} [interfaceProperty] Interface + * @member {number} [age] Entry age in minutes + * @member {string} [interfaceProperty] Interface address * @member {string} [ipAddress] The IP address. * @member {string} [macAddress] The MAC address. */ @@ -2922,11 +3166,12 @@ export interface ExpressRouteCircuitsArpTableListResult { * @constructor * The routes table associated with the ExpressRouteCircuit * - * @member {string} [network] network - * @member {string} [nextHop] nextHop - * @member {string} [locPrf] locPrf - * @member {number} [weight] weight. - * @member {string} [path] path + * @member {string} [network] IP address of a network entity + * @member {string} [nextHop] NextHop address + * @member {string} [locPrf] Local preference value as set with the set + * local-preference route-map configuration command + * @member {number} [weight] Route Weight. + * @member {string} [path] Autonomous system paths to the destination network. */ export interface ExpressRouteCircuitRoutesTable { network?: string; @@ -2956,7 +3201,7 @@ export interface ExpressRouteCircuitsRoutesTableListResult { * @constructor * The routes table associated with the ExpressRouteCircuit. * - * @member {string} [neighbor] Neighbor + * @member {string} [neighbor] IP address of the neighbor. * @member {number} [v] BGP version number spoken to the neighbor. * @member {number} [as] Autonomous system number. * @member {string} [upDown] The length of time that the BGP session has been @@ -3164,7 +3409,7 @@ export interface ExpressRouteCrossConnectionPeering extends SubResource { vlanId?: number; microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; readonly provisioningState?: string; - readonly gatewayManagerEtag?: string; + gatewayManagerEtag?: string; lastModifiedBy?: string; ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; name?: string; @@ -3203,9 +3448,9 @@ export interface ExpressRouteCrossConnection extends Resource { readonly primaryAzurePort?: string; readonly secondaryAzurePort?: string; readonly sTag?: number; - readonly peeringLocation?: string; - readonly bandwidthInMbps?: number; - readonly expressRouteCircuit?: ExpressRouteCircuitReference; + peeringLocation?: string; + bandwidthInMbps?: number; + expressRouteCircuit?: ExpressRouteCircuitReference; serviceProviderProvisioningState?: string; serviceProviderNotes?: string; readonly provisioningState?: string; @@ -3502,10 +3747,10 @@ export interface LoadBalancingRule extends SubResource { * @member {array} [loadBalancingRules] The load balancer rules that use this * probe. * @member {string} protocol The protocol of the end point. Possible values - * are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for - * the probe to be successful. If 'Http' is specified, a 200 OK response from - * the specifies URI is required for the probe to be successful. Possible - * values include: 'Http', 'Tcp' + * are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is + * required for the probe to be successful. If 'Http' or 'Https' is specified, + * a 200 OK response from the specifies URI is required for the probe to be + * successful. Possible values include: 'Http', 'Tcp', 'Https' * @member {number} port The port for communicating the probe. Possible values * range from 1 to 65535, inclusive. * @member {number} [intervalInSeconds] The interval, in seconds, for how @@ -4502,23 +4747,64 @@ export interface RetentionPolicyParameters { * @class * Initializes a new instance of the FlowLogStatusParameters class. * @constructor - * Parameters that define a resource to query flow log status. + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. * * @member {string} targetResourceId The target resource where getting the flow - * logging status. + * log and traffic analytics (optional) status. */ export interface FlowLogStatusParameters { targetResourceId: string; } +/** + * @class + * Initializes a new instance of the TrafficAnalyticsConfigurationProperties class. + * @constructor + * Parameters that define the configuration of traffic analytics. + * + * @member {boolean} enabled Flag to enable/disable traffic analytics. + * @member {string} workspaceId The resource guid of the attached workspace + * @member {string} workspaceRegion The location of the attached workspace + * @member {string} workspaceResourceId Resource Id of the attached workspace + */ +export interface TrafficAnalyticsConfigurationProperties { + enabled: boolean; + workspaceId: string; + workspaceRegion: string; + workspaceResourceId: string; +} + +/** + * @class + * Initializes a new instance of the TrafficAnalyticsProperties class. + * @constructor + * Parameters that define the configuration of traffic analytics. + * + * @member {object} networkWatcherFlowAnalyticsConfiguration + * @member {boolean} [networkWatcherFlowAnalyticsConfiguration.enabled] Flag to + * enable/disable traffic analytics. + * @member {string} [networkWatcherFlowAnalyticsConfiguration.workspaceId] The + * resource guid of the attached workspace + * @member {string} [networkWatcherFlowAnalyticsConfiguration.workspaceRegion] + * The location of the attached workspace + * @member {string} + * [networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] Resource Id + * of the attached workspace + */ +export interface TrafficAnalyticsProperties { + networkWatcherFlowAnalyticsConfiguration: TrafficAnalyticsConfigurationProperties; +} + /** * @class * Initializes a new instance of the FlowLogInformation class. * @constructor - * Information on the configuration of flow log. + * Information on the configuration of flow log and traffic analytics + * (optional) . * * @member {string} targetResourceId The ID of the resource to configure for - * flow logging. + * flow log and traffic analytics (optional) . * @member {string} storageId ID of the storage account which is used to store * the flow log. * @member {boolean} enabled Flag to enable/disable flow logging. @@ -4527,12 +4813,28 @@ export interface FlowLogStatusParameters { * records. * @member {boolean} [retentionPolicy.enabled] Flag to enable/disable * retention. + * @member {object} [flowAnalyticsConfiguration] + * @member {object} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration] + * @member {boolean} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled] + * Flag to enable/disable traffic analytics. + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId] + * The resource guid of the attached workspace + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion] + * The location of the attached workspace + * @member {string} + * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] + * Resource Id of the attached workspace */ export interface FlowLogInformation { targetResourceId: string; storageId: string; enabled: boolean; retentionPolicy?: RetentionPolicyParameters; + flowAnalyticsConfiguration?: TrafficAnalyticsProperties; } /** @@ -5567,10 +5869,12 @@ export interface VirtualNetworkGatewayIPConfiguration extends SubResource { * * @member {string} [name] Gateway SKU name. Possible values include: 'Basic', * 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', - * 'VpnGw3' + * 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', + * 'ErGw3AZ' * @member {string} [tier] Gateway SKU tier. Possible values include: 'Basic', * 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', - * 'VpnGw3' + * 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', + * 'ErGw3AZ' * @member {number} [capacity] The capacity. */ export interface VirtualNetworkGatewaySku { @@ -5794,10 +6098,12 @@ export interface GatewayRoute { * resource which represents the SKU selected for Virtual network gateway. * @member {string} [sku.name] Gateway SKU name. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {string} [sku.tier] Gateway SKU tier. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {number} [sku.capacity] The capacity. * @member {object} [vpnClientConfiguration] The reference of the * VpnClientConfiguration resource which represents the P2S VpnClient @@ -5992,10 +6298,12 @@ export interface LocalNetworkGateway extends Resource { * Virtual network gateway. * @member {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {number} [virtualNetworkGateway1.sku.capacity] The capacity. * @member {object} [virtualNetworkGateway1.vpnClientConfiguration] The * reference of the VpnClientConfiguration resource which represents the P2S @@ -6065,10 +6373,12 @@ export interface LocalNetworkGateway extends Resource { * Virtual network gateway. * @member {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {number} [virtualNetworkGateway2.sku.capacity] The capacity. * @member {object} [virtualNetworkGateway2.vpnClientConfiguration] The * reference of the VpnClientConfiguration resource which represents the P2S @@ -6211,7 +6521,7 @@ export interface ConnectionResetSharedKey { * * @member {string} value The virtual network connection shared key value. */ -export interface ConnectionSharedKey { +export interface ConnectionSharedKey extends SubResource { value: string; } @@ -6354,6 +6664,264 @@ export interface VpnDeviceScriptParameters { firmwareVersion?: string; } +/** + * @class + * Initializes a new instance of the VirtualWAN class. + * @constructor + * VirtualWAN Resource. + * + * @member {boolean} [disableVpnEncryption] Vpn encryption to be disabled or + * not. + * @member {array} [virtualHubs] List of VirtualHubs in the VirtualWAN. + * @member {array} [vpnSites] + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualWAN extends Resource { + disableVpnEncryption?: boolean; + readonly virtualHubs?: SubResource[]; + readonly vpnSites?: SubResource[]; + provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the DeviceProperties class. + * @constructor + * List of properties of the device. + * + * @member {string} [deviceVendor] Name of the device Vendor. + * @member {string} [deviceModel] Model of the device. + * @member {number} [linkSpeedInMbps] Link speed. + */ +export interface DeviceProperties { + deviceVendor?: string; + deviceModel?: string; + linkSpeedInMbps?: number; +} + +/** + * @class + * Initializes a new instance of the VpnSite class. + * @constructor + * VpnSite Resource. + * + * @member {object} [virtualWAN] The VirtualWAN to which the vpnSite belongs + * @member {string} [virtualWAN.id] Resource ID. + * @member {object} [deviceProperties] The device properties + * @member {string} [deviceProperties.deviceVendor] Name of the device Vendor. + * @member {string} [deviceProperties.deviceModel] Model of the device. + * @member {number} [deviceProperties.linkSpeedInMbps] Link speed. + * @member {string} [ipAddress] The ip-address for the vpn-site. + * @member {string} [siteKey] The key for vpn-site that can be used for + * connections. + * @member {object} [addressSpace] The AddressSpace that contains an array of + * IP address ranges. + * @member {array} [addressSpace.addressPrefixes] A list of address blocks + * reserved for this virtual network in CIDR notation. + * @member {object} [bgpProperties] The set of bgp properties. + * @member {number} [bgpProperties.asn] The BGP speaker's ASN. + * @member {string} [bgpProperties.bgpPeeringAddress] The BGP peering address + * and BGP identifier of this BGP speaker. + * @member {number} [bgpProperties.peerWeight] The weight added to routes + * learned from this BGP speaker. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VpnSite extends Resource { + virtualWAN?: SubResource; + deviceProperties?: DeviceProperties; + ipAddress?: string; + siteKey?: string; + addressSpace?: AddressSpace; + bgpProperties?: BgpSettings; + provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the GetVpnSitesConfigurationRequest class. + * @constructor + * List of Vpn-Sites + * + * @member {array} [vpnSites] List of resource-ids of the vpn-sites for which + * config is to be downloaded. + * @member {string} [outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + */ +export interface GetVpnSitesConfigurationRequest { + vpnSites?: SubResource[]; + outputBlobSasUrl?: string; +} + +/** + * @class + * Initializes a new instance of the HubVirtualNetworkConnection class. + * @constructor + * HubVirtualNetworkConnection Resource. + * + * @member {object} [remoteVirtualNetwork] Reference to the remote virtual + * network. + * @member {string} [remoteVirtualNetwork.id] Resource ID. + * @member {boolean} [allowHubToRemoteVnetTransit] VirtualHub to RemoteVnet + * transit to enabled or not. + * @member {boolean} [allowRemoteVnetToUseHubVnetGateways] Allow RemoteVnet to + * use Virtual Hub's gateways. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface HubVirtualNetworkConnection extends Resource { + remoteVirtualNetwork?: SubResource; + allowHubToRemoteVnetTransit?: boolean; + allowRemoteVnetToUseHubVnetGateways?: boolean; + provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualHub class. + * @constructor + * VirtualHub Resource. + * + * @member {object} [virtualWan] The VirtualWAN to which the VirtualHub belongs + * @member {string} [virtualWan.id] Resource ID. + * @member {array} [hubVirtualNetworkConnections] list of all vnet connections + * with this VirtualHub. + * @member {string} [addressPrefix] Address-prefix for this VirtualHub. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VirtualHub extends Resource { + virtualWan?: SubResource; + hubVirtualNetworkConnections?: HubVirtualNetworkConnection[]; + addressPrefix?: string; + provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the VpnConnection class. + * @constructor + * VpnConnection Resource. + * + * @member {object} [remoteVpnSite] Id of the connected vpn site. + * @member {string} [remoteVpnSite.id] Resource ID. + * @member {number} [routingWeight] routing weight for vpn connection. + * @member {string} [connectionStatus] The connection status. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @member {number} [ingressBytesTransferred] Ingress bytes transferred. + * @member {number} [egressBytesTransferred] Egress bytes transferred. + * @member {number} [connectionBandwidthInMbps] Expected bandwidth in MBPS. + * @member {string} [sharedKey] SharedKey for the vpn connection. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by this + * connection. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VpnConnection extends Resource { + remoteVpnSite?: SubResource; + routingWeight?: number; + connectionStatus?: string; + readonly ingressBytesTransferred?: number; + readonly egressBytesTransferred?: number; + readonly connectionBandwidthInMbps?: number; + sharedKey?: string; + enableBgp?: boolean; + ipsecPolicies?: IpsecPolicy[]; + provisioningState?: string; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the Policies class. + * @constructor + * Policies for vpn gateway. + * + * @member {boolean} [allowBranchToBranchTraffic] True if branch to branch + * traffic is allowed. + * @member {boolean} [allowVnetToVnetTraffic] True if Vnet to Vnet traffic is + * allowed. + */ +export interface Policies { + allowBranchToBranchTraffic?: boolean; + allowVnetToVnetTraffic?: boolean; +} + +/** + * @class + * Initializes a new instance of the VpnGateway class. + * @constructor + * VpnGateway Resource. + * + * @member {object} [virtualHub] The VirtualHub to which the gateway belongs + * @member {string} [virtualHub.id] Resource ID. + * @member {array} [connections] list of all vpn connections to the gateway. + * @member {object} [bgpSettings] Local network gateway's BGP speaker settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address and + * BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes learned + * from this BGP speaker. + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @member {object} [policies] The policies applied to this vpn gateway. + * @member {boolean} [policies.allowBranchToBranchTraffic] True if branch to + * branch traffic is allowed. + * @member {boolean} [policies.allowVnetToVnetTraffic] True if Vnet to Vnet + * traffic is allowed. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface VpnGateway extends Resource { + virtualHub?: SubResource; + connections?: VpnConnection[]; + bgpSettings?: BgpSettings; + provisioningState?: string; + policies?: Policies; + readonly etag?: string; +} + +/** + * @class + * Initializes a new instance of the VpnSiteId class. + * @constructor + * VpnSite Resource. + * + * @member {string} [vpnSite] The resource-uri of the vpn-site for which config + * is to be fetched. + */ +export interface VpnSiteId { + readonly vpnSite?: string; +} + + +/** + * @class + * Initializes a new instance of the AzureFirewallListResult class. + * @constructor + * Response for ListAzureFirewalls API service call. + * + * @member {string} [nextLink] URL to get the next set of results. + */ +export interface AzureFirewallListResult extends Array { + nextLink?: string; +} /** * @class @@ -6848,3 +7416,88 @@ export interface VirtualNetworkGatewayConnectionListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the ListVirtualWANsResult class. + * @constructor + * Result of the request to list VirtualWANs. It contains a list of VirtualWANs + * and a URL nextLink to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListVirtualWANsResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ListVpnSitesResult class. + * @constructor + * Result of the request to list VpnSites. It contains a list of VpnSites and a + * URL nextLink to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListVpnSitesResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ListVirtualHubsResult class. + * @constructor + * Result of the request to list VirtualHubs. It contains a list of VirtualHubs + * and a URL nextLink to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListVirtualHubsResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ListHubVirtualNetworkConnectionsResult class. + * @constructor + * List of HubVirtualNetworkConnections and a URL nextLink to get the next set + * of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListHubVirtualNetworkConnectionsResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ListVpnGatewaysResult class. + * @constructor + * Result of the request to list VpnGateways. It contains a list of VpnGateways + * and a URL nextLink to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListVpnGatewaysResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ListVpnConnectionsResult class. + * @constructor + * Result of the request to list all vpn connections to a virtual wan vpn + * gateway. It contains a list of Vpn Connections and a URL nextLink to get the + * next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface ListVpnConnectionsResult extends Array { + nextLink?: string; +} diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index 4f242870be..bd50b1261c 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -19,9 +19,17 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.SubResource = require('./subResource'); +exports.AzureFirewallIPConfiguration = require('./azureFirewallIPConfiguration'); +exports.AzureFirewallRCAction = require('./azureFirewallRCAction'); +exports.AzureFirewallApplicationRuleProtocol = require('./azureFirewallApplicationRuleProtocol'); +exports.AzureFirewallApplicationRule = require('./azureFirewallApplicationRule'); +exports.AzureFirewallApplicationRuleCollection = require('./azureFirewallApplicationRuleCollection'); +exports.AzureFirewallNetworkRule = require('./azureFirewallNetworkRule'); +exports.AzureFirewallNetworkRuleCollection = require('./azureFirewallNetworkRuleCollection'); +exports.Resource = require('./resource'); +exports.AzureFirewall = require('./azureFirewall'); exports.BackendAddressPool = require('./backendAddressPool'); exports.InboundNatRule = require('./inboundNatRule'); -exports.Resource = require('./resource'); exports.ApplicationSecurityGroup = require('./applicationSecurityGroup'); exports.SecurityRule = require('./securityRule'); exports.NetworkInterfaceDnsSettings = require('./networkInterfaceDnsSettings'); @@ -62,6 +70,8 @@ exports.ApplicationGatewayRedirectConfiguration = require('./applicationGatewayR exports.ApplicationGatewayUrlPathMap = require('./applicationGatewayUrlPathMap'); exports.ApplicationGatewayFirewallDisabledRuleGroup = require('./applicationGatewayFirewallDisabledRuleGroup'); exports.ApplicationGatewayWebApplicationFirewallConfiguration = require('./applicationGatewayWebApplicationFirewallConfiguration'); +exports.ApplicationGatewayAutoscaleBounds = require('./applicationGatewayAutoscaleBounds'); +exports.ApplicationGatewayAutoscaleConfiguration = require('./applicationGatewayAutoscaleConfiguration'); exports.ApplicationGateway = require('./applicationGateway'); exports.ApplicationGatewayFirewallRule = require('./applicationGatewayFirewallRule'); exports.ApplicationGatewayFirewallRuleGroup = require('./applicationGatewayFirewallRuleGroup'); @@ -141,6 +151,8 @@ exports.TroubleshootingDetails = require('./troubleshootingDetails'); exports.TroubleshootingResult = require('./troubleshootingResult'); exports.RetentionPolicyParameters = require('./retentionPolicyParameters'); exports.FlowLogStatusParameters = require('./flowLogStatusParameters'); +exports.TrafficAnalyticsConfigurationProperties = require('./trafficAnalyticsConfigurationProperties'); +exports.TrafficAnalyticsProperties = require('./trafficAnalyticsProperties'); exports.FlowLogInformation = require('./flowLogInformation'); exports.ConnectivitySource = require('./connectivitySource'); exports.ConnectivityDestination = require('./connectivityDestination'); @@ -210,6 +222,17 @@ exports.VpnClientIPsecParameters = require('./vpnClientIPsecParameters'); exports.VirtualNetworkConnectionGatewayReference = require('./virtualNetworkConnectionGatewayReference'); exports.VirtualNetworkGatewayConnectionListEntity = require('./virtualNetworkGatewayConnectionListEntity'); exports.VpnDeviceScriptParameters = require('./vpnDeviceScriptParameters'); +exports.VirtualWAN = require('./virtualWAN'); +exports.DeviceProperties = require('./deviceProperties'); +exports.VpnSite = require('./vpnSite'); +exports.GetVpnSitesConfigurationRequest = require('./getVpnSitesConfigurationRequest'); +exports.HubVirtualNetworkConnection = require('./hubVirtualNetworkConnection'); +exports.VirtualHub = require('./virtualHub'); +exports.VpnConnection = require('./vpnConnection'); +exports.Policies = require('./policies'); +exports.VpnGateway = require('./vpnGateway'); +exports.VpnSiteId = require('./vpnSiteId'); +exports.AzureFirewallListResult = require('./azureFirewallListResult'); exports.ApplicationGatewayListResult = require('./applicationGatewayListResult'); exports.ApplicationGatewayAvailableSslPredefinedPolicies = require('./applicationGatewayAvailableSslPredefinedPolicies'); exports.ApplicationSecurityGroupListResult = require('./applicationSecurityGroupListResult'); @@ -251,3 +274,9 @@ exports.VirtualNetworkGatewayListResult = require('./virtualNetworkGatewayListRe exports.VirtualNetworkGatewayListConnectionsResult = require('./virtualNetworkGatewayListConnectionsResult'); exports.VirtualNetworkGatewayConnectionListResult = require('./virtualNetworkGatewayConnectionListResult'); exports.LocalNetworkGatewayListResult = require('./localNetworkGatewayListResult'); +exports.ListVirtualWANsResult = require('./listVirtualWANsResult'); +exports.ListVpnSitesResult = require('./listVpnSitesResult'); +exports.ListVirtualHubsResult = require('./listVirtualHubsResult'); +exports.ListHubVirtualNetworkConnectionsResult = require('./listHubVirtualNetworkConnectionsResult'); +exports.ListVpnGatewaysResult = require('./listVpnGatewaysResult'); +exports.ListVpnConnectionsResult = require('./listVpnConnectionsResult'); diff --git a/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js b/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js new file mode 100644 index 0000000000..8c7741dbc1 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * List of HubVirtualNetworkConnections and a URL nextLink to get the next set + * of results. + */ +class ListHubVirtualNetworkConnectionsResult extends Array { + /** + * Create a ListHubVirtualNetworkConnectionsResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListHubVirtualNetworkConnectionsResult + * + * @returns {object} metadata of ListHubVirtualNetworkConnectionsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListHubVirtualNetworkConnectionsResult', + type: { + name: 'Composite', + className: 'ListHubVirtualNetworkConnectionsResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HubVirtualNetworkConnectionElementType', + type: { + name: 'Composite', + className: 'HubVirtualNetworkConnection' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListHubVirtualNetworkConnectionsResult; diff --git a/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js b/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js new file mode 100644 index 0000000000..60052e6e7d --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of the request to list VirtualHubs. It contains a list of VirtualHubs + * and a URL nextLink to get the next set of results. + */ +class ListVirtualHubsResult extends Array { + /** + * Create a ListVirtualHubsResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListVirtualHubsResult + * + * @returns {object} metadata of ListVirtualHubsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListVirtualHubsResult', + type: { + name: 'Composite', + className: 'ListVirtualHubsResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualHubElementType', + type: { + name: 'Composite', + className: 'VirtualHub' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListVirtualHubsResult; diff --git a/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js b/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js new file mode 100644 index 0000000000..2f58389096 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of the request to list VirtualWANs. It contains a list of VirtualWANs + * and a URL nextLink to get the next set of results. + */ +class ListVirtualWANsResult extends Array { + /** + * Create a ListVirtualWANsResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListVirtualWANsResult + * + * @returns {object} metadata of ListVirtualWANsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListVirtualWANsResult', + type: { + name: 'Composite', + className: 'ListVirtualWANsResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualWANElementType', + type: { + name: 'Composite', + className: 'VirtualWAN' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListVirtualWANsResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js b/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js new file mode 100644 index 0000000000..91652c5497 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn + * gateway. It contains a list of Vpn Connections and a URL nextLink to get the + * next set of results. + */ +class ListVpnConnectionsResult extends Array { + /** + * Create a ListVpnConnectionsResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListVpnConnectionsResult + * + * @returns {object} metadata of ListVpnConnectionsResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListVpnConnectionsResult', + type: { + name: 'Composite', + className: 'ListVpnConnectionsResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnConnectionElementType', + type: { + name: 'Composite', + className: 'VpnConnection' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListVpnConnectionsResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js b/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js new file mode 100644 index 0000000000..b840abe313 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of the request to list VpnGateways. It contains a list of VpnGateways + * and a URL nextLink to get the next set of results. + */ +class ListVpnGatewaysResult extends Array { + /** + * Create a ListVpnGatewaysResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListVpnGatewaysResult + * + * @returns {object} metadata of ListVpnGatewaysResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListVpnGatewaysResult', + type: { + name: 'Composite', + className: 'ListVpnGatewaysResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnGatewayElementType', + type: { + name: 'Composite', + className: 'VpnGateway' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListVpnGatewaysResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnSitesResult.js b/lib/services/networkManagement2/lib/models/listVpnSitesResult.js new file mode 100644 index 0000000000..b704f0b2e5 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/listVpnSitesResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of the request to list VpnSites. It contains a list of VpnSites and a + * URL nextLink to get the next set of results. + */ +class ListVpnSitesResult extends Array { + /** + * Create a ListVpnSitesResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListVpnSitesResult + * + * @returns {object} metadata of ListVpnSitesResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListVpnSitesResult', + type: { + name: 'Composite', + className: 'ListVpnSitesResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnSiteElementType', + type: { + name: 'Composite', + className: 'VpnSite' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListVpnSitesResult; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js b/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js index e504224120..21b2693d17 100644 --- a/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js +++ b/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js @@ -88,7 +88,7 @@ class PacketCaptureQueryStatusResult { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'PcErrorElementType', type: { name: 'String' } diff --git a/lib/services/networkManagement2/lib/models/policies.js b/lib/services/networkManagement2/lib/models/policies.js new file mode 100644 index 0000000000..4e6e439be3 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/policies.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Policies for vpn gateway. + * + */ +class Policies { + /** + * Create a Policies. + * @member {boolean} [allowBranchToBranchTraffic] True if branch to branch + * traffic is allowed. + * @member {boolean} [allowVnetToVnetTraffic] True if Vnet to Vnet traffic is + * allowed. + */ + constructor() { + } + + /** + * Defines the metadata of Policies + * + * @returns {object} metadata of Policies + * + */ + mapper() { + return { + required: false, + serializedName: 'Policies', + type: { + name: 'Composite', + className: 'Policies', + modelProperties: { + allowBranchToBranchTraffic: { + required: false, + serializedName: 'allowBranchToBranchTraffic', + type: { + name: 'Boolean' + } + }, + allowVnetToVnetTraffic: { + required: false, + serializedName: 'allowVnetToVnetTraffic', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = Policies; diff --git a/lib/services/networkManagement2/lib/models/probe.js b/lib/services/networkManagement2/lib/models/probe.js index 667f984b64..48081c251c 100644 --- a/lib/services/networkManagement2/lib/models/probe.js +++ b/lib/services/networkManagement2/lib/models/probe.js @@ -23,10 +23,10 @@ class Probe extends models['SubResource'] { * @member {array} [loadBalancingRules] The load balancer rules that use this * probe. * @member {string} protocol The protocol of the end point. Possible values - * are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required - * for the probe to be successful. If 'Http' is specified, a 200 OK response - * from the specifies URI is required for the probe to be successful. - * Possible values include: 'Http', 'Tcp' + * are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is + * required for the probe to be successful. If 'Http' or 'Https' is + * specified, a 200 OK response from the specifies URI is required for the + * probe to be successful. Possible values include: 'Http', 'Tcp', 'Https' * @member {number} port The port for communicating the probe. Possible * values range from 1 to 65535, inclusive. * @member {number} [intervalInSeconds] The interval, in seconds, for how diff --git a/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js b/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js new file mode 100644 index 0000000000..58b762cb24 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * Parameters that define the configuration of traffic analytics. + * + */ +class TrafficAnalyticsConfigurationProperties { + /** + * Create a TrafficAnalyticsConfigurationProperties. + * @member {boolean} enabled Flag to enable/disable traffic analytics. + * @member {string} workspaceId The resource guid of the attached workspace + * @member {string} workspaceRegion The location of the attached workspace + * @member {string} workspaceResourceId Resource Id of the attached workspace + */ + constructor() { + } + + /** + * Defines the metadata of TrafficAnalyticsConfigurationProperties + * + * @returns {object} metadata of TrafficAnalyticsConfigurationProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TrafficAnalyticsConfigurationProperties', + type: { + name: 'Composite', + className: 'TrafficAnalyticsConfigurationProperties', + modelProperties: { + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + workspaceId: { + required: true, + serializedName: 'workspaceId', + type: { + name: 'String' + } + }, + workspaceRegion: { + required: true, + serializedName: 'workspaceRegion', + type: { + name: 'String' + } + }, + workspaceResourceId: { + required: true, + serializedName: 'workspaceResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TrafficAnalyticsConfigurationProperties; diff --git a/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js b/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js new file mode 100644 index 0000000000..2ce9c0f663 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters that define the configuration of traffic analytics. + * + */ +class TrafficAnalyticsProperties { + /** + * Create a TrafficAnalyticsProperties. + * @member {object} networkWatcherFlowAnalyticsConfiguration + * @member {boolean} [networkWatcherFlowAnalyticsConfiguration.enabled] Flag + * to enable/disable traffic analytics. + * @member {string} [networkWatcherFlowAnalyticsConfiguration.workspaceId] + * The resource guid of the attached workspace + * @member {string} + * [networkWatcherFlowAnalyticsConfiguration.workspaceRegion] The location of + * the attached workspace + * @member {string} + * [networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] Resource Id + * of the attached workspace + */ + constructor() { + } + + /** + * Defines the metadata of TrafficAnalyticsProperties + * + * @returns {object} metadata of TrafficAnalyticsProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TrafficAnalyticsProperties', + type: { + name: 'Composite', + className: 'TrafficAnalyticsProperties', + modelProperties: { + networkWatcherFlowAnalyticsConfiguration: { + required: true, + serializedName: 'networkWatcherFlowAnalyticsConfiguration', + type: { + name: 'Composite', + className: 'TrafficAnalyticsConfigurationProperties' + } + } + } + } + }; + } +} + +module.exports = TrafficAnalyticsProperties; diff --git a/lib/services/networkManagement2/lib/models/virtualHub.js b/lib/services/networkManagement2/lib/models/virtualHub.js new file mode 100644 index 0000000000..57bb504dfe --- /dev/null +++ b/lib/services/networkManagement2/lib/models/virtualHub.js @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VirtualHub Resource. + * + * @extends models['Resource'] + */ +class VirtualHub extends models['Resource'] { + /** + * Create a VirtualHub. + * @member {object} [virtualWan] The VirtualWAN to which the VirtualHub + * belongs + * @member {string} [virtualWan.id] Resource ID. + * @member {array} [hubVirtualNetworkConnections] list of all vnet + * connections with this VirtualHub. + * @member {string} [addressPrefix] Address-prefix for this VirtualHub. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualHub + * + * @returns {object} metadata of VirtualHub + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualHub', + type: { + name: 'Composite', + className: 'VirtualHub', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtualWan: { + required: false, + serializedName: 'properties.virtualWan', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + hubVirtualNetworkConnections: { + required: false, + serializedName: 'properties.hubVirtualNetworkConnections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HubVirtualNetworkConnectionElementType', + type: { + name: 'Composite', + className: 'HubVirtualNetworkConnection' + } + } + } + }, + addressPrefix: { + required: false, + serializedName: 'properties.addressPrefix', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualHub; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js b/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js index a8853085dc..1447f48628 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js +++ b/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js @@ -40,10 +40,12 @@ class VirtualNetworkGateway extends models['Resource'] { * resource which represents the SKU selected for Virtual network gateway. * @member {string} [sku.name] Gateway SKU name. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {string} [sku.tier] Gateway SKU tier. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {number} [sku.capacity] The capacity. * @member {object} [vpnClientConfiguration] The reference of the * VpnClientConfiguration resource which represents the P2S VpnClient diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js index b6dc8791ef..ec5d8f580a 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js +++ b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js @@ -45,10 +45,12 @@ class VirtualNetworkGatewayConnection extends models['Resource'] { * Virtual network gateway. * @member {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {number} [virtualNetworkGateway1.sku.capacity] The capacity. * @member {object} [virtualNetworkGateway1.vpnClientConfiguration] The * reference of the VpnClientConfiguration resource which represents the P2S @@ -120,10 +122,12 @@ class VirtualNetworkGatewayConnection extends models['Resource'] { * Virtual network gateway. * @member {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * @member {number} [virtualNetworkGateway2.sku.capacity] The capacity. * @member {object} [virtualNetworkGateway2.vpnClientConfiguration] The * reference of the VpnClientConfiguration resource which represents the P2S diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js index cea2349ade..27313b7a45 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js +++ b/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js @@ -19,10 +19,12 @@ class VirtualNetworkGatewaySku { * Create a VirtualNetworkGatewaySku. * @member {string} [name] Gateway SKU name. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {string} [tier] Gateway SKU tier. Possible values include: * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3' + * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * @member {number} [capacity] The capacity. */ constructor() { diff --git a/lib/services/networkManagement2/lib/models/virtualWAN.js b/lib/services/networkManagement2/lib/models/virtualWAN.js new file mode 100644 index 0000000000..7e36a55266 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/virtualWAN.js @@ -0,0 +1,155 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VirtualWAN Resource. + * + * @extends models['Resource'] + */ +class VirtualWAN extends models['Resource'] { + /** + * Create a VirtualWAN. + * @member {boolean} [disableVpnEncryption] Vpn encryption to be disabled or + * not. + * @member {array} [virtualHubs] List of VirtualHubs in the VirtualWAN. + * @member {array} [vpnSites] + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualWAN + * + * @returns {object} metadata of VirtualWAN + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualWAN', + type: { + name: 'Composite', + className: 'VirtualWAN', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + disableVpnEncryption: { + required: false, + serializedName: 'properties.disableVpnEncryption', + type: { + name: 'Boolean' + } + }, + virtualHubs: { + required: false, + readOnly: true, + serializedName: 'properties.virtualHubs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + vpnSites: { + required: false, + readOnly: true, + serializedName: 'properties.vpnSites', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualWAN; diff --git a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js b/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js index b4f14facc0..4542fb73c7 100644 --- a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js +++ b/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js @@ -98,7 +98,7 @@ class VpnClientConfiguration { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'VpnClientProtocolElementType', type: { name: 'String' } diff --git a/lib/services/networkManagement2/lib/models/vpnConnection.js b/lib/services/networkManagement2/lib/models/vpnConnection.js new file mode 100644 index 0000000000..7b6eac00b2 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/vpnConnection.js @@ -0,0 +1,199 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VpnConnection Resource. + * + * @extends models['Resource'] + */ +class VpnConnection extends models['Resource'] { + /** + * Create a VpnConnection. + * @member {object} [remoteVpnSite] Id of the connected vpn site. + * @member {string} [remoteVpnSite.id] Resource ID. + * @member {number} [routingWeight] routing weight for vpn connection. + * @member {string} [connectionStatus] The connection status. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @member {number} [ingressBytesTransferred] Ingress bytes transferred. + * @member {number} [egressBytesTransferred] Egress bytes transferred. + * @member {number} [connectionBandwidthInMbps] Expected bandwidth in MBPS. + * @member {string} [sharedKey] SharedKey for the vpn connection. + * @member {boolean} [enableBgp] EnableBgp flag + * @member {array} [ipsecPolicies] The IPSec Policies to be considered by + * this connection. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VpnConnection + * + * @returns {object} metadata of VpnConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnConnection', + type: { + name: 'Composite', + className: 'VpnConnection', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + remoteVpnSite: { + required: false, + serializedName: 'properties.remoteVpnSite', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + routingWeight: { + required: false, + serializedName: 'properties.routingWeight', + type: { + name: 'Number' + } + }, + connectionStatus: { + required: false, + serializedName: 'properties.connectionStatus', + type: { + name: 'String' + } + }, + ingressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.ingressBytesTransferred', + type: { + name: 'Number' + } + }, + egressBytesTransferred: { + required: false, + readOnly: true, + serializedName: 'properties.egressBytesTransferred', + type: { + name: 'Number' + } + }, + connectionBandwidthInMbps: { + required: false, + readOnly: true, + serializedName: 'properties.connectionBandwidthInMbps', + type: { + name: 'Number' + } + }, + sharedKey: { + required: false, + serializedName: 'properties.sharedKey', + type: { + name: 'String' + } + }, + enableBgp: { + required: false, + serializedName: 'properties.enableBgp', + type: { + name: 'Boolean' + } + }, + ipsecPolicies: { + required: false, + serializedName: 'properties.ipsecPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpsecPolicyElementType', + type: { + name: 'Composite', + className: 'IpsecPolicy' + } + } + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnConnection; diff --git a/lib/services/networkManagement2/lib/models/vpnGateway.js b/lib/services/networkManagement2/lib/models/vpnGateway.js new file mode 100644 index 0000000000..574f18446e --- /dev/null +++ b/lib/services/networkManagement2/lib/models/vpnGateway.js @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VpnGateway Resource. + * + * @extends models['Resource'] + */ +class VpnGateway extends models['Resource'] { + /** + * Create a VpnGateway. + * @member {object} [virtualHub] The VirtualHub to which the gateway belongs + * @member {string} [virtualHub.id] Resource ID. + * @member {array} [connections] list of all vpn connections to the gateway. + * @member {object} [bgpSettings] Local network gateway's BGP speaker + * settings. + * @member {number} [bgpSettings.asn] The BGP speaker's ASN. + * @member {string} [bgpSettings.bgpPeeringAddress] The BGP peering address + * and BGP identifier of this BGP speaker. + * @member {number} [bgpSettings.peerWeight] The weight added to routes + * learned from this BGP speaker. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {object} [policies] The policies applied to this vpn gateway. + * @member {boolean} [policies.allowBranchToBranchTraffic] True if branch to + * branch traffic is allowed. + * @member {boolean} [policies.allowVnetToVnetTraffic] True if Vnet to Vnet + * traffic is allowed. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VpnGateway + * + * @returns {object} metadata of VpnGateway + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnGateway', + type: { + name: 'Composite', + className: 'VpnGateway', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtualHub: { + required: false, + serializedName: 'properties.virtualHub', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + connections: { + required: false, + serializedName: 'properties.connections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VpnConnectionElementType', + type: { + name: 'Composite', + className: 'VpnConnection' + } + } + } + }, + bgpSettings: { + required: false, + serializedName: 'properties.bgpSettings', + type: { + name: 'Composite', + className: 'BgpSettings' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + policies: { + required: false, + serializedName: 'properties.policies', + type: { + name: 'Composite', + className: 'Policies' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnGateway; diff --git a/lib/services/networkManagement2/lib/models/vpnSite.js b/lib/services/networkManagement2/lib/models/vpnSite.js new file mode 100644 index 0000000000..c7dab1c028 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/vpnSite.js @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * VpnSite Resource. + * + * @extends models['Resource'] + */ +class VpnSite extends models['Resource'] { + /** + * Create a VpnSite. + * @member {object} [virtualWAN] The VirtualWAN to which the vpnSite belongs + * @member {string} [virtualWAN.id] Resource ID. + * @member {object} [deviceProperties] The device properties + * @member {string} [deviceProperties.deviceVendor] Name of the device + * Vendor. + * @member {string} [deviceProperties.deviceModel] Model of the device. + * @member {number} [deviceProperties.linkSpeedInMbps] Link speed. + * @member {string} [ipAddress] The ip-address for the vpn-site. + * @member {string} [siteKey] The key for vpn-site that can be used for + * connections. + * @member {object} [addressSpace] The AddressSpace that contains an array of + * IP address ranges. + * @member {array} [addressSpace.addressPrefixes] A list of address blocks + * reserved for this virtual network in CIDR notation. + * @member {object} [bgpProperties] The set of bgp properties. + * @member {number} [bgpProperties.asn] The BGP speaker's ASN. + * @member {string} [bgpProperties.bgpPeeringAddress] The BGP peering address + * and BGP identifier of this BGP speaker. + * @member {number} [bgpProperties.peerWeight] The weight added to routes + * learned from this BGP speaker. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VpnSite + * + * @returns {object} metadata of VpnSite + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnSite', + type: { + name: 'Composite', + className: 'VpnSite', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + virtualWAN: { + required: false, + serializedName: 'properties.virtualWAN', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + deviceProperties: { + required: false, + serializedName: 'properties.deviceProperties', + type: { + name: 'Composite', + className: 'DeviceProperties' + } + }, + ipAddress: { + required: false, + serializedName: 'properties.ipAddress', + type: { + name: 'String' + } + }, + siteKey: { + required: false, + serializedName: 'properties.siteKey', + type: { + name: 'String' + } + }, + addressSpace: { + required: false, + serializedName: 'properties.addressSpace', + type: { + name: 'Composite', + className: 'AddressSpace' + } + }, + bgpProperties: { + required: false, + serializedName: 'properties.bgpProperties', + type: { + name: 'Composite', + className: 'BgpSettings' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnSite; diff --git a/lib/services/networkManagement2/lib/models/vpnSiteId.js b/lib/services/networkManagement2/lib/models/vpnSiteId.js new file mode 100644 index 0000000000..f00971195c --- /dev/null +++ b/lib/services/networkManagement2/lib/models/vpnSiteId.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * VpnSite Resource. + * + */ +class VpnSiteId { + /** + * Create a VpnSiteId. + * @member {string} [vpnSite] The resource-uri of the vpn-site for which + * config is to be fetched. + */ + constructor() { + } + + /** + * Defines the metadata of VpnSiteId + * + * @returns {object} metadata of VpnSiteId + * + */ + mapper() { + return { + required: false, + serializedName: 'VpnSiteId', + type: { + name: 'Composite', + className: 'VpnSiteId', + modelProperties: { + vpnSite: { + required: false, + readOnly: true, + serializedName: 'vpnSite', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VpnSiteId; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts index 9286c83139..f94f9c454a 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -34,11 +34,11 @@ export default class NetworkManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -47,8 +47,6 @@ export default class NetworkManagementClient extends AzureServiceClient { subscriptionId: string; - apiVersion: string; - acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -56,6 +54,7 @@ export default class NetworkManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + azureFirewalls: operations.AzureFirewalls; applicationGateways: operations.ApplicationGateways; applicationSecurityGroups: operations.ApplicationSecurityGroups; ddosProtectionPlans: operations.DdosProtectionPlans; @@ -97,6 +96,13 @@ export default class NetworkManagementClient extends AzureServiceClient { virtualNetworkGateways: operations.VirtualNetworkGateways; virtualNetworkGatewayConnections: operations.VirtualNetworkGatewayConnections; localNetworkGateways: operations.LocalNetworkGateways; + virtualWANs: operations.VirtualWANs; + vpnSites: operations.VpnSites; + vpnSitesConfiguration: operations.VpnSitesConfiguration; + virtualHubs: operations.VirtualHubs; + hubVirtualNetworkConnections: operations.HubVirtualNetworkConnections; + vpnGateways: operations.VpnGateways; + vpnConnections: operations.VpnConnections; /** diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index 77e297060f..35f91566a1 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -61,6 +61,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -69,9 +70,6 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (domainNameLabel === null || domainNameLabel === undefined || typeof domainNameLabel.valueOf() !== 'string') { throw new Error('domainNameLabel 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.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.'); } @@ -89,7 +87,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; queryParameters.push('domainNameLabel=' + encodeURIComponent(domainNameLabel)); - queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -183,9 +181,9 @@ class NetworkManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -199,7 +197,6 @@ class NetworkManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -221,6 +218,7 @@ class NetworkManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.azureFirewalls = new operations.AzureFirewalls(this); this.applicationGateways = new operations.ApplicationGateways(this); this.applicationSecurityGroups = new operations.ApplicationSecurityGroups(this); this.ddosProtectionPlans = new operations.DdosProtectionPlans(this); @@ -262,6 +260,13 @@ class NetworkManagementClient extends ServiceClient { this.virtualNetworkGateways = new operations.VirtualNetworkGateways(this); this.virtualNetworkGatewayConnections = new operations.VirtualNetworkGatewayConnections(this); this.localNetworkGateways = new operations.LocalNetworkGateways(this); + this.virtualWANs = new operations.VirtualWANs(this); + this.vpnSites = new operations.VpnSites(this); + this.vpnSitesConfiguration = new operations.VpnSitesConfiguration(this); + this.virtualHubs = new operations.VirtualHubs(this); + this.hubVirtualNetworkConnections = new operations.HubVirtualNetworkConnections(this); + this.vpnGateways = new operations.VpnGateways(this); + this.vpnConnections = new operations.VpnConnections(this); this.models = models; this._checkDnsNameAvailability = _checkDnsNameAvailability; msRest.addSerializationMixin(this); diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js index fd66cf450b..278254c9c6 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -112,6 +112,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -120,9 +121,6 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -140,7 +138,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -237,10 +235,10 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -334,6 +332,19 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -344,6 +355,9 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -537,14 +551,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -561,7 +573,7 @@ function _list(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('&'); } @@ -675,11 +687,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -695,7 +705,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1019,11 +1029,9 @@ function _listAvailableWafRuleSets(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1039,7 +1047,7 @@ function _listAvailableWafRuleSets(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1153,11 +1161,9 @@ function _listAvailableSslOptions(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1173,7 +1179,7 @@ function _listAvailableSslOptions(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1288,11 +1294,9 @@ function _listAvailableSslPredefinedPolicies(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1308,7 +1312,7 @@ function _listAvailableSslPredefinedPolicies(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1424,11 +1428,9 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1448,7 +1450,7 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{predefinedPolicyName}', encodeURIComponent(predefinedPolicyName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1564,6 +1566,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1572,9 +1575,6 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1592,7 +1592,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1671,10 +1671,10 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -1768,6 +1768,19 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -1778,6 +1791,9 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -1812,6 +1828,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1823,9 +1840,6 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1843,7 +1857,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1996,6 +2010,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2007,9 +2022,6 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2027,7 +2039,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2157,6 +2169,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2165,9 +2178,6 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2185,7 +2195,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2284,6 +2294,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2292,9 +2303,6 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2312,7 +2320,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2418,6 +2426,7 @@ function _beginBackendHealth(resourceGroupName, applicationGatewayName, options, throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2426,9 +2435,6 @@ function _beginBackendHealth(resourceGroupName, applicationGatewayName, options, if (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2449,7 +2455,7 @@ function _beginBackendHealth(resourceGroupName, applicationGatewayName, options, requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -3136,10 +3142,10 @@ class ApplicationGateways { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -3233,6 +3239,19 @@ class ApplicationGateways { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -3243,6 +3262,9 @@ class ApplicationGateways { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -3288,10 +3310,10 @@ class ApplicationGateways { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -3385,6 +3407,19 @@ class ApplicationGateways { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -3395,6 +3430,9 @@ class ApplicationGateways { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -4392,10 +4430,10 @@ class ApplicationGateways { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -4489,6 +4527,19 @@ class ApplicationGateways { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -4499,6 +4550,9 @@ class ApplicationGateways { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -4544,10 +4598,10 @@ class ApplicationGateways { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -4641,6 +4695,19 @@ class ApplicationGateways { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -4651,6 +4718,9 @@ class ApplicationGateways { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js index e72d672519..77b7f72550 100644 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -143,7 +141,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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,11 +344,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -366,7 +362,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -482,14 +478,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -506,7 +500,7 @@ function _list(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('&'); } @@ -623,6 +617,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -631,9 +626,6 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -651,7 +643,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -762,6 +754,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -773,9 +766,6 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -793,7 +783,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js index e4a6dec6fd..5e0f85f9a8 100644 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js @@ -48,14 +48,12 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { throw new Error('location cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -72,7 +70,7 @@ function _list(location, options, callback) { requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/azureFirewalls.js b/lib/services/networkManagement2/lib/operations/azureFirewalls.js new file mode 100644 index 0000000000..792f6a1462 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/azureFirewalls.js @@ -0,0 +1,2042 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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 _deleteMethod(resourceGroupName, azureFirewallName, 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.beginDeleteMethod(resourceGroupName, azureFirewallName, 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); + }); + }); +} + +/** + * Gets the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, azureFirewallName, 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-06-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { + throw new Error('azureFirewallName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/azureFirewalls/{azureFirewallName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AzureFirewall']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, azureFirewallName, parameters, 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.beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, 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['AzureFirewall']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, 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-06-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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/azureFirewalls'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AzureFirewallListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the Azure Firewalls in a subscription. + * + * @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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAll(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-06-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.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}/providers/Microsoft.Network/azureFirewalls'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AzureFirewallListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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 _beginDeleteMethod(resourceGroupName, azureFirewallName, 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-06-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { + throw new Error('azureFirewallName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/azureFirewalls/{azureFirewallName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); + 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 = '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 !== 202 && 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); + }); +} + +/** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, 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-06-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { + throw new Error('azureFirewallName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AzureFirewall']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['AzureFirewall']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AzureFirewall']().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); + }); +} + +/** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 AzureFirewallListResult} for more + * information. + * + * {object} [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) { + 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['AzureFirewallListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the Azure Firewalls in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAllNext(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) { + 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['AzureFirewallListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AzureFirewalls. */ +class AzureFirewalls { + /** + * Create a AzureFirewalls. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._list = _list; + this._listAll = _listAll; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + } + + /** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, azureFirewallName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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. + */ + deleteMethod(resourceGroupName, azureFirewallName, 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._deleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, azureFirewallName, options, optionalCallback); + } + } + + /** + * Gets the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, azureFirewallName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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 {AzureFirewall} - 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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, azureFirewallName, 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._get(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, azureFirewallName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, azureFirewallName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {AzureFirewall} - 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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, azureFirewallName, parameters, 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._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, optionalCallback); + } + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {AzureFirewallListResult} - 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 AzureFirewallListResult} for more + * information. + * + * {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(resourceGroupName, 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(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the Azure Firewalls in 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 {AzureFirewallListResult} - 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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, azureFirewallName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, azureFirewallName, 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._beginDeleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, azureFirewallName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, azureFirewallName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} azureFirewallName The name of the Azure Firewall. + * + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {AzureFirewall} - 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 AzureFirewall} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, 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._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, optionalCallback); + } + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {AzureFirewallListResult} - 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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {AzureFirewallListResult} - 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 AzureFirewallListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AzureFirewalls; diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js index 444d0a15e7..14fac9f202 100644 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js @@ -46,11 +46,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -66,7 +64,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js index 709e8f1564..a8ea0a1960 100644 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -167,6 +167,7 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -178,9 +179,6 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -199,7 +197,7 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -599,6 +597,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -607,9 +606,6 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -627,7 +623,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -780,6 +776,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -794,9 +791,6 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -815,7 +809,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -965,6 +959,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -976,9 +971,6 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -997,7 +989,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1099,6 +1091,7 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1110,9 +1103,6 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1131,7 +1121,7 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1233,6 +1223,7 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1244,9 +1235,6 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1265,7 +1253,7 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1370,6 +1358,7 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1381,9 +1370,6 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1402,7 +1388,7 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js index aa2e109e9d..c8e8c1a02d 100644 --- a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js +++ b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js @@ -112,6 +112,7 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -120,9 +121,6 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { if (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -140,7 +138,7 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -233,8 +231,6 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. @@ -341,11 +337,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -361,7 +355,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -477,14 +471,12 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -501,7 +493,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('&'); } @@ -617,6 +609,7 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -625,9 +618,6 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, if (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -645,7 +635,7 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -720,8 +710,6 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. @@ -754,6 +742,7 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -765,9 +754,6 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -785,7 +771,7 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1354,8 +1340,6 @@ class DdosProtectionPlans { * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. @@ -1395,8 +1379,6 @@ class DdosProtectionPlans { * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. @@ -1705,8 +1687,6 @@ class DdosProtectionPlans { * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. @@ -1746,8 +1726,6 @@ class DdosProtectionPlans { * @param {object} parameters Parameters supplied to the create or update * operation. * - * @param {string} [parameters.id] Resource ID. - * * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. diff --git a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js index 19435f09e3..76e555f2d8 100644 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js @@ -51,6 +51,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59,9 +60,6 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -79,7 +77,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - 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 _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -211,9 +210,6 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (defaultSecurityRuleName === null || defaultSecurityRuleName === undefined || typeof defaultSecurityRuleName.valueOf() !== 'string') { throw new Error('defaultSecurityRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -232,7 +228,7 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa requestUrl = requestUrl.replace('{defaultSecurityRuleName}', encodeURIComponent(defaultSecurityRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js index 52d2037c8b..fa7d0adbad 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js @@ -118,6 +118,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -129,9 +130,6 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -150,7 +148,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -369,6 +367,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -377,9 +376,6 @@ function _list(resourceGroupName, circuitName, options, callback) { if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { throw new Error('circuitName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -397,7 +393,7 @@ function _list(resourceGroupName, circuitName, options, callback) { requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -516,6 +512,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -527,9 +524,6 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -548,7 +542,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -671,6 +665,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -685,9 +680,6 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (authorizationParameters === null || authorizationParameters === undefined) { throw new Error('authorizationParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -706,7 +698,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js index 996630c055..a4d083ae59 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js @@ -125,6 +125,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -139,9 +140,6 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { throw new Error('connectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -161,7 +159,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -397,6 +395,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -411,9 +410,6 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { throw new Error('connectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -433,7 +429,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -569,6 +565,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -586,9 +583,6 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne if (expressRouteCircuitConnectionParameters === null || expressRouteCircuitConnectionParameters === undefined) { throw new Error('expressRouteCircuitConnectionParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -608,7 +602,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 1647d432da..17e63f24c4 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js @@ -80,7 +80,7 @@ function _deleteMethod(resourceGroupName, circuitName, peeringName, options, cal } /** - * Gets the specified authorization from the specified express route circuit. + * Gets the specified peering for the express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -117,6 +117,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -128,9 +129,6 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { throw new Error('peeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -149,7 +147,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -478,6 +476,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -486,9 +485,6 @@ function _list(resourceGroupName, circuitName, options, callback) { if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { throw new Error('circuitName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -506,7 +502,7 @@ function _list(resourceGroupName, circuitName, options, callback) { requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -624,6 +620,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -635,9 +632,6 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { throw new Error('peeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -656,7 +650,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -889,6 +883,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -903,9 +898,6 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (peeringParameters === null || peeringParameters === undefined) { throw new Error('peeringParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -924,7 +916,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1272,7 +1264,7 @@ class ExpressRouteCircuitPeerings { } /** - * Gets the specified authorization from the specified express route circuit. + * Gets the specified peering for the express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -1306,7 +1298,7 @@ class ExpressRouteCircuitPeerings { } /** - * Gets the specified authorization from the specified express route circuit. + * Gets the specified peering for the express route circuit. * * @param {string} resourceGroupName The name of the resource group. * diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index 2ec0768228..58ed25d34d 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -112,6 +112,7 @@ function _get(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -120,9 +121,6 @@ function _get(resourceGroupName, circuitName, options, callback) { if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { throw new Error('circuitName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -140,7 +138,7 @@ function _get(resourceGroupName, circuitName, options, callback) { requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -730,6 +728,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -738,9 +737,6 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { throw new Error('circuitName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -758,7 +754,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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 +874,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -889,9 +886,6 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { throw new Error('peeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -910,7 +904,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1026,14 +1020,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1050,7 +1042,7 @@ function _list(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('&'); } @@ -1164,11 +1156,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1184,7 +1174,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1300,6 +1290,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1308,9 +1299,6 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (circuitName === null || circuitName === undefined || typeof circuitName.valueOf() !== 'string') { throw new Error('circuitName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1328,7 +1316,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1486,6 +1474,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1497,9 +1486,6 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1517,7 +1503,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1670,6 +1656,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1681,9 +1668,6 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1701,7 +1685,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1838,6 +1822,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1852,9 +1837,6 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1874,7 +1856,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1997,6 +1979,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2011,9 +1994,6 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2033,7 +2013,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2157,6 +2137,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2171,9 +2152,6 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2193,7 +2171,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js index 3a8e0f4b02..8dcd1902df 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -51,6 +51,7 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59,9 +60,6 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { if (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -79,7 +77,7 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -266,6 +264,7 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -277,9 +276,6 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { throw new Error('peeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -298,7 +294,7 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -416,6 +412,9 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * @@ -596,6 +595,7 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -607,9 +607,6 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, if (peeringName === null || peeringName === undefined || typeof peeringName.valueOf() !== 'string') { throw new Error('peeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -628,7 +625,7 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -728,6 +725,9 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * @@ -829,6 +829,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -843,9 +844,6 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam if (peeringParameters === null || peeringParameters === undefined) { throw new Error('peeringParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -864,7 +862,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1430,6 +1428,9 @@ class ExpressRouteCrossConnectionPeerings { * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * @@ -1562,6 +1563,9 @@ class ExpressRouteCrossConnectionPeerings { * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * @@ -1808,6 +1812,9 @@ class ExpressRouteCrossConnectionPeerings { * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * @@ -1940,6 +1947,9 @@ class ExpressRouteCrossConnectionPeerings { * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft * peering configuration. * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider * or the customer last modified the peering. * diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js index aa4f1a8d0d..f979ebe167 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -46,11 +46,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -66,7 +64,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -182,14 +180,12 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -206,7 +202,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('&'); } @@ -326,6 +322,7 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -334,9 +331,6 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { if (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -354,7 +348,7 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -448,6 +442,16 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. @@ -887,6 +891,16 @@ function _listRoutesTable(resourceGroupName, crossConnectionName, peeringName, d * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. @@ -933,6 +947,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -944,9 +959,6 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -964,7 +976,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1101,6 +1113,7 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1112,9 +1125,6 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio if (crossConnectionParameters === null || crossConnectionParameters === undefined) { throw new Error('crossConnectionParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1132,7 +1142,7 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1270,6 +1280,7 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1284,9 +1295,6 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1306,7 +1314,7 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1431,6 +1439,7 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1445,9 +1454,6 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1467,7 +1473,7 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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 +1597,7 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1605,9 +1612,6 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa if (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { throw new Error('devicePath cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1627,7 +1631,7 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2254,6 +2258,16 @@ class ExpressRouteCrossConnections { * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. @@ -2307,6 +2321,16 @@ class ExpressRouteCrossConnections { * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. @@ -2778,6 +2802,16 @@ class ExpressRouteCrossConnections { * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. @@ -2831,6 +2865,16 @@ class ExpressRouteCrossConnections { * @param {object} parameters Parameters supplied to the update express route * crossConnection operation. * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * * @param {string} [parameters.serviceProviderProvisioningState] The * provisioning state of the circuit in the connectivity provider system. * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. diff --git a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js index c0c647acd9..77c53158cf 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js @@ -46,11 +46,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -66,7 +64,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/hubVirtualNetworkConnections.js b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js new file mode 100644 index 0000000000..b5355410eb --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js @@ -0,0 +1,720 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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 HubVirtualNetworkConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualHubName, connectionName, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + 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['ErrorModel']().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['HubVirtualNetworkConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 ListHubVirtualNetworkConnectionsResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, virtualHubName, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + 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['ErrorModel']().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['ListHubVirtualNetworkConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @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 ListHubVirtualNetworkConnectionsResult} for + * more information. + * + * {object} [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['ErrorModel']().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['ListHubVirtualNetworkConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 HubVirtualNetworkConnections. */ +class HubVirtualNetworkConnections { + /** + * Create a HubVirtualNetworkConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualHubName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualHubName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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 {HubVirtualNetworkConnection} - 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 HubVirtualNetworkConnection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualHubName, connectionName, 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._get(resourceGroupName, virtualHubName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualHubName, connectionName, options, optionalCallback); + } + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 {ListHubVirtualNetworkConnectionsResult} - 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 ListHubVirtualNetworkConnectionsResult} for + * more information. + * + * {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(resourceGroupName, virtualHubName, 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(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, virtualHubName, options, optionalCallback); + } + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @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 {ListHubVirtualNetworkConnectionsResult} - 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 ListHubVirtualNetworkConnectionsResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = HubVirtualNetworkConnections; diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js index df67087433..0c9bc6715e 100644 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ b/lib/services/networkManagement2/lib/operations/inboundNatRules.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -265,6 +263,7 @@ function _get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -276,9 +275,6 @@ function _get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -300,7 +296,7 @@ function _get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -544,6 +540,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -555,9 +552,6 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -576,7 +570,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -721,6 +715,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -735,9 +730,6 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (inboundNatRuleParameters === null || inboundNatRuleParameters === undefined) { throw new Error('inboundNatRuleParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -756,7 +748,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index ebd9602206..1b50dafa65 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -14,19 +14,19 @@ import * as models from '../models'; /** * @class - * ApplicationGateways + * AzureFirewalls * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface ApplicationGateways { +export interface AzureFirewalls { /** - * Deletes the specified application gateway. + * Deletes the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * * @param {object} [options] Optional Parameters. * @@ -39,14 +39,14 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified application gateway. + * Deletes the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * * @param {object} [options] Optional Parameters. * @@ -74,17 +74,17 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified application gateway. + * Gets the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * * @param {object} [options] Optional Parameters. * @@ -93,18 +93,18 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified application gateway. + * Gets the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * * @param {object} [options] Optional Parameters. * @@ -118,7 +118,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGateway} - The deserialized result object. + * @resolve {AzureFirewall} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -126,144 +126,125 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} for more information. + * {AzureFirewall} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewall} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates the specified application gateway. + * Creates or updates the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. + * @param {string} azureFirewallName The name of the Azure Firewall. * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' + * @param {string} [parameters.id] Resource ID. * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * @param {string} [parameters.location] Resource location. * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified Azure Firewall. * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. + * @param {string} azureFirewallName The name of the Azure Firewall. * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. + * @param {string} [parameters.id] Resource ID. * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. + * @param {string} [parameters.location] Resource location. * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' + * @param {object} [options] Optional Parameters. * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. + * {Promise} A promise is returned. * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. + * @resolve {AzureFirewall} - The deserialized result object. * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * {AzureFirewall} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewall} for more information. * - * @param {string} [parameters.id] Resource ID. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.location] Resource location. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all Azure Firewalls in a resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -272,138 +253,128 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates the specified application gateway. + * Lists all Azure Firewalls in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.sku] SKU of the application gateway resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * {Promise} A promise is returned. * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. + * @resolve {AzureFirewallListResult} - The deserialized result object. * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewallListResult} for more + * information. * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the Azure Firewalls in a subscription. * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the Azure Firewalls in a subscription. * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. + * {Promise} A promise is returned. * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. + * @resolve {AzureFirewallListResult} - The deserialized result object. * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' + * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewallListResult} for more + * information. * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified Azure Firewall. * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. + * @param {string} resourceGroupName The name of the resource group. * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. + * @param {string} azureFirewallName The name of the Azure Firewall. * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.id] Resource ID. + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified Azure Firewall. * - * @param {string} [parameters.location] Resource location. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} azureFirewallName The name of the Azure Firewall. * * @param {object} [options] Optional Parameters. * @@ -417,7 +388,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGateway} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -425,27 +396,43 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the specified application gateway tags. + * Creates or updates the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * - * @param {object} parameters Parameters supplied to update application gateway - * tags. + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -456,21 +443,38 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the specified application gateway tags. + * Creates or updates the specified Azure Firewall. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {string} azureFirewallName The name of the Azure Firewall. * - * @param {object} parameters Parameters supplied to update application gateway - * tags. + * @param {object} parameters Parameters supplied to the create or update Azure + * Firewall operation. + * + * @param {array} [parameters.applicationRuleCollections] Collection of + * application rule collections used by a Azure Firewall. + * + * @param {array} [parameters.networkRuleCollections] Collection of network + * rule collections used by a Azure Firewall. + * + * @param {array} [parameters.ipConfigurations] IP configuration of the Azure + * Firewall resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -486,7 +490,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGateway} - The deserialized result object. + * @resolve {AzureFirewall} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -494,22 +498,23 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} for more information. + * {AzureFirewall} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewall} 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. */ - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all application gateways in a resource group. + * Lists all Azure Firewalls in a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -518,16 +523,17 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all application gateways in a resource group. + * Lists all Azure Firewalls in a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -541,7 +547,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGatewayListResult} - The deserialized result object. + * @resolve {AzureFirewallListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -549,21 +555,24 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} for more + * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewallListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { 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; /** - * Gets all the application gateways in a subscription. + * Gets all the Azure Firewalls in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -572,14 +581,17 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the application gateways in a subscription. + * Gets all the Azure Firewalls in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -593,7 +605,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGatewayListResult} - The deserialized result object. + * @resolve {AzureFirewallListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -601,21 +613,30 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} for more + * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AzureFirewallListResult} 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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ApplicationGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ApplicationGateways { /** - * Starts the specified application gateway. + * Deletes the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * @@ -632,10 +653,10 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts the specified application gateway. + * Deletes the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * @@ -667,13 +688,13 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - start(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stops the specified application gateway in a resource group. + * Gets the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * @@ -686,14 +707,14 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops the specified application gateway in a resource group. + * Gets the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * @@ -711,7 +732,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -719,305 +740,160 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} 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. */ - stop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the backend health of the specified application gateway in a resource - * group. + * Creates or updates the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} applicationGatewayName The name of the application gateway. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sku] SKU of the application gateway resource. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * - * @reject {Error|ServiceError} - The error object. - */ - backendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the backend health of the specified application gateway in a resource - * group. + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. * - * {Promise} A promise is returned. + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. * - * @resolve {ApplicationGatewayBackendHealth} - The deserialized result object. + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.probes] Probes of the application gateway + * resource. * - * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayBackendHealth} for more - * information. + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - backendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - backendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - backendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all available web application firewall rule sets. + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. * - * @returns {Promise} A promise is returned + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. * - * @reject {Error|ServiceError} - The error object. - */ - listAvailableWafRuleSetsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all available web application firewall rule sets. + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. * - * @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 {ApplicationGatewayAvailableWafRuleSetsResult} - 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. - * - * {ApplicationGatewayAvailableWafRuleSetsResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ApplicationGatewayAvailableWafRuleSetsResult} 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. - */ - listAvailableWafRuleSets(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableWafRuleSets(callback: ServiceCallback): void; - listAvailableWafRuleSets(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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. - */ - listAvailableSslOptionsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslOptions} - 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. - * - * {ApplicationGatewayAvailableSslOptions} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayAvailableSslOptions} 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. - */ - listAvailableSslOptions(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslOptions(callback: ServiceCallback): void; - listAvailableSslOptions(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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. - */ - listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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. - * - * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. - * See {@link - * ApplicationGatewayAvailableSslPredefinedPolicies} 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. - */ - listAvailableSslPredefinedPolicies(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslPredefinedPolicies(callback: ServiceCallback): void; - listAvailableSslPredefinedPolicies(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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. - */ - getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets Ssl predefined policy with the specified policy name. + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. * - * @param {object} [options] Optional Parameters. + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. * - * {Promise} A promise is returned. + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds * - * @resolve {ApplicationGatewaySslPredefinedPolicy} - The deserialized result object. + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. * - * @reject {Error|ServiceError} - The error object. + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. * - * {ApplicationGatewaySslPredefinedPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewaySslPredefinedPolicy} for - * more information. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getSslPredefinedPolicy(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSslPredefinedPolicy(predefinedPolicyName: string, callback: ServiceCallback): void; - getSslPredefinedPolicy(predefinedPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified application gateway. + * @param {string} [parameters.id] Resource ID. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.location] Resource location. * - * @param {string} applicationGatewayName The name of the application gateway. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1026,49 +902,11 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates or updates the specified application gateway. @@ -1084,10 +922,10 @@ export interface ApplicationGateways { * * @param {string} [parameters.sku.name] Name of an application gateway SKU. * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * * @param {number} [parameters.sku.capacity] Capacity (instance count) of an * application gateway. @@ -1181,6 +1019,19 @@ export interface ApplicationGateways { * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the * application gateway resource. * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * * @param {string} [parameters.resourceGuid] Resource GUID property of the * application gateway resource. * @@ -1191,6 +1042,9 @@ export interface ApplicationGateways { * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * * @param {string} [parameters.id] Resource ID. * * @param {string} [parameters.location] Resource location. @@ -1202,140 +1056,124 @@ export interface ApplicationGateways { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. + * {Promise} A promise is returned. * - * @param {string} applicationGatewayName The name of the application gateway. + * @resolve {ApplicationGateway} - The deserialized result object. * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.sku] SKU of the application gateway resource. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large' + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF' + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified application gateway tags. * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' + * @param {string} applicationGatewayName The name of the application gateway. * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + * @param {object} parameters Parameters supplied to update application gateway + * tags. * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified application gateway tags. * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. + * @param {string} applicationGatewayName The name of the application gateway. * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. + * @param {object} parameters Parameters supplied to update application gateway + * tags. * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. + * @param {object} [parameters.tags] Resource tags. * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. + * {Promise} A promise is returned. * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. + * @resolve {ApplicationGateway} - The deserialized result object. * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' + * @reject {Error|ServiceError} - The error object. * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all application gateways in a resource group. * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.id] Resource ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.location] Resource location. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all application gateways in a resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -1349,7 +1187,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGateway} - The deserialized result object. + * @resolve {ApplicationGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1357,29 +1195,21 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} for more information. + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. + * Gets all the application gateways in a subscription. * * @param {object} [options] Optional Parameters. * @@ -1388,23 +1218,14 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. + * Gets all the application gateways in a subscription. * * @param {object} [options] Optional Parameters. * @@ -1418,7 +1239,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGateway} - The deserialized result object. + * @resolve {ApplicationGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1426,16 +1247,17 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} for more information. + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} 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. */ - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1456,7 +1278,7 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - beginStartWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts the specified application gateway. @@ -1491,9 +1313,9 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStart(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1514,7 +1336,7 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - beginStopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Stops the specified application gateway in a resource group. @@ -1549,9 +1371,9 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + stop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1576,7 +1398,7 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - beginBackendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + backendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the backend health of the specified application gateway in a resource @@ -1617,16 +1439,13 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + backendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + backendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + backendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all application gateways in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all available web application firewall rule sets. * * @param {object} [options] Optional Parameters. * @@ -1635,17 +1454,14 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableWafRuleSetsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all application gateways in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all available web application firewall rule sets. * * @param {object} [options] Optional Parameters. * @@ -1659,7 +1475,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGatewayListResult} - The deserialized result object. + * @resolve {ApplicationGatewayAvailableWafRuleSetsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1667,24 +1483,22 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} for more + * {ApplicationGatewayAvailableWafRuleSetsResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ApplicationGatewayAvailableWafRuleSetsResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableWafRuleSets(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableWafRuleSets(callback: ServiceCallback): void; + listAvailableWafRuleSets(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the application gateways in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists available Ssl options for configuring Ssl policy. * * @param {object} [options] Optional Parameters. * @@ -1693,17 +1507,14 @@ export interface ApplicationGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableSslOptionsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the application gateways in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists available Ssl options for configuring Ssl policy. * * @param {object} [options] Optional Parameters. * @@ -1717,7 +1528,7 @@ export interface ApplicationGateways { * * {Promise} A promise is returned. * - * @resolve {ApplicationGatewayListResult} - The deserialized result object. + * @resolve {ApplicationGatewayAvailableSslOptions} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1725,25 +1536,22 @@ export interface ApplicationGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} for more - * information. + * {ApplicationGatewayAvailableSslOptions} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayAvailableSslOptions} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableSslOptions(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslOptions(callback: ServiceCallback): void; + listAvailableSslOptions(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Lists all SSL predefined policies for configuring Ssl policy. * - * @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 @@ -1755,14 +1563,11 @@ export interface ApplicationGateways { * * @reject {Error|ServiceError} - The error object. */ - listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists all SSL predefined policies for configuring Ssl policy. * - * @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 @@ -1792,27 +1597,15 @@ export interface ApplicationGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, callback: ServiceCallback): void; - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ApplicationSecurityGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ApplicationSecurityGroups { + listAvailableSslPredefinedPolicies(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslPredefinedPolicies(callback: ServiceCallback): void; + listAvailableSslPredefinedPolicies(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets Ssl predefined policy with the specified policy name. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} predefinedPolicyName Name of Ssl predefined policy. * * @param {object} [options] Optional Parameters. * @@ -1821,19 +1614,16 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets Ssl predefined policy with the specified policy name. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} predefinedPolicyName Name of Ssl predefined policy. * * @param {object} [options] Optional Parameters. * @@ -1847,7 +1637,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationGatewaySslPredefinedPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1855,24 +1645,25 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationGatewaySslPredefinedPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewaySslPredefinedPolicy} 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. */ - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSslPredefinedPolicy(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSslPredefinedPolicy(predefinedPolicyName: string, callback: ServiceCallback): void; + getSslPredefinedPolicy(predefinedPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about the specified application security group. + * Deletes the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -1881,19 +1672,18 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about the specified application security group. + * Deletes the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -1907,7 +1697,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {ApplicationSecurityGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1915,155 +1705,159 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an application security group. + * Creates or updates the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. + * application gateway operation. * - * @param {string} [parameters.id] Resource ID. + * @param {object} [parameters.sku] SKU of the application gateway resource. * - * @param {string} [parameters.location] Resource location. + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * - * @param {object} [options] Optional Parameters. + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. * - * @returns {Promise} A promise is returned + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an application security group. + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. * - * @param {string} [parameters.id] Resource ID. + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. * - * @param {string} [parameters.location] Resource location. + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.probes] Probes of the application gateway + * resource. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. * - * {Promise} A promise is returned. + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. * - * @resolve {ApplicationSecurityGroup} - The deserialized result object. + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} for more - * information. + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all application security groups in a subscription. + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. * - * @param {object} [options] Optional Parameters. + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. * - * @returns {Promise} A promise is returned + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. * - * @reject {Error|ServiceError} - The error object. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all application security groups in a subscription. + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. * - * {Promise} A promise is returned. + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. * - * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} for more - * information. + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.id] Resource ID. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the application security groups in a resource group. + * @param {string} [parameters.location] Resource location. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2072,78 +1866,154 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the application security groups in a resource group. + * Creates or updates the specified application gateway. * * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationGatewayName The name of the application gateway. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters Parameters supplied to the create or update + * application gateway operation. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.sku] SKU of the application gateway resource. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.sku.name] Name of an application gateway SKU. + * Possible values include: 'Standard_Small', 'Standard_Medium', + * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' * - * {Promise} A promise is returned. + * @param {string} [parameters.sku.tier] Tier of an application gateway. + * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' * - * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. + * @param {number} [parameters.sku.capacity] Capacity (instance count) of an + * application gateway. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.sslPolicy] SSL policy of the application gateway + * resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to + * be disabled on application gateway. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. + * Possible values include: 'Predefined', 'Custom' * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} for more - * information. + * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined + * policy. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be + * enabled in the specified order to application gateway. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified application security group. + * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of + * Ssl protocol to be supported on application gateway. Possible values + * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.gatewayIPConfigurations] Subnets of application + * the gateway resource. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {array} [parameters.authenticationCertificates] Authentication + * certificates of the application gateway resource. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.sslCertificates] SSL certificates of the + * application gateway resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses + * of the application gateway resource. * - * @returns {Promise} A promise is returned + * @param {array} [parameters.frontendPorts] Frontend ports of the application + * gateway resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.probes] Probes of the application gateway + * resource. * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application security group. + * @param {array} [parameters.backendAddressPools] Backend address pool of the + * application gateway resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.backendHttpSettingsCollection] Backend http + * settings of the application gateway resource. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. + * @param {array} [parameters.httpListeners] Http listeners of the application + * gateway resource. + * + * @param {array} [parameters.urlPathMaps] URL path map of the application + * gateway resource. + * + * @param {array} [parameters.requestRoutingRules] Request routing rules of the + * application gateway resource. + * + * @param {array} [parameters.redirectConfigurations] Redirect configurations + * of the application gateway resource. + * + * @param {object} [parameters.webApplicationFirewallConfiguration] Web + * application firewall configuration. + * + * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled + * Whether the web application firewall is enabled or not. + * + * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention' + * + * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + * + * @param {string} + * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of + * the rule set type. + * + * @param {array} + * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The + * disabled rule groups. + * + * @param {boolean} + * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether + * allow WAF to check request Body. + * + * @param {number} + * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium + * request body size for WAF. + * + * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the + * application gateway resource. + * + * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the + * application gateway resource. + * + * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. + * + * @param {object} parameters.autoscaleConfiguration.bounds Autoscale bounds + * + * @param {number} parameters.autoscaleConfiguration.bounds.min Lower bound on + * number of Application Gateway instances. + * + * @param {number} parameters.autoscaleConfiguration.bounds.max Upper bound on + * number of Application Gateway instances. + * + * @param {string} [parameters.resourceGuid] Resource GUID property of the + * application gateway resource. + * + * @param {string} [parameters.provisioningState] Provisioning state of the + * application gateway resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2157,7 +2027,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2165,31 +2035,27 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} 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. */ - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an application security group. + * Updates the specified application gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} applicationGatewayName The name of the application gateway. * - * @param {string} [parameters.location] Resource location. + * @param {object} parameters Parameters supplied to update application gateway + * tags. * * @param {object} [parameters.tags] Resource tags. * @@ -2200,26 +2066,21 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an application security group. + * Updates the specified application gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} applicationGatewayName The name of the application gateway. * - * @param {string} [parameters.location] Resource location. + * @param {object} parameters Parameters supplied to update application gateway + * tags. * * @param {object} [parameters.tags] Resource tags. * @@ -2235,7 +2096,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {ApplicationSecurityGroup} - The deserialized result object. + * @resolve {ApplicationGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2243,24 +2104,24 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} for more - * information. + * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGateway} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all application security groups in a subscription. + * Starts the specified application gateway. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -2269,17 +2130,18 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all application security groups in a subscription. + * Starts the specified application gateway. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -2293,7 +2155,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2301,24 +2163,23 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the application security groups in a resource group. + * Stops the specified application gateway in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -2327,17 +2188,18 @@ export interface ApplicationSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the application security groups in a resource group. + * Stops the specified application gateway in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * @@ -2351,7 +2213,7 @@ export interface ApplicationSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2359,57 +2221,54 @@ export interface ApplicationSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DdosProtectionPlans - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface DdosProtectionPlans { + beginStop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified DDoS protection plan. + * Gets the backend health of the specified application gateway in a resource + * group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * * @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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginBackendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified DDoS protection plan. + * Gets the backend health of the specified application gateway in a resource + * group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationGatewayName The name of the application gateway. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands BackendAddressPool and + * BackendHttpSettings referenced in backend health. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2420,7 +2279,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationGatewayBackendHealth} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2428,23 +2287,24 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayBackendHealth} 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. */ - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; + beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all application gateways in a resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2453,18 +2313,17 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all application gateways in a resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2478,7 +2337,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlan} - The deserialized result object. + * @resolve {ApplicationGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2486,33 +2345,24 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} for more information. + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, ddosProtectionPlanName: string, options: { 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; /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * Gets all the application gateways in a subscription. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2521,27 +2371,17 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * Gets all the application gateways in a subscription. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2555,7 +2395,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlan} - The deserialized result object. + * @resolve {ApplicationGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2563,20 +2403,24 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} for more information. + * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationGatewayListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all DDoS protection plans in a subscription. + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2585,14 +2429,17 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all DDoS protection plans in a subscription. + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2606,7 +2453,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlanListResult} - The deserialized result object. + * @resolve {ApplicationGatewayAvailableSslPredefinedPolicies} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2614,24 +2461,37 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} for more - * information. + * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link + * ApplicationGatewayAvailableSslPredefinedPolicies} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, callback: ServiceCallback): void; + listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ApplicationSecurityGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ApplicationSecurityGroups { /** - * Gets all the DDoS protection plans in a resource group. + * Deletes the specified application security group. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2639,17 +2499,20 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the DDoS protection plans in a resource group. + * Deletes the specified application security group. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2662,7 +2525,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlanListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2670,25 +2533,24 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified DDoS protection plan. + * Gets information about the specified application security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} [options] Optional Parameters. * @@ -2697,18 +2559,19 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified DDoS protection plan. + * Gets information about the specified application security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} [options] Optional Parameters. * @@ -2722,7 +2585,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2730,26 +2593,29 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} 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. */ - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a DDoS protection plan. + * Creates or updates an application security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} parameters Parameters supplied to the create or update - * operation. + * ApplicationSecurityGroup operation. * * @param {string} [parameters.id] Resource ID. * @@ -2764,21 +2630,22 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a DDoS protection plan. + * Creates or updates an application security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} parameters Parameters supplied to the create or update - * operation. + * ApplicationSecurityGroup operation. * * @param {string} [parameters.id] Resource ID. * @@ -2798,7 +2665,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlan} - The deserialized result object. + * @resolve {ApplicationSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2806,23 +2673,21 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} for more information. + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all DDoS protection plans in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all application security groups in a subscription. * * @param {object} [options] Optional Parameters. * @@ -2831,17 +2696,14 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all DDoS protection plans in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all application security groups in a subscription. * * @param {object} [options] Optional Parameters. * @@ -2855,7 +2717,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlanListResult} - The deserialized result object. + * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2863,24 +2725,23 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} for more + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the DDoS protection plans in a resource group. + * Gets all the application security groups in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -2889,17 +2750,16 @@ export interface DdosProtectionPlans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the DDoS protection plans in a resource group. + * Gets all the application security groups in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -2913,7 +2773,7 @@ export interface DdosProtectionPlans { * * {Promise} A promise is returned. * - * @resolve {DdosProtectionPlanListResult} - The deserialized result object. + * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2921,32 +2781,26 @@ export interface DdosProtectionPlans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} for more + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * AvailableEndpointServices - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AvailableEndpointServices { + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * List what values of endpoint services are available for use. + * Deletes the specified application security group. * - * @param {string} location The location to check available endpoint services. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} [options] Optional Parameters. * @@ -2955,16 +2809,19 @@ export interface AvailableEndpointServices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List what values of endpoint services are available for use. + * Deletes the specified application security group. * - * @param {string} location The location to check available endpoint services. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. * * @param {object} [options] Optional Parameters. * @@ -2978,7 +2835,7 @@ export interface AvailableEndpointServices { * * {Promise} A promise is returned. * - * @resolve {EndpointServicesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2986,24 +2843,33 @@ export interface AvailableEndpointServices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EndpointServicesListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * List what values of endpoint services are available for use. + * Creates or updates an application security group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3012,17 +2878,28 @@ export interface AvailableEndpointServices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List what values of endpoint services are available for use. + * Creates or updates an application security group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} applicationSecurityGroupName The name of the application + * security group. + * + * @param {object} parameters Parameters supplied to the create or update + * ApplicationSecurityGroup operation. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3036,7 +2913,7 @@ export interface AvailableEndpointServices { * * {Promise} A promise is returned. * - * @resolve {EndpointServicesListResult} - The deserialized result object. + * @resolve {ApplicationSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3044,37 +2921,24 @@ export interface AvailableEndpointServices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EndpointServicesListResult} for more + * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroup} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCircuitAuthorizations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuitAuthorizations { + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified authorization from the specified express route - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. + * Gets all application security groups in a subscription. * - * @param {string} authorizationName The name of the authorization. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -3083,21 +2947,17 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified authorization from the specified express route - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. + * Gets all application security groups in a subscription. * - * @param {string} authorizationName The name of the authorization. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -3111,7 +2971,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3119,25 +2979,24 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} 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. */ - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified authorization from the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. + * Gets all the application security groups in a resource group. * - * @param {string} authorizationName The name of the authorization. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -3146,20 +3005,17 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified authorization from the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. + * Gets all the application security groups in a resource group. * - * @param {string} authorizationName The name of the authorization. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -3173,7 +3029,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. + * @resolve {ApplicationSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3181,47 +3037,34 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} for more + * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationSecurityGroupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, authorizationName: string, options: { 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; +} + +/** + * @class + * DdosProtectionPlans + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface DdosProtectionPlans { /** - * Creates or updates an authorization in the specified express route circuit. + * Deletes the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3230,40 +3073,18 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an authorization in the specified express route circuit. + * Deletes the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3277,7 +3098,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3285,25 +3106,23 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all authorizations in an express route circuit. + * Gets information about the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3312,18 +3131,18 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all authorizations in an express route circuit. + * Gets information about the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3337,7 +3156,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {AuthorizationListResult} - The deserialized result object. + * @resolve {DdosProtectionPlan} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3345,28 +3164,31 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AuthorizationListResult} for more - * information. + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified authorization from the specified express route - * circuit. + * Creates or updates a DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * - * @param {string} authorizationName The name of the authorization. + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3375,21 +3197,25 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified authorization from the specified express route - * circuit. + * Creates or updates a DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * - * @param {string} authorizationName The name of the authorization. + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3403,7 +3229,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DdosProtectionPlan} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3411,45 +3237,20 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} 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. */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. + * Gets all DDoS protection plans in a subscription. * * @param {object} [options] Optional Parameters. * @@ -3458,40 +3259,14 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. + * Gets all DDoS protection plans in a subscription. * * @param {object} [options] Optional Parameters. * @@ -3505,7 +3280,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. + * @resolve {DdosProtectionPlanListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3513,24 +3288,23 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} for more + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all authorizations in an express route circuit. + * Gets all the DDoS protection plans in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -3539,17 +3313,16 @@ export interface ExpressRouteCircuitAuthorizations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all authorizations in an express route circuit. + * Gets all the DDoS protection plans in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -3563,7 +3336,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {AuthorizationListResult} - The deserialized result object. + * @resolve {DdosProtectionPlanListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3571,36 +3344,25 @@ export interface ExpressRouteCircuitAuthorizations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AuthorizationListResult} for more + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCircuitPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuitPeerings { + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified peering from the specified express route circuit. + * Deletes the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} peeringName The name of the peering. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3613,16 +3375,14 @@ export interface ExpressRouteCircuitPeerings { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified peering from the specified express route circuit. + * Deletes the specified DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} peeringName The name of the peering. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -3650,19 +3410,24 @@ export interface ExpressRouteCircuitPeerings { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Gets the specified authorization from the specified express route circuit. + * Creates or updates a DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3671,20 +3436,25 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified authorization from the specified express route circuit. + * Creates or updates a DDoS protection plan. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to the create or update + * operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3698,7 +3468,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. + * @resolve {DdosProtectionPlan} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3706,157 +3476,147 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} for more - * information. + * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlan} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a peering in the specified express route circuits. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * Gets all DDoS protection plans in a subscription. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {number} [peeringParameters.azureASN] The Azure ASN. + * @param {object} [options] Optional Parameters. * - * @param {number} [peeringParameters.peerASN] The peer ASN. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. + * @returns {Promise} A promise is returned * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all DDoS protection plans in a subscription. * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [peeringParameters.sharedKey] The shared key. + * @param {object} [options] Optional Parameters. * - * @param {number} [peeringParameters.vlanId] The VLAN ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [peeringParameters.stats] Gets peering stats. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. + * {Promise} A promise is returned. * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. + * @resolve {DdosProtectionPlanListResult} - The deserialized result object. * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. + * @reject {Error|ServiceError} - The error object. * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. + * {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; + + + /** + * Gets all the DDoS protection plans in a resource group. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @returns {Promise} A promise is returned * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the DDoS protection plans in a resource group. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @param {object} [options] Optional Parameters. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * {Promise} A promise is returned. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * @resolve {DdosProtectionPlanListResult} - The deserialized result object. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DdosProtectionPlanListResult} for more + * information. * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AvailableEndpointServices + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface AvailableEndpointServices { + + + /** + * List what values of endpoint services are available for use. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} location The location to check available endpoint services. * * @param {object} [options] Optional Parameters. * @@ -3865,150 +3625,74 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a peering in the specified express route circuits. + * List what values of endpoint services are available for use. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The location to check available endpoint services. * - * @param {string} circuitName The name of the express route circuit. + * @param {object} [options] Optional Parameters. * - * @param {string} peeringName The name of the peering. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * {Promise} A promise is returned. * - * @param {number} [peeringParameters.azureASN] The Azure ASN. + * @resolve {EndpointServicesListResult} - The deserialized result object. * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @reject {Error|ServiceError} - The error object. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EndpointServicesListResult} for more + * information. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List what values of endpoint services are available for use. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * @param {object} [options] Optional Parameters. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * @returns {Promise} A promise is returned * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List what values of endpoint services are available for use. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -4022,7 +3706,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. + * @resolve {EndpointServicesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4030,26 +3714,38 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} for more + * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EndpointServicesListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { 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; +} + +/** + * @class + * ExpressRouteCircuitAuthorizations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuitAuthorizations { /** - * Gets all peerings in a specified express route circuit. + * Deletes the specified authorization from the specified express route + * circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * + * @param {string} authorizationName The name of the authorization. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4057,19 +3753,22 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all peerings in a specified express route circuit. + * Deletes the specified authorization from the specified express route + * circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * + * @param {string} authorizationName The name of the authorization. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4082,7 +3781,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeeringListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4090,27 +3789,25 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeeringListResult} for - * more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified peering from the specified express route circuit. + * Gets the specified authorization from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * - * @param {string} peeringName The name of the peering. + * @param {string} authorizationName The name of the authorization. * * @param {object} [options] Optional Parameters. * @@ -4119,20 +3816,20 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified peering from the specified express route circuit. + * Gets the specified authorization from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * - * @param {string} peeringName The name of the peering. + * @param {string} authorizationName The name of the authorization. * * @param {object} [options] Optional Parameters. * @@ -4146,7 +3843,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4154,155 +3851,129 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} 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. */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a peering in the specified express route circuits. + * Creates or updates an authorization in the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * - * @param {string} peeringName The name of the peering. + * @param {string} authorizationName The name of the authorization. * - * @param {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' * - * @param {number} [peeringParameters.azureASN] The Azure ASN. + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @param {number} [peeringParameters.peerASN] The peer ASN. + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {string} [authorizationParameters.id] Resource ID. * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. + * @param {object} [options] Optional Parameters. * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * @returns {Promise} A promise is returned * - * @param {string} [peeringParameters.sharedKey] The shared key. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [peeringParameters.vlanId] The VLAN ID. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an authorization in the specified express route circuit. * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. + * @param {string} authorizationName The name of the authorization. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @param {string} [authorizationParameters.id] Resource ID. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @param {object} [options] Optional Parameters. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * {Promise} A promise is returned. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more + * information. * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all authorizations in an express route circuit. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} circuitName The name of the circuit. * * @param {object} [options] Optional Parameters. * @@ -4311,150 +3982,186 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a peering in the specified express route circuits. + * Gets all authorizations in an express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} circuitName The name of the circuit. * - * @param {string} peeringName The name of the peering. + * @param {object} [options] Optional Parameters. * - * @param {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {number} [peeringParameters.azureASN] The Azure ASN. + * {Promise} A promise is returned. * - * @param {number} [peeringParameters.peerASN] The peer ASN. + * @resolve {AuthorizationListResult} - The deserialized result object. * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationListResult} for more + * information. * - * @param {string} [peeringParameters.sharedKey] The shared key. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [peeringParameters.vlanId] The VLAN ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified authorization from the specified express route + * circuit. * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [peeringParameters.stats] Gets peering stats. + * @param {string} circuitName The name of the express route circuit. * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. + * @param {string} authorizationName The name of the authorization. * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. + * @param {object} [options] Optional Parameters. * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. + * @returns {Promise} A promise is returned * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified authorization from the specified express route + * circuit. * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {string} authorizationName The name of the authorization. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * {Promise} A promise is returned. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @resolve {null} - The deserialized result object. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @reject {Error|ServiceError} - The error object. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an authorization in the specified express route circuit. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * @param {string} authorizationName The name of the authorization. * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the * resource. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} [authorizationParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} authorizationName The name of the authorization. + * + * @param {object} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. + * + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. + * + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' + * + * @param {string} [authorizationParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [authorizationParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [authorizationParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -4468,7 +4175,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. + * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4476,21 +4183,21 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} for more + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all peerings in a specified express route circuit. + * Gets all authorizations in an express route circuit. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4502,14 +4209,14 @@ export interface ExpressRouteCircuitPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all peerings in a specified express route circuit. + * Gets all authorizations in an express route circuit. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4526,7 +4233,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeeringListResult} - The deserialized result object. + * @resolve {AuthorizationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4534,31 +4241,30 @@ export interface ExpressRouteCircuitPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeeringListResult} for - * more information. + * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ExpressRouteCircuitConnections + * ExpressRouteCircuitPeerings * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface ExpressRouteCircuitConnections { +export interface ExpressRouteCircuitPeerings { /** - * Deletes the specified Express Route Circuit Connection from the specified - * express route circuit. + * Deletes the specified peering from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -4566,9 +4272,6 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4580,11 +4283,10 @@ export interface ExpressRouteCircuitConnections { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified Express Route Circuit Connection from the specified - * express route circuit. + * Deletes the specified peering from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -4592,9 +4294,6 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4621,14 +4320,13 @@ export interface ExpressRouteCircuitConnections { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified Express Route Circuit Connection from the specified - * express route circuit. + * Gets the specified peering for the express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -4636,9 +4334,6 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4646,15 +4341,14 @@ export interface ExpressRouteCircuitConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified Express Route Circuit Connection from the specified - * express route circuit. + * Gets the specified peering for the express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -4662,9 +4356,6 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4677,7 +4368,7 @@ export interface ExpressRouteCircuitConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. + * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4685,22 +4376,21 @@ export interface ExpressRouteCircuitConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} for more + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. + * Creates or updates a peering in the specified express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -4708,138 +4398,135 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. + * @param {number} [peeringParameters.azureASN] The Azure ASN. * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. + * @param {string} [peeringParameters.primaryAzurePort] The primary port. * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @returns {Promise} A promise is returned + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [peeringParameters.stats] Gets peering stats. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. * - * @param {string} circuitName The name of the express route circuit. + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. * - * @param {string} peeringName The name of the peering. + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @param {object} [options] Optional Parameters. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * {Promise} A promise is returned. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} for more - * information. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Express Route Circuit Connection from the specified - * express route circuit. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' * - * @param {string} circuitName The name of the express route circuit. + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. * - * @param {string} peeringName The name of the peering. + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -4848,15 +4535,14 @@ export interface ExpressRouteCircuitConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified Express Route Circuit Connection from the specified - * express route circuit. + * Creates or updates a peering in the specified express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -4864,136 +4550,135 @@ export interface ExpressRouteCircuitConnections { * * @param {string} peeringName The name of the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} [peeringParameters.azureASN] The Azure ASN. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * {Promise} A promise is returned. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @resolve {null} - The deserialized result object. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [peeringParameters.primaryAzurePort] The primary port. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. + * @param {object} [peeringParameters.stats] Gets peering stats. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. * - * @param {string} circuitName The name of the express route circuit. + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. * - * @param {string} peeringName The name of the peering. + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @param {object} [options] Optional Parameters. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * @returns {Promise} A promise is returned + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * @param {string} circuitName The name of the express route circuit. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. * - * @param {string} peeringName The name of the peering. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. * - * @param {string} connectionName The name of the express route circuit - * connection. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -5007,7 +4692,7 @@ export interface ExpressRouteCircuitConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. + * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5015,30 +4700,21 @@ export interface ExpressRouteCircuitConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} for more + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCircuits - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuits { + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified express route circuit. + * Gets all peerings in a specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5051,14 +4727,14 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified express route circuit. + * Gets all peerings in a specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5076,7 +4752,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCircuitPeeringListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5084,23 +4760,27 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeeringListResult} 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. */ - deleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about the specified express route circuit. + * Deletes the specified peering from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of express route circuit. + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -5109,18 +4789,20 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about the specified express route circuit. + * Deletes the specified peering from the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of express route circuit. + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -5134,7 +4816,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5142,160 +4824,307 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an express route circuit. + * Creates or updates a peering in the specified express route circuits. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} [parameters.sku] The SKU. + * @param {string} peeringName The name of the peering. * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {number} [peeringParameters.azureASN] The Azure ASN. * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {array} [parameters.authorizations] The list of authorizations. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {array} [parameters.peerings] The list of peerings. + * @param {string} [peeringParameters.primaryAzurePort] The primary port. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * @param {object} [peeringParameters.stats] Gets peering stats. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. * - * @param {string} [parameters.id] Resource ID. + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. * - * @param {string} [parameters.location] Resource location. + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. * - * @returns {Promise} A promise is returned + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an express route circuit. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @param {string} circuitName The name of the circuit. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * @param {object} [parameters.sku] The SKU. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. * - * @param {array} [parameters.authorizations] The list of authorizations. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. * - * @param {array} [parameters.peerings] The list of peerings. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * @param {string} [peeringParameters.id] Resource ID. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.id] Resource ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.location] Resource location. + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified express route circuits. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. + * + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. + * + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' + * + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {number} [peeringParameters.azureASN] The Azure ASN. + * + * @param {number} [peeringParameters.peerASN] The peer ASN. + * + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. + * + * @param {string} [peeringParameters.primaryAzurePort] The primary port. + * + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. + * + * @param {string} [peeringParameters.sharedKey] The shared key. + * + * @param {number} [peeringParameters.vlanId] The VLAN ID. + * + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. + * + * @param {object} [peeringParameters.stats] Gets peering stats. + * + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. + * + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. + * + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. + * + * @param {string} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. + * + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. + * + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. + * + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -5309,7 +5138,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5317,29 +5146,24 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} for more information. + * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeering} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. + * Gets all peerings in a specified express route circuit. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5348,23 +5172,17 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. + * Gets all peerings in a specified express route circuit. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5378,7 +5196,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {ExpressRouteCircuitPeeringListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5386,21 +5204,31 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} for more information. + * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitPeeringListResult} 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. */ - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { 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; +} + +/** + * @class + * ExpressRouteCircuitConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuitConnections { /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5408,7 +5236,8 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. * * @param {object} [options] Optional Parameters. * @@ -5417,15 +5246,15 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5433,7 +5262,8 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. * * @param {object} [options] Optional Parameters. * @@ -5447,7 +5277,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5455,22 +5285,20 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} for - * more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5478,7 +5306,8 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. * * @param {object} [options] Optional Parameters. * @@ -5487,15 +5316,15 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. + * Gets the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * @@ -5503,7 +5332,8 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. * * @param {object} [options] Optional Parameters. * @@ -5517,7 +5347,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5525,22 +5355,22 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * for more information. + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} 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. */ - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -5548,7 +5378,37 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -5557,15 +5417,15 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -5573,7 +5433,37 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device. + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -5587,7 +5477,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableSummaryListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5595,27 +5485,32 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCircuitsRoutesTableSummaryListResult} for - * more information. + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} 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. */ - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the stats from an express route circuit in a resource group. + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5623,19 +5518,25 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the stats from an express route circuit in a resource group. + * Deletes the specified Express Route Circuit Connection from the specified + * express route circuit. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} circuitName The name of the express route circuit. * + * @param {string} peeringName The name of the peering. + * + * @param {string} connectionName The name of the express route circuit + * connection. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5648,7 +5549,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitStats} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5656,21 +5557,20 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitStats} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getStats(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStats(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - getStats(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all stats from an express route circuit in a resource group. + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -5678,6 +5578,38 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5685,14 +5617,15 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getPeeringStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all stats from an express route circuit in a resource group. + * Creates or updates a Express Route Circuit Connection in the specified + * express route circuits. * * @param {string} resourceGroupName The name of the resource group. * @@ -5700,6 +5633,38 @@ export interface ExpressRouteCircuits { * * @param {string} peeringName The name of the peering. * + * @param {string} connectionName The name of the express route circuit + * connection. + * + * @param {object} expressRouteCircuitConnectionParameters Parameters supplied + * to the create or update express route circuit circuit connection operation. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the circuit + * initiating connection. + * + * @param {object} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] + * Reference to Express Route Circuit Private Peering Resource of the peered + * circuit. + * + * @param {string} + * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] + * Resource ID. + * + * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 + * IP address space to carve out Customer addresses for tunnels. + * + * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] + * The authorization key. + * + * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of + * the resource that is unique within a resource group. This name can be used + * to access the resource. + * + * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5712,7 +5677,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitStats} - The deserialized result object. + * @resolve {ExpressRouteCircuitConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5720,24 +5685,35 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitStats} for more + * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitConnection} 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. */ - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteCircuits + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCircuits { /** - * Gets all the express route circuits in a resource group. + * Deletes the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} circuitName The name of the express route circuit. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5745,68 +5721,18 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a resource group. + * Deletes the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ExpressRouteCircuitListResult} - 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. - * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the express route circuits in a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the express route circuits in a subscription. + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -5820,7 +5746,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5828,25 +5754,23 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified express route circuit. + * Gets information about the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} circuitName The name of express route circuit. * * @param {object} [options] Optional Parameters. * @@ -5855,18 +5779,18 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified express route circuit. + * Gets information about the specified express route circuit. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} circuitName The name of express route circuit. * * @param {object} [options] Optional Parameters. * @@ -5880,7 +5804,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCircuit} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5888,15 +5812,16 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} 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. */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5975,7 +5900,7 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates or updates an express route circuit. @@ -6069,9 +5994,9 @@ export interface ExpressRouteCircuits { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6097,7 +6022,7 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates an express route circuit tags. @@ -6138,9 +6063,9 @@ export interface ExpressRouteCircuits { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6166,7 +6091,7 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - beginListArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the currently advertised ARP table associated with the express route @@ -6208,9 +6133,9 @@ export interface ExpressRouteCircuits { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6236,7 +6161,7 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the currently advertised routes table associated with the express route @@ -6278,9 +6203,9 @@ export interface ExpressRouteCircuits { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6306,7 +6231,7 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the currently advertised routes table summary associated with the @@ -6349,16 +6274,17 @@ export interface ExpressRouteCircuits { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the express route circuits in a resource group. + * Gets all the stats from an express route circuit in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -6367,17 +6293,18 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a resource group. + * Gets all the stats from an express route circuit in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -6391,7 +6318,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitStats} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6399,24 +6326,27 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} for more + * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitStats} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getStats(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStats(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + getStats(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the express route circuits in a subscription. + * Gets all stats from an express route circuit in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -6425,17 +6355,20 @@ export interface ExpressRouteCircuits { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getPeeringStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a subscription. + * Gets all stats from an express route circuit in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -6449,7 +6382,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitStats} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6457,30 +6390,23 @@ export interface ExpressRouteCircuits { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} for more + * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitStats} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteServiceProviders - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteServiceProviders { + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; + getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the available express route service providers. + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -6489,14 +6415,16 @@ export interface ExpressRouteServiceProviders { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available express route service providers. + * Gets all the express route circuits in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -6510,7 +6438,7 @@ export interface ExpressRouteServiceProviders { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6518,24 +6446,21 @@ export interface ExpressRouteServiceProviders { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteServiceProviderListResult} for - * more information. + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the available express route service providers. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all the express route circuits in a subscription. * * @param {object} [options] Optional Parameters. * @@ -6544,17 +6469,14 @@ export interface ExpressRouteServiceProviders { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available express route service providers. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all the express route circuits in a subscription. * * @param {object} [options] Optional Parameters. * @@ -6568,7 +6490,7 @@ export interface ExpressRouteServiceProviders { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6576,30 +6498,25 @@ export interface ExpressRouteServiceProviders { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteServiceProviderListResult} for - * more information. + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCrossConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCrossConnections { + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -6608,14 +6525,18 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. + * Deletes the specified express route circuit. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -6629,7 +6550,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6637,24 +6558,82 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} for - * more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. + * Creates or updates an express route circuit. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6662,17 +6641,77 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. + * Creates or updates an express route circuit. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to the create or update + * express route circuit operation. + * + * @param {object} [parameters.sku] The SKU. + * + * @param {string} [parameters.sku.name] The name of the SKU. + * + * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values + * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * + * @param {string} [parameters.sku.family] The family of the SKU. Possible + * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: + * 'UnlimitedData', 'MeteredData' + * + * @param {boolean} [parameters.allowClassicOperations] Allow classic + * operations + * + * @param {string} [parameters.circuitProvisioningState] The + * CircuitProvisioningState state of the resource. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * ServiceProviderProvisioningState state of the resource. Possible values are + * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {array} [parameters.authorizations] The list of authorizations. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.serviceKey] The ServiceKey. + * + * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * + * @param {object} [parameters.serviceProviderProperties] The + * ServiceProviderProperties. + * + * @param {string} [parameters.serviceProviderProperties.serviceProviderName] + * The serviceProviderName. + * + * @param {string} [parameters.serviceProviderProperties.peeringLocation] The + * peering location. + * + * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The + * BandwidthInMbps. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6685,7 +6724,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuit} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6693,27 +6732,29 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} for - * more information. + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets details about the specified ExpressRouteCrossConnection. + * Updates an express route circuit tags. * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6722,20 +6763,23 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets details about the specified ExpressRouteCrossConnection. + * Updates an express route circuit tags. * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). + * @param {string} circuitName The name of the circuit. + * + * @param {object} parameters Parameters supplied to update express route + * circuit tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6749,7 +6793,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnection} - The deserialized result object. + * @resolve {ExpressRouteCircuit} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6757,46 +6801,29 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} for more - * information. + * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuit} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Update the specified ExpressRouteCrossConnection. + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} circuitName The name of the express route circuit. * - * @param {string} [parameters.location] Resource location. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6805,39 +6832,23 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the specified ExpressRouteCrossConnection. + * Gets the currently advertised ARP table associated with the express route + * circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} circuitName The name of the express route circuit. * - * @param {string} [parameters.location] Resource location. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6851,7 +6862,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnection} - The deserialized result object. + * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6859,30 +6870,30 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} for more - * information. + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an express route cross connection tags. + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the cross connection. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. + * @param {string} peeringName The name of the peering. * - * @param {object} [crossConnectionParameters.tags] Resource tags. + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6891,23 +6902,23 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an express route cross connection tags. + * Gets the currently advertised routes table associated with the express route + * circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the cross connection. + * @param {string} circuitName The name of the express route circuit. * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. + * @param {string} peeringName The name of the peering. * - * @param {object} [crossConnectionParameters.tags] Resource tags. + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6921,7 +6932,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnection} - The deserialized result object. + * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6929,31 +6940,30 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} for more - * information. + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * 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. */ - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. + * @param {string} circuitName The name of the express route circuit. * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6962,24 +6972,23 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. + * Gets the currently advertised routes table summary associated with the + * express route circuit in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. + * @param {string} circuitName The name of the express route circuit. * * @param {string} peeringName The name of the peering. * - * @param {string} devicePath The path of the device + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -6993,7 +7002,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitsRoutesTableSummaryListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7001,31 +7010,25 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} for + * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. */ - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. + * Gets all the express route circuits in a resource group. * - * @param {string} devicePath The path of the device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7034,24 +7037,17 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. + * Gets all the express route circuits in a resource group. * - * @param {string} devicePath The path of the device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7065,7 +7061,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7073,32 +7069,24 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * for more information. + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} 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. */ - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { 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; /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. + * Gets all the express route circuits in a subscription. * - * @param {string} devicePath The path of the device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7107,24 +7095,17 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. + * Gets all the express route circuits in a subscription. * - * @param {string} devicePath The path of the device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7138,7 +7119,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. + * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7146,46 +7127,30 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * for more information. + * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitListResult} 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. */ - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExpressRouteServiceProviders + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteServiceProviders { /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * Gets all the available express route service providers. * * @param {object} [options] Optional Parameters. * @@ -7194,53 +7159,28 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the specified ExpressRouteCrossConnection. + * Gets all the available express route service providers. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [options] Optional Parameters. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @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 {ExpressRouteCrossConnection} - The deserialized result object. + * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7248,30 +7188,24 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} for more - * information. + * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteServiceProviderListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. + * Gets all the available express route service providers. * - * @param {object} [crossConnectionParameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7280,23 +7214,17 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. + * Gets all the available express route service providers. * - * @param {object} [crossConnectionParameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7310,7 +7238,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnection} - The deserialized result object. + * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7318,31 +7246,30 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} for more - * information. + * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteServiceProviderListResult} 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. */ - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { 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; +} + +/** + * @class + * ExpressRouteCrossConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ExpressRouteCrossConnections { /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device + * Retrieves all the ExpressRouteCrossConnections in a subscription. * * @param {object} [options] Optional Parameters. * @@ -7351,24 +7278,14 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device + * Retrieves all the ExpressRouteCrossConnections in a subscription. * * @param {object} [options] Optional Parameters. * @@ -7382,7 +7299,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7390,32 +7307,24 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} for + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} 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. */ - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. + * Retrieves all the ExpressRouteCrossConnections in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7423,25 +7332,17 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. + * Retrieves all the ExpressRouteCrossConnections in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7454,7 +7355,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7462,32 +7363,27 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * for more information. + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} 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. */ - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. + * Gets details about the specified ExpressRouteCrossConnection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). * * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. + * ExpressRouteCrossConnection (service key of the circuit). * * @param {object} [options] Optional Parameters. * @@ -7496,24 +7392,20 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. + * Gets details about the specified ExpressRouteCrossConnection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group (peering + * location of the circuit). * * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. + * ExpressRouteCrossConnection (service key of the circuit). * * @param {object} [options] Optional Parameters. * @@ -7527,7 +7419,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7535,24 +7427,56 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * for more information. + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} 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. */ - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. + * Update the specified ExpressRouteCrossConnection. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7561,22 +7485,54 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. + * Update the specified ExpressRouteCrossConnection. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. + * + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. + * + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. + * + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit + * + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. + * + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' + * + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. + * + * @param {array} [parameters.peerings] The list of peerings. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * * @param {ServiceCallback} [optionalCallback] - The optional callback. * @@ -7585,7 +7541,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7593,24 +7549,30 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} for - * more information. + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. + * Updates an express route cross connection tags. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7619,17 +7581,23 @@ export interface ExpressRouteCrossConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. + * Updates an express route cross connection tags. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the cross connection. + * + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. + * + * @param {object} [crossConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7643,7 +7611,7 @@ export interface ExpressRouteCrossConnections { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7651,36 +7619,32 @@ export interface ExpressRouteCrossConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} for - * more information. + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCrossConnectionPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCrossConnectionPeerings { + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all peerings in a specified ExpressRouteCrossConnection. + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} crossConnectionName The name of the * ExpressRouteCrossConnection. * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7688,20 +7652,25 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all peerings in a specified ExpressRouteCrossConnection. + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} crossConnectionName The name of the * ExpressRouteCrossConnection. * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7714,7 +7683,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionPeeringList} - The deserialized result object. + * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7722,21 +7691,22 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeeringList} for + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} for * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified peering from the ExpressRouteCrossConnection. + * Gets the route table summary associated with the express route cross + * connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -7745,6 +7715,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7752,14 +7724,15 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified peering from the ExpressRouteCrossConnection. + * Gets the route table summary associated with the express route cross + * connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -7768,6 +7741,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7780,7 +7755,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7788,19 +7763,23 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * 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. */ - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified peering for the ExpressRouteCrossConnection. + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -7809,6 +7788,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7816,14 +7797,15 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified peering for the ExpressRouteCrossConnection. + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -7832,6 +7814,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7844,7 +7828,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. + * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7852,245 +7836,249 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} for more - * information. + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * Update the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} crossConnectionName The name of the * ExpressRouteCrossConnection. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit * - * @param {number} [peeringParameters.peerASN] The peer ASN. + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. * - * @param {string} [peeringParameters.sharedKey] The shared key. + * @param {array} [parameters.peerings] The list of peerings. * - * @param {number} [peeringParameters.vlanId] The VLAN ID. + * @param {string} [parameters.id] Resource ID. * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. + * @param {string} [parameters.location] Resource location. * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * @param {object} [parameters.tags] Resource tags. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @returns {Promise} A promise is returned * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the specified ExpressRouteCrossConnection. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @param {object} parameters Parameters supplied to the update express route + * crossConnection operation. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * @param {string} [parameters.peeringLocation] The peering location of the + * ExpressRoute circuit. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express + * Route Circuit Id. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @param {string} [parameters.serviceProviderProvisioningState] The + * provisioning state of the circuit in the connectivity provider system. + * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning' * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * @param {string} [parameters.serviceProviderNotes] Additional read only notes + * set by the connectivity provider. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * @param {array} [parameters.peerings] The list of peerings. * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * @param {string} [parameters.id] Resource ID. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @param {string} [parameters.location] Resource location. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @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 {ExpressRouteCrossConnection} - 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. + * + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * Updates an express route cross connection tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. + * @param {string} crossConnectionName The name of the cross connection. * - * @param {string} peeringName The name of the peering. + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. + * @param {object} [crossConnectionParameters.tags] Resource tags. * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' + * @param {object} [options] Optional Parameters. * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [peeringParameters.peerASN] The peer ASN. + * @returns {Promise} A promise is returned * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an express route cross connection tags. * - * @param {string} [peeringParameters.sharedKey] The shared key. + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} [peeringParameters.vlanId] The VLAN ID. + * @param {string} crossConnectionName The name of the cross connection. * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. + * @param {object} crossConnectionParameters Parameters supplied to update + * express route cross connection tags. * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * @param {object} [crossConnectionParameters.tags] Resource tags. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * {Promise} A promise is returned. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @resolve {ExpressRouteCrossConnection} - The deserialized result object. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @reject {Error|ServiceError} - The error object. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnection} for more + * information. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * @param {string} peeringName The name of the peering. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * @param {string} devicePath The path of the device * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * @param {object} [options] Optional Parameters. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [peeringParameters.id] Resource ID. + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginListArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the currently advertised ARP table associated with the express route + * cross connection in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. + * + * @param {string} devicePath The path of the device * * @param {object} [options] Optional Parameters. * @@ -8104,7 +8092,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. + * @resolve {ExpressRouteCircuitsArpTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8112,21 +8100,22 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} for more - * information. + * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsArpTableListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified peering from the ExpressRouteCrossConnection. + * Gets the route table summary associated with the express route cross + * connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -8135,6 +8124,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8142,14 +8133,15 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified peering from the ExpressRouteCrossConnection. + * Gets the route table summary associated with the express route cross + * connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -8158,6 +8150,8 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * + * @param {string} devicePath The path of the device. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8170,7 +8164,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8178,19 +8172,23 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} + * 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. */ - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -8199,102 +8197,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} devicePath The path of the device. * * @param {object} [options] Optional Parameters. * @@ -8303,14 +8206,15 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * Gets the currently advertised routes table associated with the express route + * cross connection in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -8319,102 +8223,65 @@ export interface ExpressRouteCrossConnectionPeerings { * * @param {string} peeringName The name of the peering. * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. + * @param {string} devicePath The path of the device. * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * {Promise} A promise is returned. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' + * @reject {Error|ServiceError} - The error object. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitsRoutesTableListResult} + * for more information. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; + beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * @returns {Promise} A promise is returned * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. * - * @param {string} [peeringParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8428,7 +8295,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8436,21 +8303,21 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} for more - * information. + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { 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; /** - * Gets all peerings in a specified ExpressRouteCrossConnection. + * Retrieves all the ExpressRouteCrossConnections in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8462,14 +8329,14 @@ export interface ExpressRouteCrossConnectionPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all peerings in a specified ExpressRouteCrossConnection. + * Retrieves all the ExpressRouteCrossConnections in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8486,7 +8353,7 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCrossConnectionPeeringList} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8494,34 +8361,35 @@ export interface ExpressRouteCrossConnectionPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeeringList} for + * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionListResult} for * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * LoadBalancers + * ExpressRouteCrossConnectionPeerings * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface LoadBalancers { +export interface ExpressRouteCrossConnectionPeerings { /** - * Deletes the specified load balancer. + * Gets all peerings in a specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * * @param {object} [options] Optional Parameters. * @@ -8530,18 +8398,19 @@ export interface LoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer. + * Gets all peerings in a specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * * @param {object} [options] Optional Parameters. * @@ -8555,7 +8424,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeeringList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8563,49 +8432,53 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeeringList} 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. */ - deleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified load balancer. + * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [options] Optional Parameters. + * @param {string} peeringName The name of the peering. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified load balancer. + * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [options] Optional Parameters. + * @param {string} peeringName The name of the peering. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8617,7 +8490,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8625,79 +8498,26 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a load balancer. + * Gets the specified peering for the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundNatRules] The outbound NAT rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -8706,73 +8526,21 @@ export interface LoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer. + * Gets the specified peering for the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundNatRules] The outbound NAT rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -8786,7 +8554,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8794,87 +8562,128 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} for more information. + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a load balancer tags. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} peeringName The name of the peering. * - * @param {object} [options] Optional Parameters. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @returns {Promise} A promise is returned + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @reject {Error|ServiceError} - The error object. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a load balancer tags. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {object} parameters Parameters supplied to update load balancer tags. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * {Promise} A promise is returned. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @resolve {LoadBalancer} - The deserialized result object. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @reject {Error|ServiceError} - The error object. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} for more information. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a subscription. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -8883,70 +8692,121 @@ export interface LoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a subscription. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} peeringName The name of the peering. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. * - * {Promise} A promise is returned. + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @reject {Error|ServiceError} - The error object. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} for more - * information. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a resource group. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @returns {Promise} A promise is returned + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancers in a resource group. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -8960,7 +8820,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8968,25 +8828,28 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} for more + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified load balancer. + * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -8999,14 +8862,17 @@ export interface LoadBalancers { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer. + * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. + * + * @param {string} peeringName The name of the peering. * * @param {object} [options] Optional Parameters. * @@ -9034,72 +8900,120 @@ export interface LoadBalancers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a load balancer. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.sku] The load balancer SKU. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {string} [parameters.id] Resource ID. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [parameters.location] Resource location. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -9108,73 +9022,121 @@ export interface LoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.sku] The load balancer SKU. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection peering operation. * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {string} [parameters.id] Resource ID. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [parameters.location] Resource location. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. + * + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. + * + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. + * + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. + * + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. + * + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. + * + * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of + * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} [peeringParameters.name] Gets name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -9188,7 +9150,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9196,52 +9158,43 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} for more information. + * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeering} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a load balancer tags. + * Gets all peerings in a specified ExpressRouteCrossConnection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} [options] Optional Parameters. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. + * Gets all peerings in a specified ExpressRouteCrossConnection. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9255,7 +9208,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeeringList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9263,23 +9216,34 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} for more information. + * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCrossConnectionPeeringList} 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. */ - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { 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; +} + +/** + * @class + * LoadBalancers + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancers { /** - * Gets all the load balancers in a subscription. + * Deletes the specified load balancer. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -9288,17 +9252,18 @@ export interface LoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a subscription. + * Deletes the specified load balancer. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -9312,7 +9277,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9320,46 +9285,50 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancers in a resource group. + * Gets the specified load balancer. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a resource group. + * Gets the specified load balancer. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9370,7 +9339,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9378,35 +9347,80 @@ export interface LoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} for more - * information. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LoadBalancerBackendAddressPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerBackendAddressPools { + get(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancer backed address pools. + * Creates or updates a load balancer. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9414,19 +9428,74 @@ export interface LoadBalancerBackendAddressPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer backed address pools. + * Creates or updates a load balancer. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. + * + * @param {object} [parameters.sku] The load balancer SKU. + * + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' + * + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer + * + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer + * + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning + * + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer + * + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. + * + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. + * + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9439,7 +9508,7 @@ export interface LoadBalancerBackendAddressPools { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9447,27 +9516,28 @@ export interface LoadBalancerBackendAddressPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerBackendAddressPoolListResult} - * for more information. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets load balancer backend address pool. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} backendAddressPoolName The name of the backend address pool. + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9476,20 +9546,22 @@ export interface LoadBalancerBackendAddressPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets load balancer backend address pool. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} backendAddressPoolName The name of the backend address pool. + * @param {object} parameters Parameters supplied to update load balancer tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9503,7 +9575,7 @@ export interface LoadBalancerBackendAddressPools { * * {Promise} A promise is returned. * - * @resolve {BackendAddressPool} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9511,23 +9583,20 @@ export interface LoadBalancerBackendAddressPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackendAddressPool} [result] - The deserialized result object if an error did not occur. - * See {@link BackendAddressPool} for more information. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancer backed address pools. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all the load balancers in a subscription. * * @param {object} [options] Optional Parameters. * @@ -9536,17 +9605,14 @@ export interface LoadBalancerBackendAddressPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer backed address pools. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets all the load balancers in a subscription. * * @param {object} [options] Optional Parameters. * @@ -9560,7 +9626,7 @@ export interface LoadBalancerBackendAddressPools { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9568,35 +9634,24 @@ export interface LoadBalancerBackendAddressPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerBackendAddressPoolListResult} - * for more information. + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LoadBalancerFrontendIPConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerFrontendIPConfigurations { + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancer frontend IP configurations. + * Gets all the load balancers in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9604,19 +9659,17 @@ export interface LoadBalancerFrontendIPConfigurations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer frontend IP configurations. + * Gets all the load balancers in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9629,7 +9682,7 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9637,30 +9690,26 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * LoadBalancerFrontendIPConfigurationListResult} for more + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets load balancer frontend IP configuration. + * Deletes the specified load balancer. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9668,22 +9717,19 @@ export interface LoadBalancerFrontendIPConfigurations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets load balancer frontend IP configuration. + * Deletes the specified load balancer. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9696,7 +9742,7 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {FrontendIPConfiguration} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9704,93 +9750,78 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FrontendIPConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link FrontendIPConfiguration} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancer frontend IP configurations. - * - * @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 + * Creates or updates a load balancer. * - * @returns {Promise} A promise is returned + * @param {string} resourceGroupName The name of the resource group. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} loadBalancerName The name of the load balancer. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancer frontend IP configurations. + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {object} [parameters.sku] The load balancer SKU. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning * - * {Promise} A promise is returned. + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer * - * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. * - * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * LoadBalancerFrontendIPConfigurationListResult} for more - * information. + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * InboundNatRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface InboundNatRules { - - - /** - * Gets all the inbound nat rules in a load balancer. + * @param {string} [parameters.id] Resource ID. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.location] Resource location. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9799,82 +9830,73 @@ export interface InboundNatRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the inbound nat rules in a load balancer. + * Creates or updates a load balancer. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.sku] The load balancer SKU. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' * - * {Promise} A promise is returned. + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer * - * @resolve {InboundNatRuleListResult} - The deserialized result object. + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules + * used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with + * individual virtual machines cannot reference an Inbound NAT pool. They have + * to reference individual inbound NAT rules. * - * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRuleListResult} for more - * information. + * @param {array} [parameters.inboundNatPools] Defines an external port range + * for inbound NAT to a single backend port on NICs associated with a load + * balancer. Inbound NAT rules are created automatically for each NIC + * associated with the Load Balancer using an external port from this range. + * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + * with defining inbound Nat rules. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual virtual + * machines cannot reference an inbound NAT pool. They have to reference + * individual inbound NAT rules. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified load balancer inbound nat rule. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.id] Resource ID. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} [parameters.location] Resource location. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9888,7 +9910,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9896,53 +9918,54 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} 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. */ - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified load balancer inbound nat rule. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. + * @param {object} parameters Parameters supplied to update load balancer tags. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified load balancer inbound nat rule. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. + * @param {object} parameters Parameters supplied to update load balancer tags. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9954,7 +9977,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9962,69 +9985,23 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} for more information. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. + * Gets all the load balancers in a subscription. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10033,63 +10010,17 @@ export interface InboundNatRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. + * Gets all the load balancers in a subscription. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10103,7 +10034,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10111,26 +10042,24 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} for more information. + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. + * Gets all the load balancers in a resource group. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10139,20 +10068,17 @@ export interface InboundNatRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. + * Gets all the load balancers in a resource group. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10166,7 +10092,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10174,133 +10100,118 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerListResult} 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. */ - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { 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; +} + +/** + * @class + * LoadBalancerBackendAddressPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerBackendAddressPools { /** - * Creates or updates a load balancer inbound nat rule. + * Gets all the load balancer backed address pools. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. + * @returns {Promise} A promise is returned * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the load balancer backed address pools. * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. + * @param {object} [options] Optional Parameters. * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * {Promise} A promise is returned. * - * @param {object} [options] Optional Parameters. + * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @reject {Error|ServiceError} - The error object. * - * @returns {Promise} A promise is returned + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @resolve {HttpOperationResponse} - The deserialized result object. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @reject {Error|ServiceError} - The error object. + * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerBackendAddressPoolListResult} + * 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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates or updates a load balancer inbound nat rule. + * Gets load balancer backend address pool. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' + * @param {string} backendAddressPoolName The name of the backend address pool. * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. + * @param {object} [options] Optional Parameters. * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. + * @returns {Promise} A promise is returned * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets load balancer backend address pool. * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * @param {string} backendAddressPoolName The name of the backend address pool. * * @param {object} [options] Optional Parameters. * @@ -10314,7 +10225,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {BackendAddressPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10322,20 +10233,20 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} for more information. + * {BackendAddressPool} [result] - The deserialized result object if an error did not occur. + * See {@link BackendAddressPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the inbound nat rules in a load balancer. + * Gets all the load balancer backed address pools. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10347,14 +10258,14 @@ export interface InboundNatRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the inbound nat rules in a load balancer. + * Gets all the load balancer backed address pools. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10371,7 +10282,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRuleListResult} - The deserialized result object. + * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10379,30 +10290,30 @@ export interface InboundNatRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRuleListResult} for more - * information. + * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerBackendAddressPoolListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * LoadBalancerLoadBalancingRules + * LoadBalancerFrontendIPConfigurations * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface LoadBalancerLoadBalancingRules { +export interface LoadBalancerFrontendIPConfigurations { /** - * Gets all the load balancing rules in a load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} resourceGroupName The name of the resource group. * @@ -10415,14 +10326,14 @@ export interface LoadBalancerLoadBalancingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancing rules in a load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} resourceGroupName The name of the resource group. * @@ -10440,7 +10351,7 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. + * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10448,27 +10359,29 @@ export interface LoadBalancerLoadBalancingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerLoadBalancingRuleListResult} for - * more information. + * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified load balancer load balancing rule. + * Gets load balancer frontend IP configuration. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} loadBalancingRuleName The name of the load balancing rule. + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. * * @param {object} [options] Optional Parameters. * @@ -10477,20 +10390,21 @@ export interface LoadBalancerLoadBalancingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified load balancer load balancing rule. + * Gets load balancer frontend IP configuration. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} loadBalancingRuleName The name of the load balancing rule. + * @param {string} frontendIPConfigurationName The name of the frontend IP + * configuration. * * @param {object} [options] Optional Parameters. * @@ -10504,7 +10418,7 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancingRule} - The deserialized result object. + * @resolve {FrontendIPConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10512,20 +10426,21 @@ export interface LoadBalancerLoadBalancingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancingRule} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancingRule} for more information. + * {FrontendIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendIPConfiguration} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancing rules in a load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10537,14 +10452,14 @@ export interface LoadBalancerLoadBalancingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancing rules in a load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10561,7 +10476,7 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. + * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10569,30 +10484,31 @@ export interface LoadBalancerLoadBalancingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerLoadBalancingRuleListResult} for - * more information. + * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * LoadBalancerFrontendIPConfigurationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * LoadBalancerNetworkInterfaces + * InboundNatRules * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface LoadBalancerNetworkInterfaces { +export interface InboundNatRules { /** - * Gets associated load balancer network interfaces. + * Gets all the inbound nat rules in a load balancer. * * @param {string} resourceGroupName The name of the resource group. * @@ -10605,14 +10521,14 @@ export interface LoadBalancerNetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets associated load balancer network interfaces. + * Gets all the inbound nat rules in a load balancer. * * @param {string} resourceGroupName The name of the resource group. * @@ -10630,7 +10546,7 @@ export interface LoadBalancerNetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {InboundNatRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10638,24 +10554,27 @@ export interface LoadBalancerNetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more + * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRuleListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Gets associated load balancer network interfaces. + * Deletes the specified load balancer inbound nat rule. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -10664,17 +10583,20 @@ export interface LoadBalancerNetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets associated load balancer network interfaces. + * Deletes the specified load balancer inbound nat rule. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -10688,7 +10610,7 @@ export interface LoadBalancerNetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10696,57 +10618,54 @@ export interface LoadBalancerNetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LoadBalancerProbes - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerProbes { + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the load balancer probes. + * Gets the specified load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer probes. + * Gets the specified load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * + * @param {string} inboundNatRuleName The name of the inbound nat rule. + * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10757,7 +10676,7 @@ export interface LoadBalancerProbes { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerProbeListResult} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10765,106 +10684,134 @@ export interface LoadBalancerProbes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerProbeListResult} for more - * information. + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets load balancer probe. + * Creates or updates a load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} probeName The name of the probe. + * @param {string} inboundNatRuleName The name of the inbound nat rule. * - * @param {object} [options] Optional Parameters. + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. * - * @returns {Promise} A promise is returned + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets load balancer probe. + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. * - * @param {string} probeName The name of the probe. + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @returns {Promise} A promise is returned * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {Promise} A promise is returned. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a load balancer inbound nat rule. * - * @resolve {Probe} - The deserialized result object. + * @param {string} resourceGroupName The name of the resource group. * - * @reject {Error|ServiceError} - The error object. + * @param {string} loadBalancerName The name of the load balancer. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} inboundNatRuleName The name of the inbound nat rule. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. * - * {Probe} [result] - The deserialized result object if an error did not occur. - * See {@link Probe} for more information. + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, probeName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, probeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancer probes. + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. * - * @param {object} [options] Optional Parameters. + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. * - * @returns {Promise} A promise is returned + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancer probes. + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -10878,7 +10825,7 @@ export interface LoadBalancerProbes { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerProbeListResult} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10886,34 +10833,26 @@ export interface LoadBalancerProbes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerProbeListResult} for more - * information. + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkInterfaces - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaces { + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network interface. + * Deletes the specified load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -10926,14 +10865,16 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network interface. + * Deletes the specified load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -10961,43 +10902,129 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about the specified network interface. + * Creates or updates a load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {object} [options] Optional Parameters. + * @param {string} inboundNatRuleName The name of the inbound nat rule. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about the specified network interface. + * Creates or updates a load balancer inbound nat rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {object} [options] Optional Parameters. + * @param {string} inboundNatRuleName The name of the inbound nat rule. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. + * + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. + * + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. + * + * @param {string} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' + * + * @param {number} [inboundNatRuleParameters.frontendPort] The port for the + * external endpoint. Port numbers for each rule must be unique within the Load + * Balancer. Acceptable values range from 1 to 65534. + * + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. + * + * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout + * for the TCP idle connection. The value can be set between 4 and 30 minutes. + * The default value is 4 minutes. This element is only used when the protocol + * is set to TCP. + * + * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a + * virtual machine's endpoint for the floating IP capability required to + * configure a SQL AlwaysOn Availability Group. This setting is required when + * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't + * be changed after you create the endpoint. + * + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [inboundNatRuleParameters.name] Gets name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. + * + * @param {string} [inboundNatRuleParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11009,7 +11036,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11017,115 +11044,91 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} for more information. + * {InboundNatRule} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.virtualMachine] The reference of a virtual - * machine. - * - * @param {string} [parameters.virtualMachine.id] Resource ID. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * Gets all the inbound nat rules in a load balancer. * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the inbound nat rules in a load balancer. * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. + * {Promise} A promise is returned. * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. + * @resolve {InboundNatRuleListResult} - The deserialized result object. * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InboundNatRuleListResult} for more + * information. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.id] Resource ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancerLoadBalancingRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerLoadBalancingRules { + + + /** + * Gets all the load balancing rules in a load balancer. * - * @param {string} [parameters.location] Resource location. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -11134,109 +11137,82 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network interface. + * Gets all the load balancing rules in a load balancer. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.virtualMachine] The reference of a virtual - * machine. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.virtualMachine.id] Resource ID. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. + * {Promise} A promise is returned. * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. + * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerLoadBalancingRuleListResult} for + * more information. * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified load balancer load balancing rule. * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. + * @param {string} loadBalancingRuleName The name of the load balancing rule. * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified load balancer load balancing rule. * - * @param {string} [parameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.location] Resource location. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} loadBalancingRuleName The name of the load balancing rule. * * @param {object} [options] Optional Parameters. * @@ -11250,7 +11226,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {LoadBalancingRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11258,29 +11234,23 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} for more information. + * {LoadBalancingRule} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. + * Gets all the load balancing rules in a load balancer. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11289,23 +11259,17 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. + * Gets all the load balancing rules in a load balancer. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11319,7 +11283,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11327,20 +11291,34 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} for more information. + * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerLoadBalancingRuleListResult} 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. */ - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { 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; +} + +/** + * @class + * LoadBalancerNetworkInterfaces + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerNetworkInterfaces { /** - * Gets all network interfaces in a subscription. + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -11353,10 +11331,14 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a subscription. + * Gets associated load balancer network interfaces. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -11386,15 +11368,16 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network interfaces in a resource group. + * Gets associated load balancer network interfaces. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11407,12 +11390,13 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a resource group. + * Gets associated load balancer network interfaces. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11442,17 +11426,26 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { 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; +} + +/** + * @class + * LoadBalancerProbes + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface LoadBalancerProbes { /** - * Gets all route tables applied to a network interface. + * Gets all the load balancer probes. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -11461,18 +11454,18 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables applied to a network interface. + * Gets all the load balancer probes. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -11486,7 +11479,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveRouteListResult} - The deserialized result object. + * @resolve {LoadBalancerProbeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11494,25 +11487,27 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveRouteListResult} for more + * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerProbeListResult} 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. */ - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network security groups applied to a network interface. + * Gets load balancer probe. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. * * @param {object} [options] Optional Parameters. * @@ -11521,18 +11516,20 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups applied to a network interface. + * Gets load balancer probe. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} loadBalancerName The name of the load balancer. + * + * @param {string} probeName The name of the probe. * * @param {object} [options] Optional Parameters. * @@ -11546,7 +11543,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {Probe} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11554,29 +11551,23 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveNetworkSecurityGroupListResult} for - * more information. + * {Probe} [result] - The deserialized result object if an error did not occur. + * See {@link Probe} 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. */ - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, loadBalancerName: string, probeName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, loadBalancerName: string, probeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * Gets all the load balancer probes. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11585,22 +11576,17 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * Gets all the load balancer probes. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11614,7 +11600,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {LoadBalancerProbeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11622,26 +11608,34 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more + * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancerProbeListResult} 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. */ - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options: { 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; +} + +/** + * @class + * NetworkInterfaces + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkInterfaces { /** - * Gets all network interfaces in a virtual machine scale set. + * Deletes the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -11650,19 +11644,18 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a virtual machine scale set. + * Deletes the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -11676,7 +11669,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11684,29 +11677,22 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified network interface in a virtual machine scale set. + * Gets information about the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. @@ -11722,18 +11708,13 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network interface in a virtual machine scale set. + * Gets information about the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. @@ -11765,362 +11746,148 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. + * Creates or updates a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * * @param {string} networkInterfaceName The name of the network interface. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.virtualMachine.id] Resource ID. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. * - * @reject {Error|ServiceError} - The error object. - */ - listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. * - * {Promise} A promise is returned. + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * for more information. + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} [parameters.id] Resource ID. * - * @param {string} ipConfigurationName The name of the ip configuration. + * @param {string} [parameters.location] Resource location. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. + * Creates or updates a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * * @param {string} networkInterfaceName The name of the network interface. * - * @param {string} ipConfigurationName The name of the ip configuration. + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. * - * @param {string} [options.expand] Expands referenced resources. + * @param {string} [parameters.virtualMachine.id] Resource ID. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. * - * {Promise} A promise is returned. - * - * @resolve {NetworkInterfaceIPConfiguration} - 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. - * - * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfiguration} 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. - */ - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.virtualMachine] The reference of a virtual - * machine. - * - * @param {string} [parameters.virtualMachine.id] Resource ID. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.virtualMachine] The reference of a virtual - * machine. - * - * @param {string} [parameters.virtualMachine.id] Resource ID. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. * * @param {string} [parameters.networkSecurityGroup.provisioningState] The * provisioning state of the public IP resource. Possible values are: @@ -12220,9 +11987,9 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12248,7 +12015,7 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a network interface tags. @@ -12289,17 +12056,13 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. + * Gets all network interfaces in a subscription. * * @param {object} [options] Optional Parameters. * @@ -12308,18 +12071,14 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. + * Gets all network interfaces in a subscription. * * @param {object} [options] Optional Parameters. * @@ -12333,7 +12092,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveRouteListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12341,26 +12100,24 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveRouteListResult} for more + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. */ - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network security groups applied to a network interface. + * Gets all network interfaces in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12368,19 +12125,17 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups applied to a network interface. + * Gets all network interfaces in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12393,7 +12148,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12401,24 +12156,25 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveNetworkSecurityGroupListResult} for - * more information. + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. */ - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network interfaces in a subscription. + * Gets all route tables applied to a network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12427,17 +12183,18 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a subscription. + * Gets all route tables applied to a network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12451,7 +12208,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {EffectiveRouteListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12459,24 +12216,25 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more + * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveRouteListResult} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network interfaces in a resource group. + * Gets all network security groups applied to a network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12485,17 +12243,18 @@ export interface NetworkInterfaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a resource group. + * Gets all network security groups applied to a network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12509,7 +12268,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12517,25 +12276,29 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} for more - * information. + * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveNetworkSecurityGroupListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Gets information about all network interfaces in a virtual machine in a * virtual machine scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. * * @param {object} [options] Optional Parameters. * @@ -12548,14 +12311,18 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets information about all network interfaces in a virtual machine in a * virtual machine scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. * * @param {object} [options] Optional Parameters. * @@ -12585,16 +12352,18 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Gets all network interfaces in a virtual machine scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -12607,13 +12376,15 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets all network interfaces in a virtual machine scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -12643,40 +12414,54 @@ export interface NetworkInterfaces { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified network interface ip configuration in a virtual machine + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine * scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network interface ip configuration in a virtual machine + * Get the specified network interface in a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the virtual machine * scale set. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} virtualmachineIndex The virtual machine index. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12687,7 +12472,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12695,37 +12480,35 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * for more information. + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} 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. */ - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkInterfaceIPConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceIPConfigurations { + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get all ip configurations in a network interface + * Get the specified network interface ip configuration in a virtual machine + * scale set. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12735,17 +12518,25 @@ export interface NetworkInterfaceIPConfigurations { * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all ip configurations in a network interface + * Get the specified network interface ip configuration in a virtual machine + * scale set. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12772,22 +12563,30 @@ export interface NetworkInterfaceIPConfigurations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified network interface ip configuration. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * * @param {string} networkInterfaceName The name of the network interface. * - * @param {string} ipConfigurationName The name of the ip configuration name. + * @param {string} ipConfigurationName The name of the ip configuration. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12797,19 +12596,27 @@ export interface NetworkInterfaceIPConfigurations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network interface ip configuration. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. + * + * @param {string} virtualmachineIndex The virtual machine index. + * * @param {string} networkInterfaceName The name of the network interface. * - * @param {string} ipConfigurationName The name of the ip configuration name. + * @param {string} ipConfigurationName The name of the ip configuration. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12836,16 +12643,17 @@ export interface NetworkInterfaceIPConfigurations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get all ip configurations in a network interface + * Deletes the specified network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12854,17 +12662,18 @@ export interface NetworkInterfaceIPConfigurations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all ip configurations in a network interface + * Deletes the specified network interface. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -12878,7 +12687,7 @@ export interface NetworkInterfaceIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12886,35 +12695,115 @@ export interface NetworkInterfaceIPConfigurations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkInterfaceLoadBalancers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceLoadBalancers { + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * List all load balancers in a network interface. + * Creates or updates a network interface. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkInterfaceName The name of the network interface. * + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. + * + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. + * + * @param {string} [parameters.virtualMachine.id] Resource ID. + * + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. + * + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. + * + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. + * + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. + * + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. + * + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. + * + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. + * + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. + * + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. + * + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12922,76 +12811,109 @@ export interface NetworkInterfaceLoadBalancers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all load balancers in a network interface. + * Creates or updates a network interface. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkInterfaceName The name of the network interface. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.virtualMachine.id] Resource ID. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. * - * {Promise} A promise is returned. + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security group. * - * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. + * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.networkSecurityGroup.provisioningState] The + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. * - * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceLoadBalancerListResult} for - * more information. + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all load balancers in a network interface. + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.dnsSettings] The DNS settings in network + * interface. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP + * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS + * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it + * must be the only value in dnsServers collection. * - * @returns {Promise} A promise is returned + * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that + * uses this NIC is part of an Availability Set, then this list will have the + * union of all DNS servers from all NICs that are part of the Availability + * Set. This property is what is configured on each of those VMs. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all load balancers in a network interface. + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if + * internalDnsNameLabel is not specified, a DNS entry is created for the + * primary NIC of the VM. This DNS name can be constructed by concatenating the + * VM name with the value of internalDomainNameSuffix. + * + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. + * + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. + * + * @param {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. + * + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -13005,7 +12927,7 @@ export interface NetworkInterfaceLoadBalancers { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13013,35 +12935,29 @@ export interface NetworkInterfaceLoadBalancers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceLoadBalancerListResult} for - * more information. + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkSecurityGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkSecurityGroups { + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network security group. + * Updates a network interface tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -13050,19 +12966,23 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security group. + * Updates a network interface tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {object} parameters Parameters supplied to update network interface + * tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -13076,7 +12996,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13084,52 +13004,47 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkInterface} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterface} 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. */ - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified network security group. + * Gets all route tables applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network security group. + * Gets all route tables applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -13140,7 +13055,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {EffectiveRouteListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13148,50 +13063,25 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} for more information. + * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveRouteListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a network security group in the specified resource group. + * Gets all network security groups applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13200,44 +13090,18 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network security group in the specified resource group. + * Gets all network security groups applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13251,7 +13115,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13259,30 +13123,24 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} for more information. + * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EffectiveNetworkSecurityGroupListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. + * Gets all network interfaces in a subscription. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13291,24 +13149,17 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. + * Gets all network interfaces in a subscription. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13322,7 +13173,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13330,20 +13181,24 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} for more information. + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. */ - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network security groups in a subscription. + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13352,14 +13207,17 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a subscription. + * Gets all network interfaces in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13373,7 +13231,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13381,23 +13239,25 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} for more + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { 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; /** - * Gets all network security groups in a resource group. + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13406,16 +13266,18 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a resource group. + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13429,7 +13291,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13437,26 +13299,24 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} for more + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network interfaces in a virtual machine scale set. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13465,19 +13325,17 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network interfaces in a virtual machine scale set. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13491,7 +13349,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13499,49 +13357,25 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceListResult} 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. */ - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13550,44 +13384,18 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13601,7 +13409,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13609,30 +13417,34 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} for more information. + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * NetworkInterfaceIPConfigurations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkInterfaceIPConfigurations { /** - * Updates a network security group tags. + * Get all ip configurations in a network interface * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13641,24 +13453,18 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network security group tags. + * Get all ip configurations in a network interface * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13672,7 +13478,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13680,23 +13486,27 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} for more information. + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * 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. */ - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network security groups in a subscription. + * Gets the specified network interface ip configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration name. * * @param {object} [options] Optional Parameters. * @@ -13705,17 +13515,20 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a subscription. + * Gets the specified network interface ip configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. + * + * @param {string} ipConfigurationName The name of the ip configuration name. * * @param {object} [options] Optional Parameters. * @@ -13729,7 +13542,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13737,21 +13550,21 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} for more + * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfiguration} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network security groups in a resource group. + * Get all ip configurations in a network interface * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13763,14 +13576,14 @@ export interface NetworkSecurityGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a resource group. + * Get all ip configurations in a network interface * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13787,7 +13600,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13795,37 +13608,34 @@ export interface NetworkSecurityGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} for more - * information. + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * SecurityRules + * NetworkInterfaceLoadBalancers * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface SecurityRules { +export interface NetworkInterfaceLoadBalancers { /** - * Deletes the specified network security rule. + * List all load balancers in a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13834,21 +13644,18 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security rule. + * List all load balancers in a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -13862,7 +13669,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13870,26 +13677,24 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceLoadBalancerListResult} 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. */ - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * List all load balancers in a network interface. * - * @param {string} securityRuleName The name of the security rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13898,21 +13703,17 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * List all load balancers in a network interface. * - * @param {string} securityRuleName The name of the security rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13926,7 +13727,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13934,102 +13735,36 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} for more information. + * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceLoadBalancerListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { 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; +} + +/** + * @class + * NetworkSecurityGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkSecurityGroups { /** - * Creates or updates a security rule in the specified network security group. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14037,96 +13772,20 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a security rule in the specified network security group. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14139,7 +13798,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14147,20 +13806,19 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all security rules in a network security group. + * Gets the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -14169,19 +13827,21 @@ export interface SecurityRules { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all security rules in a network security group. + * Gets the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -14190,6 +13850,8 @@ export interface SecurityRules { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -14200,7 +13862,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14208,28 +13870,50 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} for more - * information. + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network security rule. + * Creates or updates a network security group in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14238,21 +13922,44 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security rule. + * Creates or updates a network security group in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. + * + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. + * + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14266,7 +13973,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14274,100 +13981,30 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} 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. */ - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a security rule in the specified network security group. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {object} parameters Parameters supplied to update network security + * group tags. * - * @param {string} [securityRuleParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14376,95 +14013,75 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a security rule in the specified network security group. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. + * @param {object} parameters Parameters supplied to update network security + * group tags. * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. + * @param {object} [options] Optional Parameters. * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. + * {Promise} A promise is returned. * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all network security groups in a subscription. * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' + * @param {object} [options] Optional Parameters. * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. + * @returns {Promise} A promise is returned * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [securityRuleParameters.id] Resource ID. + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all network security groups in a subscription. * * @param {object} [options] Optional Parameters. * @@ -14478,7 +14095,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14486,23 +14103,23 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} for more information. + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all security rules in a network security group. + * Gets all network security groups in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -14511,17 +14128,16 @@ export interface SecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all security rules in a network security group. + * Gets all network security groups in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -14535,7 +14151,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14543,30 +14159,21 @@ export interface SecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} for more + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DefaultSecurityRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface DefaultSecurityRules { + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all default security rules in a network security group. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -14580,14 +14187,14 @@ export interface DefaultSecurityRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all default security rules in a network security group. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -14606,7 +14213,7 @@ export interface DefaultSecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14614,110 +14221,95 @@ export interface DefaultSecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified default network security rule. + * Creates or updates a network security group in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkSecurityGroupName The name of the network security * group. * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified default network security rule. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.id] Resource ID. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} [parameters.location] Resource location. * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SecurityRule} - The deserialized result object. + * @returns {Promise} A promise is returned * - * @reject {Error|ServiceError} - The error object. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a network security group in the specified resource group. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} resourceGroupName The name of the resource group. * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} for more information. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} parameters Parameters supplied to the create or update + * network security group operation. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all default security rules in a network security group. + * @param {array} [parameters.securityRules] A collection of security rules of + * the network security group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {array} [parameters.defaultSecurityRules] The default security rules + * of network security group. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * network security group resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.id] Resource ID. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all default security rules in a network security group. + * @param {string} [parameters.location] Resource location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14731,7 +14323,7 @@ export interface DefaultSecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14739,44 +14331,28 @@ export interface DefaultSecurityRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} for more - * information. + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkWatchers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkWatchers { + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a network watcher in the specified resource group. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} [parameters.location] Resource location. + * @param {object} parameters Parameters supplied to update network security + * group tags. * * @param {object} [parameters.tags] Resource tags. * @@ -14787,28 +14363,22 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network watcher in the specified resource group. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} [parameters.location] Resource location. + * @param {object} parameters Parameters supplied to update network security + * group tags. * * @param {object} [parameters.tags] Resource tags. * @@ -14824,7 +14394,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14832,24 +14402,23 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a subscription. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14858,18 +14427,17 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a subscription. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14883,7 +14451,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14891,24 +14459,24 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a resource group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14917,18 +14485,17 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a resource group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14942,7 +14509,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14950,28 +14517,37 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkSecurityGroupListResult} 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. */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, options: { 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; +} + +/** + * @class + * SecurityRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface SecurityRules { /** - * Updates a network watcher tags. + * Deletes the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -14980,23 +14556,21 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network watcher tags. + * Deletes the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -15010,7 +14584,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15018,23 +14592,27 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network watchers by resource group. + * Get the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15042,17 +14620,22 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network watchers by resource group. + * Get the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15065,7 +14648,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15073,91 +14656,101 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} for more - * information. + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all network watchers by subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Creates or updates a security rule in the specified network security group. * - * @returns {Promise} A promise is returned + * @param {string} resourceGroupName The name of the resource group. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @reject {Error|ServiceError} - The error object. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network watchers by subscription. + * @param {string} securityRuleName The name of the security rule. * - * @param {object} [options] Optional Parameters. + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. * - * {Promise} A promise is returned. + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. * - * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} for more - * information. + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the current network topology by resource group. + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' * - * @param {object} parameters Parameters that define the representation of - * topology. + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {object} [parameters.targetSubnet] The reference of the Subnet + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the * resource. * - * @param {string} [parameters.targetSubnet.id] Resource ID. + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -15166,153 +14759,95 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the current network topology by resource group. + * Creates or updates a security rule in the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {object} parameters Parameters that define the representation of - * topology. + * @param {string} securityRuleName The name of the security rule. * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' * - * @param {string} [parameters.targetSubnet.id] Resource ID. + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. * - * @param {object} [options] Optional Parameters. + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. * - * {Promise} A promise is returned. + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. * - * @resolve {Topology} - The deserialized result object. + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. * - * {Topology} [result] - The deserialized result object if an error did not occur. - * See {@link Topology} 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. - */ - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, callback: ServiceCallback): void; - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). + * @param {string} [securityRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -15326,7 +14861,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {VerificationIPFlowResult} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15334,39 +14869,25 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} for more - * information. + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} 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. */ - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the next hop from the specified VM. + * Gets all security rules in a network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -15375,32 +14896,19 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the next hop from the specified VM. + * Gets all security rules in a network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -15414,7 +14922,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NextHopResult} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15422,29 +14930,28 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NextHopResult} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} for more information. + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} 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. */ - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the configured and effective security group rules on the specified VM. + * Deletes the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -15453,23 +14960,21 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the configured and effective security group rules on the specified VM. + * Deletes the specified network security rule. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -15483,7 +14988,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {SecurityGroupViewResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15491,140 +14996,197 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Initiate troubleshooting on a specified resource + * Creates or updates a security rule in the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {string} securityRuleName The name of the security rule. * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' * - * @param {object} [options] Optional Parameters. + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. * - * @returns {Promise} A promise is returned + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. * - * @reject {Error|ServiceError} - The error object. - */ - getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. * - * @param {object} [options] Optional Parameters. + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * {Promise} A promise is returned. + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [securityRuleParameters.id] Resource ID. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [options] Optional Parameters. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the last completed troubleshooting result on a specified resource + * Creates or updates a security rule in the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {string} securityRuleName The name of the security rule. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {object} securityRuleParameters Parameters supplied to the create or + * update network security rule operation. * - * @param {object} [options] Optional Parameters. + * @param {string} [securityRuleParameters.description] A description for this + * rule. Restricted to 140 chars. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} securityRuleParameters.protocol Network protocol this rule + * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values + * include: 'Tcp', 'Udp', '*' * - * @returns {Promise} A promise is returned + * @param {string} [securityRuleParameters.sourcePortRange] The source port or + * range. Integer or range between 0 and 65535. Asterix '*' can also be used to + * match all ports. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [securityRuleParameters.destinationPortRange] The + * destination port or range. Integer or range between 0 and 65535. Asterix '*' + * can also be used to match all ports. * - * @reject {Error|ServiceError} - The error object. - */ - getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the last completed troubleshooting result on a specified resource + * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or + * source IP range. Asterix '*' can also be used to match all source IPs. + * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + * can also be used. If this is an ingress rule, specifies where network + * traffic originates from. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or + * source IP ranges. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The + * application security group specified as source. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {string} [securityRuleParameters.destinationAddressPrefix] The + * destination address prefix. CIDR or destination IP range. Asterix '*' can + * also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {array} [securityRuleParameters.destinationAddressPrefixes] The + * destination address prefixes. CIDR or destination IP ranges. + * + * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] + * The application security group specified as destination. + * + * @param {array} [securityRuleParameters.sourcePortRanges] The source port + * ranges. + * + * @param {array} [securityRuleParameters.destinationPortRanges] The + * destination port ranges. + * + * @param {string} securityRuleParameters.access The network traffic is allowed + * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * + * @param {number} [securityRuleParameters.priority] The priority of the rule. + * The value can be between 100 and 4096. The priority number must be unique + * for each rule in the collection. The lower the priority number, the higher + * the priority of the rule. + * + * @param {string} securityRuleParameters.direction The direction of the rule. + * The direction specifies if rule will be evaluated on incoming or outcoming + * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values + * include: 'Inbound', 'Outbound' + * + * @param {string} [securityRuleParameters.provisioningState] The provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [securityRuleParameters.name] The name of the resource that + * is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [securityRuleParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [securityRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -15638,7 +15200,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15646,44 +15208,23 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} 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. */ - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Configures flow log on a specified resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * Gets all security rules in a network security group. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15692,38 +15233,17 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Configures flow log on a specified resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * Gets all security rules in a network security group. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15737,7 +15257,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15745,31 +15265,35 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} 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. */ - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { 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; +} + +/** + * @class + * DefaultSecurityRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface DefaultSecurityRules { /** - * Queries status of flow log on a specified resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. + * Gets all default security rules in a network security group. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -15778,25 +15302,19 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Queries status of flow log on a specified resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. + * Gets all default security rules in a network security group. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -15810,7 +15328,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15818,66 +15336,29 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} 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. */ - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * Get the specified default network security rule. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} defaultSecurityRuleName The name of the default security + * rule. * * @param {object} [options] Optional Parameters. * @@ -15886,60 +15367,22 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * Get the specified default network security rule. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} defaultSecurityRuleName The name of the default security + * rule. * * @param {object} [options] Optional Parameters. * @@ -15953,7 +15396,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {ConnectivityInformation} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15961,50 +15404,23 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} for more - * information. + * {SecurityRule} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRule} 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. */ - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * Gets all default security rules in a network security group. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16013,43 +15429,17 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * Gets all default security rules in a network security group. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16063,7 +15453,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AzureReachabilityReport} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16071,39 +15461,46 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} for more + * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityRuleListResult} 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. */ - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { 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; +} + +/** + * @class + * NetworkWatchers + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface NetworkWatchers { /** - * Lists all available internet service providers for a specified Azure region. + * Creates or updates a network watcher in the specified resource group. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that scope the list of available - * providers. + * @param {object} parameters Parameters that define the network watcher + * resource. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} [parameters.id] Resource ID. * - * @param {string} [parameters.state] The state for available providers list. + * @param {string} [parameters.location] Resource location. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -16112,32 +15509,30 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available internet service providers for a specified Azure region. + * Creates or updates a network watcher in the specified resource group. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that scope the list of available - * providers. + * @param {object} parameters Parameters that define the network watcher + * resource. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} [parameters.id] Resource ID. * - * @param {string} [parameters.state] The state for available providers list. + * @param {string} [parameters.location] Resource location. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -16151,7 +15546,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AvailableProvidersList} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16159,21 +15554,20 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} for more - * information. + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} 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. */ - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network watcher resource. + * Gets the specified network watcher by resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -16186,14 +15580,14 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network watcher resource. + * Gets the specified network watcher by resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -16211,7 +15605,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16219,55 +15613,25 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} 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. */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * Deletes the specified network watcher resource. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16275,50 +15639,19 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * Deletes the specified network watcher resource. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16331,7 +15664,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {VerificationIPFlowResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16339,39 +15672,28 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the next hop from the specified VM. + * Updates a network watcher tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {object} parameters Parameters supplied to update network watcher + * tags. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -16380,32 +15702,23 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the next hop from the specified VM. + * Updates a network watcher tags. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {object} parameters Parameters supplied to update network watcher + * tags. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -16419,7 +15732,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NextHopResult} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16427,30 +15740,23 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NextHopResult} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} for more information. + * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} 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. */ - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the configured and effective security group rules on the specified VM. + * Gets all network watchers by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16458,24 +15764,17 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the configured and effective security group rules on the specified VM. + * Gets all network watchers by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16488,7 +15787,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {SecurityGroupViewResult} - The deserialized result object. + * @resolve {NetworkWatcherListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16496,37 +15795,21 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} for more + * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} 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. */ - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * Gets all network watchers by subscription. * * @param {object} [options] Optional Parameters. * @@ -16535,30 +15818,14 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * Gets all network watchers by subscription. * * @param {object} [options] Optional Parameters. * @@ -16572,7 +15839,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {NetworkWatcherListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16580,30 +15847,39 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} 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. */ - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the last completed troubleshooting result on a specified resource + * Gets the current network topology by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters that define the representation of + * topology. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -16612,24 +15888,32 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the last completed troubleshooting result on a specified resource + * Gets the current network topology by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters that define the representation of + * topology. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -16643,7 +15927,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {Topology} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16651,44 +15935,55 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * {Topology} [result] - The deserialized result object if an error did not occur. + * See {@link Topology} 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. */ - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, callback: ServiceCallback): void; + getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Configures flow log on a specified resource. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the configuration of flow - * log. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {object} [parameters.retentionPolicy] + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -16697,38 +15992,49 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Configures flow log on a specified resource. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the configuration of flow - * log. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {object} [parameters.retentionPolicy] + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -16742,7 +16048,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {VerificationIPFlowResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16750,31 +16056,39 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. + * See {@link VerificationIPFlowResult} 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. */ - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; + verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Queries status of flow log on a specified resource. + * Gets the next hop from the specified VM. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {object} parameters Parameters that define the source and destination + * endpoint. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -16783,25 +16097,32 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Queries status of flow log on a specified resource. + * Gets the next hop from the specified VM. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {object} parameters Parameters that define the source and destination + * endpoint. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -16815,7 +16136,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {NextHopResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16823,66 +16144,29 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * {NextHopResult} [result] - The deserialized result object if an error did not occur. + * See {@link NextHopResult} 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. */ - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; + getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. + * Gets the configured and effective security group rules on the specified VM. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -16891,60 +16175,23 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCheckConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] + * Gets the configured and effective security group rules on the specified VM. * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} networkWatcherName The name of the network watcher. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -16958,7 +16205,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {ConnectivityInformation} - The deserialized result object. + * @resolve {SecurityGroupViewResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16966,50 +16213,37 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} for more + * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityGroupViewResult} 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. */ - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; + getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. + * Initiate troubleshooting on a specified resource * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. + * @param {object} parameters Parameters that define the resource to + * troubleshoot. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -17018,43 +16252,30 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. + * Initiate troubleshooting on a specified resource * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. + * @param {object} parameters Parameters that define the resource to + * troubleshoot. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -17068,7 +16289,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AzureReachabilityReport} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17076,39 +16297,30 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} for more - * information. + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. */ - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; + getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all available internet service providers for a specified Azure region. + * Get the last completed troubleshooting result on a specified resource * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -17117,32 +16329,24 @@ export interface NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available internet service providers for a specified Azure region. + * Get the last completed troubleshooting result on a specified resource * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -17156,7 +16360,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AvailableProvidersList} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17164,68 +16368,66 @@ export interface NetworkWatchers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} for more - * information. + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. */ - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * PacketCaptures - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface PacketCaptures { + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; + getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create and start a packet capture on the specified VM. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {object} parameters Parameters that define the create packet capture - * operation. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {object} [parameters.retentionPolicy] * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. * - * @param {object} parameters.storageLocation + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. + * @param {object} [parameters.flowAnalyticsConfiguration] * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. * - * @param {array} [parameters.filters] + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -17234,52 +16436,60 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create and start a packet capture on the specified VM. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {object} parameters Parameters that define the create packet capture - * operation. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {object} [parameters.retentionPolicy] * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. * - * @param {object} parameters.storageLocation + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. + * @param {object} [parameters.flowAnalyticsConfiguration] * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. * - * @param {array} [parameters.filters] + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -17293,7 +16503,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17301,26 +16511,32 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} for more information. + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. */ - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; + setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a packet capture session by name. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -17329,20 +16545,26 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a packet capture session by name. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -17356,7 +16578,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17364,26 +16586,66 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} for more information. + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; + getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified packet capture session. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -17392,20 +16654,60 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified packet capture session. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -17419,7 +16721,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ConnectivityInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17427,25 +16729,50 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectivityInformation} 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. */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; + checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stops a specified packet capture session. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -17454,20 +16781,43 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops a specified packet capture session. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -17481,7 +16831,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {AzureReachabilityReport} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17489,26 +16839,39 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. + * See {@link AzureReachabilityReport} 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. */ - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; + getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Query the status of a running packet capture session. + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -17517,21 +16880,32 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query the status of a running packet capture session. + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -17545,7 +16919,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. + * @resolve {AvailableProvidersList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17553,25 +16927,25 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureQueryStatusResult} for more + * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableProvidersList} 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. */ - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; + listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all packet capture sessions within the specified resource group. + * Deletes the specified network watcher resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -17580,18 +16954,18 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all packet capture sessions within the specified resource group. + * Deletes the specified network watcher resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -17605,7 +16979,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17613,59 +16987,54 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create and start a packet capture on the specified VM. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {object} parameters.storageLocation + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {array} [parameters.filters] + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -17674,52 +17043,49 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create and start a packet capture on the specified VM. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {object} parameters Parameters that define the create packet capture - * operation. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {object} parameters.storageLocation + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -17733,7 +17099,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {VerificationIPFlowResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17741,26 +17107,39 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} for more information. + * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. + * See {@link VerificationIPFlowResult} 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. */ - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; + beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified packet capture session. + * Gets the next hop from the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -17769,20 +17148,32 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified packet capture session. + * Gets the next hop from the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -17796,7 +17187,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NextHopResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17804,25 +17195,29 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {NextHopResult} [result] - The deserialized result object if an error did not occur. + * See {@link NextHopResult} 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. */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; + beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stops a specified packet capture session. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -17831,20 +17226,23 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops a specified packet capture session. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {object} parameters Parameters that define the VM to check security + * groups for. + * + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -17858,7 +17256,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SecurityGroupViewResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17866,26 +17264,37 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityGroupViewResult} 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. */ - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; + beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Query the status of a running packet capture session. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -17894,21 +17303,30 @@ export interface PacketCaptures { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query the status of a running packet capture session. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -17922,7 +17340,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17930,69 +17348,30 @@ export interface PacketCaptures { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureQueryStatusResult} for more - * information. + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} 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. */ - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ConnectionMonitors - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ConnectionMonitors { + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; + beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. + * Get the last completed troubleshooting result on a specified resource * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -18001,53 +17380,24 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. + * Get the last completed troubleshooting result on a specified resource * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -18061,7 +17411,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18069,28 +17419,66 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} for more - * information. + * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; + beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a connection monitor by name. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -18099,21 +17487,60 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a connection monitor by name. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that define the configuration of flow + * log. + * + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . + * + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. + * + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -18127,7 +17554,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18135,28 +17562,32 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} for more - * information. + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; + beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified connection monitor. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -18165,21 +17596,26 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified connection monitor. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. + * + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -18193,7 +17629,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18201,26 +17637,66 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. + * See {@link FlowLogInformation} 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. */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; + beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stops the specified connection monitor. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -18229,21 +17705,60 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCheckConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops the specified connection monitor. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -18257,7 +17772,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ConnectivityInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18265,26 +17780,50 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectivityInformation} 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. */ - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; + beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Starts the specified connection monitor. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -18293,21 +17832,43 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts the specified connection monitor. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. + * + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -18321,7 +17882,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {AzureReachabilityReport} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18329,27 +17890,39 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. + * See {@link AzureReachabilityReport} 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. */ - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; + beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Query a snapshot of the most recent connection states. + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name given to the connection - * monitor. + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -18358,22 +17931,32 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - queryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query a snapshot of the most recent connection states. + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} connectionMonitorName The name given to the connection - * monitor. + * @param {object} parameters Parameters that scope the list of available + * providers. + * + * @param {array} [parameters.azureLocations] A list of Azure regions. + * + * @param {string} [parameters.country] The country for available providers + * list. + * + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -18387,7 +17970,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorQueryResult} - The deserialized result object. + * @resolve {AvailableProvidersList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18395,26 +17978,68 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorQueryResult} for more + * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableProvidersList} 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. */ - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; + beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * PacketCaptures + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface PacketCaptures { /** - * Lists all connection monitors for the specified Network Watcher. + * Create and start a packet capture on the specified VM. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] * * @param {object} [options] Optional Parameters. * @@ -18423,19 +18048,52 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all connection monitors for the specified Network Watcher. + * Create and start a packet capture on the specified VM. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] * * @param {object} [options] Optional Parameters. * @@ -18449,7 +18107,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorListResult} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18457,115 +18115,48 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorListResult} for more - * information. + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; + create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or update a connection monitor. + * Gets a packet capture session by name. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name of the packet capture session. * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.location] Connection monitor location. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.tags] Connection monitor tags. + * @returns {Promise} A promise is returned * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). + * Gets a packet capture session by name. * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. + * @param {string} resourceGroupName The name of the resource group. * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -18579,7 +18170,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorResult} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18587,28 +18178,26 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} for more - * information. + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified connection monitor. + * Deletes the specified packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -18621,17 +18210,16 @@ export interface ConnectionMonitors { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified connection monitor. + * Deletes the specified packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -18659,20 +18247,19 @@ export interface ConnectionMonitors { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stops the specified connection monitor. + * Stops a specified packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -18685,17 +18272,16 @@ export interface ConnectionMonitors { * * @reject {Error|ServiceError} - The error object. */ - beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops the specified connection monitor. + * Stops a specified packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the Network Watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -18723,20 +18309,20 @@ export interface ConnectionMonitors { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Starts the specified connection monitor. + * Query the status of a running packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -18745,21 +18331,21 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts the specified connection monitor. + * Query the status of a running packet capture session. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} connectionMonitorName The name of the connection monitor. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -18773,7 +18359,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18781,28 +18367,26 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureQueryStatusResult} 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. */ - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Query a snapshot of the most recent connection states. + * Lists all packet capture sessions within the specified resource group. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18810,23 +18394,19 @@ export interface ConnectionMonitors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginQueryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query a snapshot of the most recent connection states. + * Lists all packet capture sessions within the specified resource group. * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. + * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18839,7 +18419,7 @@ export interface ConnectionMonitors { * * {Promise} A promise is returned. * - * @resolve {ConnectionMonitorQueryResult} - The deserialized result object. + * @resolve {PacketCaptureListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18847,84 +18427,59 @@ export interface ConnectionMonitors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorQueryResult} for more + * {PacketCaptureListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureListResult} 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. */ - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface Operations { + list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available Network Rest API operations. + * Create and start a packet capture on the specified VM. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} networkWatcherName The name of the network watcher. * - * @returns {Promise} A promise is returned + * @param {string} packetCaptureName The name of the packet capture session. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} parameters Parameters that define the create packet capture + * operation. * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all of the available Network Rest API operations. + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. * - * @param {object} [options] Optional Parameters. + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} parameters.storageLocation * - * {Promise} A promise is returned. + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. * - * @resolve {OperationListResult} - The deserialized result object. + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all of the available Network Rest API operations. + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {array} [parameters.filters] * * @param {object} [options] Optional Parameters. * @@ -18933,17 +18488,52 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available Network Rest API operations. + * Create and start a packet capture on the specified VM. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. + * + * @param {object} parameters Parameters that define the create packet capture + * operation. + * + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. + * + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. + * + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. + * + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. + * + * @param {object} parameters.storageLocation + * + * @param {string} [parameters.storageLocation.storageId] The ID of the storage + * account to save the packet capture session. Required if no local file path + * is provided. + * + * @param {string} [parameters.storageLocation.storagePath] The URI of the + * storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param {string} [parameters.storageLocation.filePath] A valid local path on + * the targeting VM. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. Required if no + * storage ID is provided, otherwise optional. + * + * @param {array} [parameters.filters] * * @param {object} [options] Optional Parameters. * @@ -18957,7 +18547,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18965,33 +18555,26 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * PublicIPAddresses - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface PublicIPAddresses { + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified public IP address. + * Deletes the specified packet capture session. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -19004,14 +18587,16 @@ export interface PublicIPAddresses { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified public IP address. + * Deletes the specified packet capture session. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -19039,43 +18624,43 @@ export interface PublicIPAddresses { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified public IP address in a specified resource group. + * Stops a specified packet capture session. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} [options] Optional Parameters. + * @param {string} packetCaptureName The name of the packet capture session. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified public IP address in a specified resource group. + * Stops a specified packet capture session. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} [options] Optional Parameters. + * @param {string} packetCaptureName The name of the packet capture session. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19087,7 +18672,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19095,170 +18680,188 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a static or dynamic public IP address. + * Query the status of a running packet capture session. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' + * @param {string} packetCaptureName The name given to the packet capture + * session. * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. + * @reject {Error|ServiceError} - The error object. + */ + beginGetStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query the status of a running packet capture session. * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. + * @param {string} packetCaptureName The name given to the packet capture + * session. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.id] Resource ID. + * {Promise} A promise is returned. * - * @param {string} [parameters.location] Resource location. + * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [options] Optional Parameters. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @returns {Promise} A promise is returned + * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link PacketCaptureQueryStatusResult} for more + * information. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @reject {Error|ServiceError} - The error object. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; + beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ConnectionMonitors + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface ConnectionMonitors { + /** - * Creates or updates a static or dynamic public IP address. + * Create or update a connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} publicIpAddressName The name of the public IP address. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. + * @param {string} connectionMonitorName The name of the connection monitor. * - * @param {object} [parameters.sku] The public IP address SKU. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' + * @param {string} [parameters.location] Connection monitor location. * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' + * @param {object} parameters.source * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. + * @param {number} [parameters.source.port] The source port used by connection + * monitor. * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. + * @param {object} parameters.destination * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.id] Resource ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.location] Resource location. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a connection monitor. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. + * + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. + * + * @param {string} [parameters.location] Connection monitor location. + * + * @param {object} [parameters.tags] Connection monitor tags. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. * * @param {object} [options] Optional Parameters. * @@ -19272,7 +18875,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19280,29 +18883,28 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets a connection monitor by name. * - * @param {string} publicIpAddressName The name of the public IP address. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {object} parameters Parameters supplied to update public IP address - * tags. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19311,23 +18913,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets a connection monitor by name. * - * @param {string} publicIpAddressName The name of the public IP address. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {object} parameters Parameters supplied to update public IP address - * tags. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19341,7 +18941,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19349,20 +18949,28 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} 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. */ - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the public IP addresses in a subscription. + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19371,14 +18979,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the public IP addresses in a subscription. + * Deletes the specified connection monitor. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19392,7 +19007,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19400,23 +19015,26 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all public IP addresses in a resource group. + * Stops the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19425,16 +19043,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all public IP addresses in a resource group. + * Stops the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19448,7 +19071,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19456,27 +19079,26 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. + * Starts the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19485,20 +19107,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. + * Starts the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19512,7 +19135,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19520,33 +19143,27 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * Query a snapshot of the most recent connection states. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} networkInterfaceName The network interface name. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} ipConfigurationName The IP configuration name. + * @param {string} connectionMonitorName The name given to the connection + * monitor. * * @param {object} [options] Optional Parameters. * @@ -19555,26 +19172,84 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + queryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. + * Query a snapshot of the most recent connection states. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} connectionMonitorName The name given to the connection + * monitor. * - * @param {string} networkInterfaceName The network interface name. + * @param {object} [options] Optional Parameters. * - * @param {string} ipConfigurationName The IP configuration name. + * @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 {ConnectionMonitorQueryResult} - 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. + * + * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorQueryResult} 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. + */ + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher 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. + */ + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. * * @param {object} [options] Optional Parameters. * @@ -19588,7 +19263,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {ConnectionMonitorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19596,69 +19271,117 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more + * {ConnectionMonitorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorListResult} 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. */ - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get the specified public IP address in a virtual machine scale set. + * Create or update a connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} connectionMonitorName The name of the connection monitor. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} ipConfigurationName The name of the IP configuration. + * @param {string} [parameters.location] Connection monitor location. * - * @param {string} publicIpAddressName The name of the public IP Address. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters.source * - * @param {string} [options.expand] Expands referenced resources. + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified public IP address in a virtual machine scale set. + * Create or update a connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} virtualmachineIndex The virtual machine index. + * @param {string} connectionMonitorName The name of the connection monitor. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} ipConfigurationName The name of the IP configuration. + * @param {string} [parameters.location] Connection monitor location. * - * @param {string} publicIpAddressName The name of the public IP Address. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters.source * - * @param {string} [options.expand] Expands referenced resources. + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. + * + * @param {number} [parameters.source.port] The source port used by connection + * monitor. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. + * + * @param {string} [parameters.destination.address] Address of the connection + * monitor destination (IP or domain name). + * + * @param {number} [parameters.destination.port] The destination port used by + * connection monitor. + * + * @param {boolean} [parameters.autoStart] Determines if the connection monitor + * will start automatically once created. + * + * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval + * in seconds. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19670,7 +19393,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19678,24 +19401,28 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorResult} 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. */ - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified public IP address. + * Deletes the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19708,14 +19435,17 @@ export interface PublicIPAddresses { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified public IP address. + * Deletes the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} publicIpAddressName The name of the subnet. + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19743,80 +19473,20 @@ export interface PublicIPAddresses { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a static or dynamic public IP address. + * Stops the specified connection monitor. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} [parameters.location] Resource location. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19825,81 +19495,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. + * Stops the specified connection monitor. * - * @param {string} [parameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {string} [parameters.location] Resource location. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19913,7 +19523,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19921,29 +19531,26 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Starts the specified connection monitor. * - * @param {string} publicIpAddressName The name of the public IP address. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {object} parameters Parameters supplied to update public IP address - * tags. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19952,23 +19559,21 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Starts the specified connection monitor. * - * @param {string} publicIpAddressName The name of the public IP address. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @param {object} parameters Parameters supplied to update public IP address - * tags. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -19982,7 +19587,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19990,23 +19595,27 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the public IP addresses in a subscription. + * Query a snapshot of the most recent connection states. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. * * @param {object} [options] Optional Parameters. * @@ -20015,17 +19624,22 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginQueryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the public IP addresses in a subscription. + * Query a snapshot of the most recent connection states. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group containing + * Network Watcher. + * + * @param {string} networkWatcherName The name of the Network Watcher resource. + * + * @param {string} connectionMonitorName The name given to the connection + * monitor. * * @param {object} [options] Optional Parameters. * @@ -20039,7 +19653,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {ConnectionMonitorQueryResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20047,24 +19661,30 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more + * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionMonitorQueryResult} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; + beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Operations { /** - * Gets all public IP addresses in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all of the available Network Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -20073,17 +19693,14 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all public IP addresses in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all of the available Network Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -20097,7 +19714,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20105,82 +19722,20 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @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. - */ - listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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. */ - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. + * Lists all of the available Network Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -20192,15 +19747,14 @@ export interface PublicIPAddresses { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. + * Lists all of the available Network Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -20217,7 +19771,7 @@ export interface PublicIPAddresses { * * {Promise} A promise is returned. * - * @resolve {PublicIPAddressListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20225,34 +19779,33 @@ export interface PublicIPAddresses { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} for more - * information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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. */ - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options: { 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; } /** * @class - * RouteFilters + * PublicIPAddresses * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface RouteFilters { +export interface PublicIPAddresses { /** - * Deletes the specified route filter. + * Deletes the specified public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * @@ -20265,14 +19818,14 @@ export interface RouteFilters { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route filter. + * Deletes the specified public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * @@ -20300,45 +19853,43 @@ export interface RouteFilters { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified route filter. + * Gets the specified public IP address in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. + * @param {string} [options.expand] Expands referenced resources. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified route filter. + * Gets the specified public IP address in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. + * @param {string} [options.expand] Expands referenced resources. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20350,7 +19901,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilter} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20358,159 +19909,170 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeFilterName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a route filter in a specified resource group. + * Creates or updates a static or dynamic public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. + * @param {object} [parameters.sku] The public IP address SKU. * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' * - * @param {string} [routeFilterParameters.location] Resource location. + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route filter in a specified resource group. + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {string} [parameters.id] Resource ID. * - * @param {string} [routeFilterParameters.location] Resource location. + * @param {string} [parameters.location] Resource location. * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a route filter in a specified resource group. + * Creates or updates a static or dynamic public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. + * @param {object} [parameters.sku] The public IP address SKU. * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route filter in a specified resource group. + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -20524,7 +20086,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilter} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20532,23 +20094,30 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route filters in a resource group. + * Updates public IP address tags. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20556,17 +20125,24 @@ export interface RouteFilters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route filters in a resource group. + * Updates public IP address tags. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} publicIpAddressName The name of the public IP address. + * + * @param {object} parameters Parameters supplied to update public IP address + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20579,7 +20155,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilterListResult} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20587,20 +20163,20 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route filters in a subscription. + * Gets all the public IP addresses in a subscription. * * @param {object} [options] Optional Parameters. * @@ -20609,14 +20185,14 @@ export interface RouteFilters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route filters in a subscription. + * Gets all the public IP addresses in a subscription. * * @param {object} [options] Optional Parameters. * @@ -20630,7 +20206,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilterListResult} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20638,25 +20214,24 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} for more information. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified route filter. + * Gets all public IP addresses in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20664,19 +20239,17 @@ export interface RouteFilters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route filter. + * Gets all public IP addresses in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20689,7 +20262,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20697,38 +20270,27 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a route filter in a specified resource group. + * Gets information about all public IP addresses on a virtual machine scale + * set level. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -20737,33 +20299,20 @@ export interface RouteFilters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a route filter in a specified resource group. + * Gets information about all public IP addresses on a virtual machine scale + * set level. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -20777,7 +20326,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilter} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20785,37 +20334,33 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} for more information. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a route filter in a specified resource group. + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. + * @param {string} virtualmachineIndex The virtual machine index. * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} networkInterfaceName The network interface name. * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {string} ipConfigurationName The IP configuration name. * * @param {object} [options] Optional Parameters. * @@ -20824,31 +20369,26 @@ export interface RouteFilters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a route filter in a specified resource group. + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. + * @param {string} virtualmachineIndex The virtual machine index. * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. + * @param {string} networkInterfaceName The network interface name. * - * @param {string} [routeFilterParameters.id] Resource ID. + * @param {string} ipConfigurationName The IP configuration name. * * @param {object} [options] Optional Parameters. * @@ -20862,7 +20402,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilter} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20870,102 +20410,70 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} for more information. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route filters in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Get the specified public IP address in a virtual machine scale set. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @returns {Promise} A promise is returned + * @param {string} virtualmachineIndex The virtual machine index. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} networkInterfaceName The name of the network interface. * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route filters in a resource group. + * @param {string} ipConfigurationName The name of the IP configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} publicIpAddressName The name of the public IP Address. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RouteFilterListResult} - 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. - * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route filters in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Get the specified public IP address in a virtual machine scale set. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @returns {Promise} A promise is returned + * @param {string} virtualmachineIndex The virtual machine index. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} networkInterfaceName The name of the network interface. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route filters in a subscription. + * @param {string} ipConfigurationName The name of the IP configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} publicIpAddressName The name of the public IP Address. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -20976,7 +20484,7 @@ export interface RouteFilters { * * {Promise} A promise is returned. * - * @resolve {RouteFilterListResult} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20984,35 +20492,24 @@ export interface RouteFilters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RouteFilterRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface RouteFilterRules { + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, callback: ServiceCallback): void; + getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified rule from a route filter. + * Deletes the specified public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * @@ -21025,16 +20522,14 @@ export interface RouteFilterRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified rule from a route filter. + * Deletes the specified public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. + * @param {string} publicIpAddressName The name of the subnet. * * @param {object} [options] Optional Parameters. * @@ -21062,140 +20557,163 @@ export interface RouteFilterRules { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified rule from a route filter. + * Creates or updates a static or dynamic public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {string} ruleName The name of the rule. + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.sku] The public IP address SKU. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' * - * @returns {Promise} A promise is returned + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified rule from a route filter. + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. * - * @param {string} ruleName The name of the rule. + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. * - * {Promise} A promise is returned. + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @resolve {RouteFilterRule} - The deserialized result object. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.id] Resource ID. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.location] Resource location. * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} for more information. + * @param {object} [parameters.tags] Resource tags. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [options] Optional Parameters. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @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. */ - get(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a route in the specified route filter. + * Creates or updates a static or dynamic public IP address. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. + * @param {object} parameters Parameters supplied to the create or update + * public IP address operation. * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' + * @param {object} [parameters.sku] The public IP address SKU. * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] + * @param {string} [parameters.sku.name] Name of a public IP address SKU. + * Possible values include: 'Basic', 'Standard' * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. + * @param {string} [parameters.publicIPAllocationMethod] The public IP + * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible + * values include: 'Static', 'Dynamic' * - * @param {string} [routeFilterRuleParameters.id] Resource ID. + * @param {string} [parameters.publicIPAddressVersion] The public IP address + * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: + * 'IPv4', 'IPv6' * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.dnsSettings] The FQDN of the DNS record + * associated with the public IP address. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the + * Domain name label.The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated + * with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified + * domain name of the A DNS record associated with the public IP. This is the + * concatenation of the domainNameLabel and the regionalized DNS zone. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the + * Reverse FQDN. A user-visible, fully qualified domain name that resolves to + * this public IP address. If the reverseFqdn is specified, then a PTR DNS + * record is created pointing from the IP address in the in-addr.arpa domain to + * the reverse FQDN. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route in the specified route filter. + * @param {array} [parameters.ipTags] The list of tags associated with the + * public IP address. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.ipAddress] The IP address associated with the + * public IP address resource. * - * @param {string} routeFilterName The name of the route filter. + * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the + * public IP address. * - * @param {string} ruleName The name of the route filter rule. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * public IP resource. * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] + * @param {array} [parameters.zones] A list of availability zones denoting the + * IP allocated for the resource needs to come from. * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. + * @param {string} [parameters.id] Resource ID. * - * @param {string} [routeFilterRuleParameters.location] Resource location. + * @param {string} [parameters.location] Resource location. * - * @param {string} [routeFilterRuleParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21209,7 +20727,7 @@ export interface RouteFilterRules { * * {Promise} A promise is returned. * - * @resolve {RouteFilterRule} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21217,38 +20735,29 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a route in the specified route filter. + * Updates public IP address tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] + * @param {object} parameters Parameters supplied to update public IP address + * tags. * - * @param {string} [routeFilterRuleParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21257,32 +20766,23 @@ export interface RouteFilterRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a route in the specified route filter. + * Updates public IP address tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' + * @param {string} publicIpAddressName The name of the public IP address. * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] + * @param {object} parameters Parameters supplied to update public IP address + * tags. * - * @param {string} [routeFilterRuleParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21296,7 +20796,7 @@ export interface RouteFilterRules { * * {Promise} A promise is returned. * - * @resolve {RouteFilterRule} - The deserialized result object. + * @resolve {PublicIPAddress} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21304,24 +20804,23 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} for more information. + * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddress} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the public IP addresses in a subscription. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21330,18 +20829,17 @@ export interface RouteFilterRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByRouteFilterWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the public IP addresses in a subscription. * - * @param {string} routeFilterName The name of the route filter. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21355,7 +20853,7 @@ export interface RouteFilterRules { * * {Promise} A promise is returned. * - * @resolve {RouteFilterRuleListResult} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21363,27 +20861,24 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRuleListResult} for more + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - listByRouteFilter(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRouteFilter(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - listByRouteFilter(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. + * Gets all public IP addresses in a resource group. * - * @param {string} ruleName The name of the rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21392,20 +20887,17 @@ export interface RouteFilterRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. + * Gets all public IP addresses in a resource group. * - * @param {string} ruleName The name of the rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21419,7 +20911,7 @@ export interface RouteFilterRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21427,43 +20919,25 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { 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; /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. + * Gets information about all public IP addresses on a virtual machine scale + * set level. * - * @param {string} [routeFilterRuleParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21472,139 +20946,32 @@ export interface RouteFilterRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a route in the specified route filter. + * Gets information about all public IP addresses on a virtual machine scale + * set level. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} routeFilterName The name of the route filter. + * @param {object} [options] Optional Parameters. * - * @param {string} ruleName The name of the route filter rule. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] + * {Promise} A promise is returned. * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21612,20 +20979,22 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} for more information. + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all RouteFilterRules in a route filter. + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -21637,14 +21006,15 @@ export interface RouteFilterRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByRouteFilterNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all RouteFilterRules in a route filter. + * Gets information about all public IP addresses in a virtual machine IP + * configuration in a virtual machine scale set. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -21661,7 +21031,7 @@ export interface RouteFilterRules { * * {Promise} A promise is returned. * - * @resolve {RouteFilterRuleListResult} - The deserialized result object. + * @resolve {PublicIPAddressListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21669,34 +21039,34 @@ export interface RouteFilterRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRuleListResult} for more + * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PublicIPAddressListResult} 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. */ - listByRouteFilterNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRouteFilterNext(nextPageLink: string, callback: ServiceCallback): void; - listByRouteFilterNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; + listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * RouteTables + * RouteFilters * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface RouteTables { +export interface RouteFilters { /** - * Deletes the specified route table. + * Deletes the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -21709,14 +21079,14 @@ export interface RouteTables { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route table. + * Deletes the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -21744,43 +21114,45 @@ export interface RouteTables { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified route table. + * Gets the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified route table. + * Gets the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. + * @param {string} [options.expand] Expands referenced express route bgp + * peering resources. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21792,7 +21164,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTable} - The deserialized result object. + * @resolve {RouteFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21800,46 +21172,39 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} for more information. + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeTableName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or updates a route table in a specified resource group. + * Creates or updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [routeFilterParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [routeFilterParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [routeFilterParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21848,40 +21213,33 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or updates a route table in a specified resource group. + * Creates or updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [routeFilterParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [routeFilterParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [routeFilterParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21895,7 +21253,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTable} - The deserialized result object. + * @resolve {RouteFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21903,28 +21261,37 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} for more information. + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a route table tags. + * Updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {object} parameters Parameters supplied to update route table tags. + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -21933,22 +21300,31 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a route table tags. + * Updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {object} parameters Parameters supplied to update route table tags. + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -21962,7 +21338,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTable} - The deserialized result object. + * @resolve {RouteFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21970,20 +21346,20 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} for more information. + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} 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. */ - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route tables in a resource group. + * Gets all route filters in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -21994,14 +21370,14 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables in a resource group. + * Gets all route filters in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -22017,7 +21393,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTableListResult} - The deserialized result object. + * @resolve {RouteFilterListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22025,20 +21401,20 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} for more information. + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route tables in a subscription. + * Gets all route filters in a subscription. * * @param {object} [options] Optional Parameters. * @@ -22047,14 +21423,14 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables in a subscription. + * Gets all route filters in a subscription. * * @param {object} [options] Optional Parameters. * @@ -22068,7 +21444,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTableListResult} - The deserialized result object. + * @resolve {RouteFilterListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22076,24 +21452,24 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} for more information. + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} 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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified route table. + * Deletes the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -22106,14 +21482,14 @@ export interface RouteTables { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route table. + * Deletes the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -22141,39 +21517,32 @@ export interface RouteTables { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or updates a route table in a specified resource group. + * Creates or updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [routeFilterParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [routeFilterParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [routeFilterParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -22182,40 +21551,33 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or updates a route table in a specified resource group. + * Creates or updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. + * @param {object} routeFilterParameters Parameters supplied to the create or + * update route filter operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [routeFilterParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [routeFilterParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [routeFilterParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -22229,7 +21591,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTable} - The deserialized result object. + * @resolve {RouteFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22237,28 +21599,37 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} for more information. + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a route table tags. + * Updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {object} parameters Parameters supplied to update route table tags. + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22267,22 +21638,31 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a route table tags. + * Updates a route filter in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {object} parameters Parameters supplied to update route table tags. + * @param {object} routeFilterParameters Parameters supplied to the update + * route filter operation. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules + * contained within a route filter. + * + * @param {array} [routeFilterParameters.peerings] A collection of references + * to express route circuit peerings. + * + * @param {object} [routeFilterParameters.tags] Resource tags. + * + * @param {string} [routeFilterParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22296,7 +21676,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTable} - The deserialized result object. + * @resolve {RouteFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22304,20 +21684,20 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} for more information. + * {RouteFilter} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilter} 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. */ - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all route tables in a resource group. + * Gets all route filters in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -22329,14 +21709,14 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables in a resource group. + * Gets all route filters in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -22353,7 +21733,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTableListResult} - The deserialized result object. + * @resolve {RouteFilterListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22361,20 +21741,20 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} for more information. + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Gets all route tables in a subscription. + * Gets all route filters in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -22386,14 +21766,14 @@ export interface RouteTables { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables in a subscription. + * Gets all route filters in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -22410,7 +21790,7 @@ export interface RouteTables { * * {Promise} A promise is returned. * - * @resolve {RouteTableListResult} - The deserialized result object. + * @resolve {RouteFilterListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22418,35 +21798,35 @@ export interface RouteTables { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} for more information. + * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterListResult} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { 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; } /** * @class - * Routes + * RouteFilterRules * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface Routes { +export interface RouteFilterRules { /** - * Deletes the specified route from a route table. + * Deletes the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} routeName The name of the route. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22459,16 +21839,16 @@ export interface Routes { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route from a route table. + * Deletes the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} routeName The name of the route. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22496,19 +21876,19 @@ export interface Routes { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified route from a route table. + * Gets the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} routeName The name of the route. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22517,20 +21897,20 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified route from a route table. + * Gets the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} routeName The name of the route. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22544,7 +21924,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {Route} - The deserialized result object. + * @resolve {RouteFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22552,54 +21932,44 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} for more information. + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a route in the specified route table. + * Creates or updates a route in the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. + * @param {string} ruleName The name of the route filter rule. * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the * resource. * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {string} [routeParameters.id] Resource ID. + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22608,48 +21978,38 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a route in the specified route table. + * Creates or updates a route in the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. + * @param {string} ruleName The name of the route filter rule. * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the * resource. * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {string} [routeParameters.id] Resource ID. + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22663,7 +22023,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {Route} - The deserialized result object. + * @resolve {RouteFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22671,24 +22031,38 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} for more information. + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all routes in a route table. + * Updates a route in the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22697,18 +22071,32 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all routes in a route table. + * Updates a route in the specified route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22722,7 +22110,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {RouteListResult} - The deserialized result object. + * @resolve {RouteFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22730,26 +22118,24 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteListResult} for more information. + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; + update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified route from a route table. + * Gets all RouteFilterRules in a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -22758,20 +22144,18 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByRouteFilterWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified route from a route table. + * Gets all RouteFilterRules in a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. + * @param {string} routeFilterName The name of the route filter. * * @param {object} [options] Optional Parameters. * @@ -22785,7 +22169,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RouteFilterRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22793,53 +22177,27 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRuleListResult} 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. */ - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByRouteFilter(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRouteFilter(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; + listByRouteFilter(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a route in the specified route table. + * Deletes the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22848,48 +22206,20 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a route in the specified route table. + * Deletes the specified rule from a route filter. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {string} routeFilterName The name of the route filter. * - * @param {string} [routeParameters.id] Resource ID. + * @param {string} ruleName The name of the rule. * * @param {object} [options] Optional Parameters. * @@ -22903,7 +22233,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {Route} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22911,23 +22241,43 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all routes in a route table. + * Creates or updates a route in the specified route filter. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22936,17 +22286,38 @@ export interface Routes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all routes in a route table. + * Creates or updates a route in the specified route filter. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the create + * or update route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.name] The name of the resource + * that is unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeFilterRuleParameters.location] Resource location. + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22960,7 +22331,7 @@ export interface Routes { * * {Promise} A promise is returned. * - * @resolve {RouteListResult} - The deserialized result object. + * @resolve {RouteFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22968,29 +22339,38 @@ export interface Routes { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteListResult} for more information. + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BgpServiceCommunities - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface BgpServiceCommunities { + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the available bgp service communities. + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -22999,14 +22379,32 @@ export interface BgpServiceCommunities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available bgp service communities. + * Updates a route in the specified route filter. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeFilterName The name of the route filter. + * + * @param {string} ruleName The name of the route filter rule. + * + * @param {object} routeFilterRuleParameters Parameters supplied to the update + * route filter rule operation. + * + * @param {string} routeFilterRuleParameters.access The access type of the + * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', + * 'Deny' + * + * @param {array} routeFilterRuleParameters.communities The collection for bgp + * community values to filter on. e.g. ['12076:5010','12076:5020'] + * + * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -23020,7 +22418,7 @@ export interface BgpServiceCommunities { * * {Promise} A promise is returned. * - * @resolve {BgpServiceCommunityListResult} - The deserialized result object. + * @resolve {RouteFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23028,21 +22426,20 @@ export interface BgpServiceCommunities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpServiceCommunityListResult} for more - * information. + * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the available bgp service communities. + * Gets all RouteFilterRules in a route filter. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -23054,14 +22451,14 @@ export interface BgpServiceCommunities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByRouteFilterNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available bgp service communities. + * Gets all RouteFilterRules in a route filter. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -23078,7 +22475,7 @@ export interface BgpServiceCommunities { * * {Promise} A promise is returned. * - * @resolve {BgpServiceCommunityListResult} - The deserialized result object. + * @resolve {RouteFilterRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23086,32 +22483,34 @@ export interface BgpServiceCommunities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpServiceCommunityListResult} for more + * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteFilterRuleListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByRouteFilterNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRouteFilterNext(nextPageLink: string, callback: ServiceCallback): void; + listByRouteFilterNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Usages + * RouteTables * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface Usages { +export interface RouteTables { /** - * List network usages for a subscription. + * Deletes the specified route table. * - * @param {string} location The location where resource usage is queried. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * @@ -23120,16 +22519,18 @@ export interface Usages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List network usages for a subscription. + * Deletes the specified route table. * - * @param {string} location The location where resource usage is queried. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * @@ -23143,7 +22544,7 @@ export interface Usages { * * {Promise} A promise is returned. * - * @resolve {UsagesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23151,45 +22552,50 @@ export interface Usages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {UsagesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsagesListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * List network usages for a subscription. + * Gets the specified route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List network usages for a subscription. + * Gets the specified route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] Expands referenced resources. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23200,7 +22606,7 @@ export interface Usages { * * {Promise} A promise is returned. * - * @resolve {UsagesListResult} - The deserialized result object. + * @resolve {RouteTable} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23208,33 +22614,46 @@ export interface Usages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {UsagesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsagesListResult} for more information. + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworks - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworks { + get(resourceGroupName: string, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeTableName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network. + * Create or updates a route table in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -23243,18 +22662,40 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network. + * Create or updates a route table in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -23268,7 +22709,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RouteTable} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23276,49 +22717,54 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} 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. */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified virtual network by resource group. + * Updates a route table tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to update route table tags. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified virtual network by resource group. + * Updates a route table tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to update route table tags. * - * @param {string} [options.expand] Expands referenced resources. + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23330,7 +22776,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetwork} - The deserialized result object. + * @resolve {RouteTable} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23338,72 +22784,75 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} for more information. + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a virtual network in the specified resource group. + * Gets all route tables in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all route tables in a resource group. * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. + * {Promise} A promise is returned. * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. + * @resolve {RouteTableListResult} - The deserialized result object. * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.id] Resource ID. + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} for more information. * - * @param {string} [parameters.location] Resource location. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.tags] Resource tags. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all route tables in a subscription. * * @param {object} [options] Optional Parameters. * @@ -23412,66 +22861,73 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all route tables in a subscription. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. + * {Promise} A promise is returned. * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. + * @resolve {RouteTableListResult} - The deserialized result object. * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} for more information. * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified route table. * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * @param {string} routeTableName The name of the route table. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.id] Resource ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.location] Resource location. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.tags] Resource tags. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified route table. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * @@ -23485,7 +22941,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetwork} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23493,27 +22949,43 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network tags. + * Create or updates a route table in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. * - * @param {object} parameters Parameters supplied to update virtual network - * tags. + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -23524,21 +22996,38 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a virtual network tags. + * Create or updates a route table in a specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. * - * @param {object} parameters Parameters supplied to update virtual network - * tags. + * @param {object} parameters Parameters supplied to the create or update route + * table operation. + * + * @param {array} [parameters.routes] Collection of routes contained within a + * route table. + * + * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets + * whether to disable the routes learned by BGP on that route table. True means + * disable. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -23554,7 +23043,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetwork} - The deserialized result object. + * @resolve {RouteTable} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23562,20 +23051,28 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} for more information. + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} 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. */ - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual networks in a subscription. + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -23584,14 +23081,22 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual networks in a subscription. + * Updates a route table tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {object} parameters Parameters supplied to update route table tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -23605,7 +23110,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListResult} - The deserialized result object. + * @resolve {RouteTable} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23613,23 +23118,23 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} for more - * information. + * {RouteTable} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTable} 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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual networks in a resource group. + * Gets all route tables in a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -23638,16 +23143,17 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual networks in a resource group. + * Gets all route tables in a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -23661,7 +23167,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListResult} - The deserialized result object. + * @resolve {RouteTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23669,52 +23175,45 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} for more - * information. + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { 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; /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all route tables in a subscription. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.ipAddress] The private IP address to be verified. - * * @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. */ - checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all route tables in a subscription. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.ipAddress] The private IP address to be verified. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23725,7 +23224,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {IPAddressAvailabilityResult} - The deserialized result object. + * @resolve {RouteTableListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23733,25 +23232,35 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {IPAddressAvailabilityResult} [result] - The deserialized result object if an error did not occur. - * See {@link IPAddressAvailabilityResult} for more - * information. + * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteTableListResult} 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. */ - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Routes + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Routes { /** - * Lists usage stats. + * Deletes the specified route from a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -23760,18 +23269,20 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listUsageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists usage stats. + * Deletes the specified route from a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -23785,7 +23296,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListUsageResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23793,25 +23304,25 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListUsageResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listUsage(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listUsage(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - listUsage(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network. + * Gets the specified route from a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -23820,18 +23331,20 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network. + * Gets the specified route from a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -23845,7 +23358,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Route} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23853,71 +23366,54 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} 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. */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a virtual network in the specified resource group. + * Creates or updates a route in the specified route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * @param {string} routeTableName The name of the route table. * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. + * @param {string} routeName The name of the route. * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. * - * @param {string} [parameters.etag] Gets a unique read-only string that + * @param {string} [routeParameters.etag] A unique read-only string that * changes whenever the resource is updated. * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [routeParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -23926,66 +23422,48 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a virtual network in the specified resource group. + * Creates or updates a route in the specified route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * @param {string} routeTableName The name of the route table. * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. + * @param {string} routeName The name of the route. * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. * - * @param {string} [parameters.etag] Gets a unique read-only string that + * @param {string} [routeParameters.etag] A unique read-only string that * changes whenever the resource is updated. * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [routeParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -23999,7 +23477,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetwork} - The deserialized result object. + * @resolve {Route} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24007,29 +23485,24 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} for more information. + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network tags. + * Gets all routes in a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * @@ -24038,23 +23511,18 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a virtual network tags. + * Gets all routes in a route table. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} routeTableName The name of the route table. * * @param {object} [options] Optional Parameters. * @@ -24068,7 +23536,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetwork} - The deserialized result object. + * @resolve {RouteListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24076,23 +23544,26 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} for more information. + * {RouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteListResult} 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. */ - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual networks in a subscription. + * Deletes the specified route from a route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -24101,17 +23572,20 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual networks in a subscription. + * Deletes the specified route from a route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. * * @param {object} [options] Optional Parameters. * @@ -24125,7 +23599,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24133,43 +23607,103 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual networks in a resource group. + * Creates or updates a route in the specified route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. + * @param {string} routeTableName The name of the route table. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} routeName The name of the route. * - * @returns {Promise} A promise is returned + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual networks in a resource group. + * Creates or updates a route in the specified route table. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} routeTableName The name of the route table. + * + * @param {string} routeName The name of the route. + * + * @param {object} routeParameters Parameters supplied to the create or update + * route operation. + * + * @param {string} [routeParameters.addressPrefix] The destination CIDR to + * which the route applies. + * + * @param {string} routeParameters.nextHopType The type of Azure hop the packet + * should be sent to. Possible values are: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None' + * + * @param {string} [routeParameters.nextHopIpAddress] The IP address packets + * should be forwarded to. Next hop values are only allowed in routes where the + * next hop type is VirtualAppliance. + * + * @param {string} [routeParameters.provisioningState] The provisioning state + * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [routeParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [routeParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [routeParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -24183,7 +23717,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListResult} - The deserialized result object. + * @resolve {Route} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24191,21 +23725,20 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} for more - * information. + * {Route} [result] - The deserialized result object if an error did not occur. + * See {@link Route} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists usage stats. + * Gets all routes in a route table. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -24217,14 +23750,14 @@ export interface VirtualNetworks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listUsageNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists usage stats. + * Gets all routes in a route table. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -24241,7 +23774,7 @@ export interface VirtualNetworks { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkListUsageResult} - The deserialized result object. + * @resolve {RouteListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24249,36 +23782,29 @@ export interface VirtualNetworks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListUsageResult} for more - * information. + * {RouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RouteListResult} 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. */ - listUsageNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listUsageNext(nextPageLink: string, callback: ServiceCallback): void; - listUsageNext(nextPageLink: string, options: { 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; } /** * @class - * Subnets + * BgpServiceCommunities * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface Subnets { +export interface BgpServiceCommunities { /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. + * Gets all the available bgp service communities. * * @param {object} [options] Optional Parameters. * @@ -24287,20 +23813,14 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. + * Gets all the available bgp service communities. * * @param {object} [options] Optional Parameters. * @@ -24314,7 +23834,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BgpServiceCommunityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24322,54 +23842,46 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpServiceCommunityListResult} 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. */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. + * Gets all the available bgp service communities. * - * @param {string} subnetName The name of the subnet. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. + * Gets all the available bgp service communities. * - * @param {string} subnetName The name of the subnet. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -24380,7 +23892,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {Subnet} - The deserialized result object. + * @resolve {BgpServiceCommunityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24388,99 +23900,155 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} for more information. + * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpServiceCommunityListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { expand? : 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; +} + +/** + * @class + * Usages + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Usages { /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. + * List network usages for a subscription. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} location The location where resource usage is queried. * - * @param {string} subnetName The name of the subnet. + * @param {object} [options] Optional Parameters. * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. + * @returns {Promise} A promise is returned * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List network usages for a subscription. * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. + * @param {string} location The location where resource usage is queried. * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. + * @param {object} [options] Optional Parameters. * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. + * {Promise} A promise is returned. * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * @resolve {UsagesListResult} - The deserialized result object. * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * {UsagesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link UsagesListResult} for more information. * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [subnetParameters.routeTable.id] Resource ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List network usages for a subscription. * - * @param {string} [subnetParameters.routeTable.location] Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * @param {object} [options] Optional Parameters. * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. + * @returns {Promise} A promise is returned * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List network usages for a subscription. * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [subnetParameters.id] Resource ID. + * @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 {UsagesListResult} - 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. + * + * {UsagesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link UsagesListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworks + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworks { + + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -24489,93 +24057,5574 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a subnet in the specified virtual network. + * Deletes the specified virtual network. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} virtualNetworkName The name of the virtual network. * - * @param {string} subnetName The name of the subnet. + * @param {object} [options] Optional Parameters. * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. + * {Promise} A promise is returned. * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. + * @resolve {null} - The deserialized result object. * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network by resource group. * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. + * @param {string} virtualNetworkName The name of the virtual network. * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. + * @param {object} [options] Optional Parameters. * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @param {string} [options.expand] Expands referenced resources. * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.routeTable.id] Resource ID. + * @returns {Promise} A promise is returned * - * @param {string} [subnetParameters.routeTable.location] Resource location. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network by resource group. * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. + * @param {string} virtualNetworkName The name of the virtual network. * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} 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. + */ + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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. + */ + checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether a private IP address is available for use. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ipAddress] The private IP address to be verified. + * + * @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 {IPAddressAvailabilityResult} - 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. + * + * {IPAddressAvailabilityResult} [result] - The deserialized result object if an error did not occur. + * See {@link IPAddressAvailabilityResult} 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. + */ + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options?: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, options: { ipAddress? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listUsageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists usage stats. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListUsageResult} - 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. + * + * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListUsageResult} 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. + */ + listUsage(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsage(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + listUsage(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network operation + * + * @param {object} [parameters.addressSpace] The AddressSpace that contains an + * array of IP address ranges that can be used by subnets. + * + * @param {array} [parameters.addressSpace.addressPrefixes] A list of address + * blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an + * array of DNS servers available to VMs deployed in the virtual network. + * + * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers + * IP addresses. + * + * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. + * + * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a + * Virtual Network. + * + * @param {string} [parameters.resourceGuid] The resourceGuid property of the + * Virtual Network resource. + * + * @param {string} [parameters.provisioningState] The provisioning state of the + * PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + * + * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS + * protection is enabled for all the protected resources in the virtual + * network. It requires a DDoS protection plan associated with the resource. + * + * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection + * is enabled for all the subnets in the virtual network. + * + * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan + * associated with the virtual network. + * + * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} parameters Parameters supplied to update virtual network + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetwork} - 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. + * + * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetwork} 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. + */ + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual networks in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkListResult} - 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. + * + * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists usage stats. + * + * @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. + */ + listUsageNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists usage stats. + * + * @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 {VirtualNetworkListUsageResult} - 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. + * + * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkListUsageResult} 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. + */ + listUsageNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsageNext(nextPageLink: string, callback: ServiceCallback): void; + listUsageNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Subnets + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface Subnets { + + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expands referenced resources. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subnets in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SubnetListResult} - 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. + * + * {SubnetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubnetListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified subnet. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} subnetName The name of the subnet. + * + * @param {object} subnetParameters Parameters supplied to the create or update + * subnet operation. + * + * @param {string} [subnetParameters.addressPrefix] The address prefix for the + * subnet. + * + * @param {object} [subnetParameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. + * + * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A + * collection of security rules of the network security group. + * + * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] + * The default security rules of network security group. + * + * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The + * resource GUID property of the network security group resource. + * + * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * + * @param {string} [subnetParameters.networkSecurityGroup.location] Resource + * location. + * + * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * + * @param {object} [subnetParameters.routeTable] The reference of the + * RouteTable resource. + * + * @param {array} [subnetParameters.routeTable.routes] Collection of routes + * contained within a route table. + * + * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + * + * @param {string} [subnetParameters.routeTable.provisioningState] The + * provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + * + * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [subnetParameters.routeTable.id] Resource ID. + * + * @param {string} [subnetParameters.routeTable.location] Resource location. + * + * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * + * @param {array} [subnetParameters.serviceEndpoints] An array of service + * endpoints. + * + * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of + * references to the external resources using subnet. + * + * @param {string} [subnetParameters.provisioningState] The provisioning state + * of the resource. + * + * @param {string} [subnetParameters.name] The name of the resource that is + * unique within a resource group. This name can be used to access the + * resource. + * + * @param {string} [subnetParameters.etag] A unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [subnetParameters.id] Resource ID. + * + * @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 {Subnet} - 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. + * + * {Subnet} [result] - The deserialized result object if an error did not occur. + * See {@link Subnet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all subnets in a virtual network. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subnets in a virtual network. + * + * @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 {SubnetListResult} - 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. + * + * {SubnetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubnetListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkPeerings + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkPeerings { + + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkPeeringListResult} - 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. + * + * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeeringListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network peering. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the virtual network + * peering. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkName The name of the virtual network. + * + * @param {string} virtualNetworkPeeringName The name of the peering. + * + * @param {object} virtualNetworkPeeringParameters Parameters supplied to the + * create or update virtual network peering operation. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] + * Whether the VMs in the linked virtual network space would be able to access + * all the VMs in local Virtual network space. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + * + * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If + * gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If + * remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual + * network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The + * reference of the remote virtual network. The remote virtual network can be + * in the same or different region (preview). See here to register for the + * preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] + * Resource ID. + * + * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The + * reference of the remote virtual network address space. + * + * @param {array} + * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of + * the virtual network peering. Possible values are 'Initiated', 'Connected', + * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * + * @param {string} [virtualNetworkPeeringParameters.provisioningState] The + * provisioning state of the resource. + * + * @param {string} [virtualNetworkPeeringParameters.name] The name of the + * resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * + * @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 {VirtualNetworkPeering} - 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. + * + * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeering} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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 {VirtualNetworkPeeringListResult} - 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. + * + * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkPeeringListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkGateways { + + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayListResult} - 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. + * + * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + listConnectionsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the connections in a virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. + * + * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListConnectionsResult} + * 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. + */ + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + resetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + reset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + reset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + reset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generatevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + generateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + getBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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. + * + * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpPeerStatusListResult} 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. + */ + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + supportedVpnDevicesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + getLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; + getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; + setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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. + */ + vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. + * + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. + * + * @param {string} [parameters.vendor] The vendor for the vpn device. + * + * @param {string} [parameters.deviceFamily] The device family for the vpn + * device. + * + * @param {string} [parameters.firmwareVersion] The firmware version for the + * vpn device. + * + * @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 {String} - 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. + * + * {String} [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. + */ + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, callback: ServiceCallback): void; + vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to create or update virtual + * network gateway operation. + * + * @param {array} [parameters.ipConfigurations] IP configurations for virtual + * network gateway. + * + * @param {string} [parameters.gatewayType] The type of this virtual network + * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + * include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.vpnType] The type of this virtual network + * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible + * values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this + * virtual network gateway or not. + * + * @param {boolean} [parameters.activeActive] ActiveActive flag + * + * @param {object} [parameters.gatewayDefaultSite] The reference of the + * LocalNetworkGateway resource which represents local network site having + * default routes. Assign Null value in case of removing existing default site + * setting. + * + * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * + * @param {object} [parameters.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.sku.name] Gateway SKU name. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values + * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.sku.capacity] The capacity. + * + * @param {object} [parameters.vpnClientConfiguration] The reference of the + * VpnClientConfiguration resource which represents the P2S VpnClient + * configurations. + * + * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The + * reference of the address space resource which represents Address space for + * P2S VpnClient. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The + * radius server address property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The + * radius secret property of the VirtualNetworkGateway resource for vpn client + * connection. + * + * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP + * speaker settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGateway resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network gateway. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual network gateway tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to update virtual network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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. + */ + beginResetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resets the primary of the virtual network gateway in the specified resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.gatewayVip] Virtual network gateway vip address + * supplied to the begin reset of the active-active feature enabled gateway. + * + * @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 {VirtualNetworkGateway} - 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. + * + * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGateway} 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. + */ + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN client package for P2S client of the virtual network gateway + * in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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. + */ + beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the + * specified resource group. Used for IKEV2 and radius based authentication. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} parameters Parameters supplied to the generate virtual + * network gateway VPN client package operation. + * + * @param {string} [parameters.processorArchitecture] VPN client Processor + * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + * include: 'Amd64', 'X86' + * + * @param {string} [parameters.authenticationMethod] VPN client Authentication + * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values + * include: 'EAPTLS', 'EAPMSCHAPv2' + * + * @param {string} [parameters.radiusServerAuthCertificate] The public + * certificate data for the radius server authentication certificate as a + * Base-64 encoded string. Required only if external radius authentication has + * been configured with EAPTLS authentication. + * + * @param {array} [parameters.clientRootCertificates] A list of client root + * certificates public certificate data encoded as Base-64 strings. Optional + * parameter for external radius based authentication with EAPTLS. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; + beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway + * in the specified resource group. The profile needs to be generated first + * using generateVpnProfile. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {String} - 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. + * + * {String} [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. + */ + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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. + */ + beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.peer] The IP address of the peer to retrieve the + * status of. + * + * @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 {BgpPeerStatusListResult} - 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. + * + * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BgpPeerStatusListResult} 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. + */ + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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. + */ + beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway has + * learned, including routes learned from BGP peers. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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. + */ + beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation retrieves a list of routes the virtual network gateway is + * advertising to the specified peer. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {string} peer The IP address of the peer + * + * @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 {GatewayRouteListResult} - 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. + * + * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayRouteListResult} 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. + */ + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; + beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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. + */ + beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + * for P2S client of virtual network gateway in the specified resource group + * through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The name of the virtual network + * gateway. + * + * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set + * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation + * through Network resource provider. + * + * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for + * P2S client. + * + * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security + * Association (also called Quick Mode or Phase 2 SA) payload size in KB for + * P2S client.. + * + * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption + * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', + * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity + * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * + * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption + * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', + * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity + * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + * 'SHA384', 'GCMAES256', 'GCMAES128' + * + * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase + * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * + * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE + * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', + * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * + * @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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; + beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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. + */ + beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the + * vpnclient ipsec policy for P2S client of virtual network gateway in the + * specified resource group through Network resource provider. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway 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 {VpnClientIPsecParameters} - 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. + * + * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. + * See {@link VpnClientIPsecParameters} 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. + */ + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; + beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all virtual network gateways by resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayListResult} - 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. + * + * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the connections in a virtual network gateway. + * + * @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. + */ + listConnectionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the connections in a virtual network gateway. + * + * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. + * + * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayListConnectionsResult} + * 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. + */ + listConnectionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnectionsNext(nextPageLink: string, callback: ServiceCallback): void; + listConnectionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkGatewayConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualNetworkGatewayConnections { + + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a virtual network gateway connection in the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. + * + * @param {string} [parameters.authorizationKey] The authorizationKey. + * + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. + * + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. + * + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. + * + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. + * + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. + * + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * + * @param {number} [parameters.routingWeight] The routing weight. + * + * @param {string} [parameters.sharedKey] The IPSec shared key. + * + * @param {object} [parameters.peer] The reference to peerings resource. + * + * @param {string} [parameters.peer.id] Resource ID. + * + * @param {boolean} [parameters.enableBgp] EnableBgp flag + * + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. + * + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkGatewayConnection} - 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. + * + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. + * + * @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. * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified virtual network gateway connection by resource group. * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [subnetParameters.id] Resource ID. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * * @param {object} [options] Optional Parameters. * @@ -24589,7 +29638,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {Subnet} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24597,24 +29646,26 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} for more information. + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all subnets in a virtual network. + * Deletes the specified virtual network Gateway connection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * * @param {object} [options] Optional Parameters. * @@ -24623,18 +29674,19 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subnets in a virtual network. + * Deletes the specified virtual network Gateway connection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * * @param {object} [options] Optional Parameters. * @@ -24648,7 +29700,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {SubnetListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24656,26 +29708,29 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubnetListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubnetListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified subnet. + * Updates a virtual network gateway connection tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} subnetName The name of the subnet. + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -24684,20 +29739,24 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified subnet. + * Updates a virtual network gateway connection tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} subnetName The name of the subnet. + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -24711,7 +29770,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24719,98 +29778,113 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} 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. */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a subnet in the specified virtual network. + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. * - * @param {string} subnetName The name of the subnet. + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. + * @param {string} parameters.value The virtual network connection shared key + * value. * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. + * @param {string} [parameters.id] Resource ID. * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. + * @param {object} [options] Optional Parameters. * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. + * @returns {Promise} A promise is returned * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @reject {Error|ServiceError} - The error object. + */ + setSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * @param {string} parameters.value The virtual network connection shared key + * value. * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. + * @param {string} [parameters.id] Resource ID. * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [subnetParameters.routeTable.id] Resource ID. + * {Promise} A promise is returned. * - * @param {string} [subnetParameters.routeTable.location] Resource location. + * @resolve {ConnectionSharedKey} - The deserialized result object. * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} for more information. * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; + setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. * - * @param {string} [subnetParameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key name. * * @param {object} [options] Optional Parameters. * @@ -24819,93 +29893,78 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a subnet in the specified virtual network. + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + * information about the specified virtual network gateway connection shared + * key through Network resource provider. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection shared key name. * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. + * @param {object} [options] Optional Parameters. * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. + * {Promise} A promise is returned. * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. + * @resolve {ConnectionSharedKey} - The deserialized result object. * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [subnetParameters.routeTable.id] Resource ID. + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} for more information. * - * @param {string} [subnetParameters.routeTable.location] Resource location. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. + * @param {object} [options] Optional Parameters. * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. + * @returns {Promise} A promise is returned * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [subnetParameters.id] Resource ID. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. + * + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -24919,7 +29978,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {Subnet} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24927,23 +29986,36 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} for more information. + * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all subnets in a virtual network. + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. * * @param {object} [options] Optional Parameters. * @@ -24952,17 +30024,29 @@ export interface Subnets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + resetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subnets in a virtual network. + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. + * + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. * * @param {object} [options] Optional Parameters. * @@ -24976,7 +30060,7 @@ export interface Subnets { * * {Promise} A promise is returned. * - * @resolve {SubnetListResult} - The deserialized result object. + * @resolve {ConnectionResetSharedKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24984,100 +30068,199 @@ export interface Subnets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubnetListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubnetListResult} for more information. + * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionResetSharedKey} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworkPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworkPeerings { + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; + resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network peering. + * Creates or updates a virtual network gateway connection in the specified + * resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.authorizationKey] The authorizationKey. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network peering. + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' + * + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. + * + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag + * + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. + * + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' + * + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. + * + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. + * + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. + * + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. + * + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. + * + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. + * + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. + * + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. + * + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. + * + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. + * + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. + * + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' * - * {Promise} A promise is returned. + * @param {number} [parameters.routingWeight] The routing weight. * - * @resolve {null} - The deserialized result object. + * @param {string} [parameters.sharedKey] The IPSec shared key. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.peer] The reference to peerings resource. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.peer.id] Resource ID. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {boolean} [parameters.enableBgp] EnableBgp flag * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified virtual network peering. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} [parameters.id] Resource ID. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -25086,194 +30269,192 @@ export interface VirtualNetworkPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified virtual network peering. + * Creates or updates a virtual network gateway connection in the specified + * resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {object} parameters Parameters supplied to the create or update + * virtual network gateway connection operation. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.authorizationKey] The authorizationKey. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters.virtualNetworkGateway1 The reference to virtual + * network gateway resource. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual + * network gateway resource. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP + * configurations for virtual network gateway. * - * {Promise} A promise is returned. + * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of + * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. + * Possible values include: 'Vpn', 'ExpressRoute' * - * @resolve {VirtualNetworkPeering} - The deserialized result object. + * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this + * virtual network gateway. Possible values are: 'PolicyBased' and + * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' * - * @reject {Error|ServiceError} - The error object. + * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP + * is enabled for this virtual network gateway or not. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] + * ActiveActive flag * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The + * reference of the LocalNetworkGateway resource which represents local network + * site having default routes. Assign Null value in case of removing existing + * default site setting. * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} for more information. + * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the + * VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU + * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified virtual network. + * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU + * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The + * capacity. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] + * The reference of the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. * - * @param {string} virtualNetworkPeeringName The name of the peering. + * @param {object} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] + * The reference of the address space resource which represents Address space + * for P2S VpnClient. * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] + * VpnClientRootCertificate for virtual network gateway. * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] + * VpnClientRevokedCertificate for Virtual network gateway. * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] + * VpnClientProtocols for Virtual network gateway. * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. + * @param {array} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] + * VpnClientIpsecPolicies for virtual network gateway P2S client. * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] + * The radius server address property of the VirtualNetworkGateway resource for + * vpn client connection. * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @param {string} + * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. + * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual + * network gateway's BGP speaker settings. * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. + * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The + * resource GUID property of the VirtualNetworkGateway resource. * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique + * read-only string that changes whenever the resource is updated. * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' + * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. + * @param {string} [parameters.virtualNetworkGateway2.location] Resource + * location. * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. + * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {object} [parameters.localNetworkGateway2] The reference to local + * network gateway resource. * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] + * Local network site address space. * - * @param {object} [options] Optional Parameters. + * @param {array} + * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A + * list of address blocks reserved for this virtual network in CIDR notation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP + * address of local network gateway. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network + * gateway's BGP speaker settings. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP + * speaker's ASN. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified virtual network. + * @param {string} + * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The + * weight added to routes learned from this BGP speaker. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource + * GUID property of the LocalNetworkGateway resource. * - * @param {string} virtualNetworkPeeringName The name of the peering. + * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only + * string that changes whenever the resource is updated. * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. + * @param {string} [parameters.localNetworkGateway2.id] Resource ID. * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. + * @param {string} [parameters.localNetworkGateway2.location] Resource + * location. + * + * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. + * @param {string} parameters.connectionType Gateway connection type. Possible + * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. + * @param {number} [parameters.routingWeight] The routing weight. * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. + * @param {string} [parameters.sharedKey] The IPSec shared key. * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @param {object} [parameters.peer] The reference to peerings resource. * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. + * @param {string} [parameters.peer.id] Resource ID. * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. + * @param {boolean} [parameters.enableBgp] EnableBgp flag * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable + * policy-based traffic selectors. * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' + * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be + * considered by this connection. * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * VirtualNetworkGatewayConnection resource. * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} [parameters.id] Resource ID. * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -25287,7 +30468,7 @@ export interface VirtualNetworkPeerings { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkPeering} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25295,24 +30476,26 @@ export interface VirtualNetworkPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} for more information. + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual network peerings in a virtual network. + * Deletes the specified virtual network Gateway connection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * * @param {object} [options] Optional Parameters. * @@ -25321,18 +30504,19 @@ export interface VirtualNetworkPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual network peerings in a virtual network. + * Deletes the specified virtual network Gateway connection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * * @param {object} [options] Optional Parameters. * @@ -25346,7 +30530,7 @@ export interface VirtualNetworkPeerings { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkPeeringListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25354,28 +30538,29 @@ export interface VirtualNetworkPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeeringListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network peering. + * Updates a virtual network gateway connection tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -25384,21 +30569,24 @@ export interface VirtualNetworkPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network peering. + * Updates a virtual network gateway connection tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. + * @param {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection. * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * peering. + * @param {object} parameters Parameters supplied to update virtual network + * gateway connection tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -25412,7 +30600,7 @@ export interface VirtualNetworkPeerings { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25420,157 +30608,152 @@ export interface VirtualNetworkPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnection} 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. */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a peering in the specified virtual network. + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. + * @param {string} parameters.value The virtual network connection shared key + * value. * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. + * @param {string} [parameters.id] Resource ID. * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. + * @param {object} [options] Optional Parameters. * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. + * @returns {Promise} A promise is returned * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @reject {Error|ServiceError} - The error object. + */ + beginSetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + * network gateway connection shared key for passed virtual network gateway + * connection in the specified resource group through Network resource + * provider. * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection name. * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. + * @param {object} parameters Parameters supplied to the Begin Set Virtual + * Network Gateway connection Shared key operation throughNetwork resource + * provider. * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} parameters.value The virtual network connection shared key + * value. * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * @param {string} [parameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified virtual network. + * {Promise} A promise is returned. * - * @param {string} resourceGroupName The name of the resource group. + * @resolve {ConnectionSharedKey} - The deserialized result object. * - * @param {string} virtualNetworkName The name of the virtual network. + * @reject {Error|ServiceError} - The error object. * - * @param {string} virtualNetworkPeeringName The name of the peering. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. + * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionSharedKey} for more information. * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. + * {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. + */ + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; + beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. + * @param {object} [options] Optional Parameters. * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @returns {Promise} A promise is returned * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. + * @reject {Error|ServiceError} - The error object. + */ + beginResetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + * virtual network gateway connection shared key for passed virtual network + * gateway connection in the specified resource group through Network resource + * provider. * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} virtualNetworkGatewayConnectionName The virtual network + * gateway connection reset shared key Name. * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. + * @param {object} parameters Parameters supplied to the begin reset virtual + * network gateway connection shared key operation through network resource + * provider. + * + * @param {number} parameters.keyLength The virtual network connection reset + * shared key length, should between 1 and 128. * * @param {object} [options] Optional Parameters. * @@ -25584,7 +30767,7 @@ export interface VirtualNetworkPeerings { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkPeering} - The deserialized result object. + * @resolve {ConnectionResetSharedKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25592,20 +30775,22 @@ export interface VirtualNetworkPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} for more information. + * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionResetSharedKey} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; + beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual network peerings in a virtual network. + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -25617,14 +30802,15 @@ export interface VirtualNetworkPeerings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual network peerings in a virtual network. + * The List VirtualNetworkGatewayConnections operation retrieves all the + * virtual network gateways connections created. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -25641,7 +30827,7 @@ export interface VirtualNetworkPeerings { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkPeeringListResult} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25649,112 +30835,106 @@ export interface VirtualNetworkPeerings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeeringListResult} for more - * information. + * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkGatewayConnectionListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * VirtualNetworkGateways + * LocalNetworkGateways * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface VirtualNetworkGateways { +export interface LocalNetworkGateways { /** - * Creates or updates a virtual network gateway in the specified resource - * group. + * Creates or updates a local network gateway in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * - * @param {object} parameters Parameters supplied to create or update virtual + * @param {object} parameters Parameters supplied to the create or update local * network gateway operation. * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. * - * @param {boolean} [parameters.activeActive] ActiveActive flag + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} [parameters.id] Resource ID. * - * @param {number} [parameters.sku.capacity] The capacity. + * @param {string} [parameters.location] Resource location. * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. + * @param {object} [parameters.tags] Resource tags. * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. + * @param {object} [options] Optional Parameters. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @returns {Promise} A promise is returned * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a local network gateway in the specified resource group. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. + * @param {string} localNetworkGatewayName The name of the local network + * gateway. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. * * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. * @@ -25765,10 +30945,10 @@ export interface VirtualNetworkGateways { * routes learned from this BGP speaker. * * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. + * LocalNetworkGateway resource. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * * @param {string} [parameters.id] Resource ID. * @@ -25781,118 +30961,122 @@ export interface VirtualNetworkGateways { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {LocalNetworkGateway} - 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. + * + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates or updates a virtual network gateway in the specified resource - * group. + * Gets the specified local network gateway in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.activeActive] ActiveActive flag + * @returns {Promise} A promise is returned * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified local network gateway in a resource group. * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} localNetworkGatewayName The name of the local network + * gateway. * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.sku.capacity] The capacity. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * {Promise} A promise is returned. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @resolve {LocalNetworkGateway} - The deserialized result object. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} for more information. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified local network gateway. * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * @param {string} localNetworkGatewayName The name of the local network + * gateway. * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.id] Resource ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.location] Resource location. + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified local network gateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. * * @param {object} [options] Optional Parameters. * @@ -25906,7 +31090,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25914,26 +31098,30 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified virtual network gateway by resource group. + * Updates a local network gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -25941,20 +31129,25 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified virtual network gateway by resource group. + * Updates a local network gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -25967,7 +31160,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {LocalNetworkGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25975,26 +31168,23 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network gateway. + * Gets all the local network gateways in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26002,20 +31192,17 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network gateway. + * Gets all the local network gateways in a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26028,7 +31215,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LocalNetworkGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26036,27 +31223,59 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGatewayListResult} 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. */ - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network gateway tags. + * Creates or updates a local network gateway in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. + * + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -26067,22 +31286,52 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * + * @param {object} parameters Parameters supplied to the create or update local + * network gateway operation. + * + * @param {object} [parameters.localNetworkAddressSpace] Local network site + * address space. + * + * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list + * of address blocks reserved for this virtual network in CIDR notation. + * + * @param {string} [parameters.gatewayIpAddress] IP address of local network + * gateway. + * + * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker + * settings. + * + * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * + * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering + * address and BGP identifier of this BGP speaker. + * + * @param {number} [parameters.bgpSettings.peerWeight] The weight added to + * routes learned from this BGP speaker. * - * @reject {Error|ServiceError} - The error object. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network gateway tags. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * LocalNetworkGateway resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} [parameters.id] Resource ID. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. + * @param {string} [parameters.location] Resource location. * * @param {object} [parameters.tags] Resource tags. * @@ -26098,7 +31347,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {LocalNetworkGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26106,23 +31355,26 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} 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. */ - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all virtual network gateways by resource group. + * Deletes the specified local network gateway. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26130,17 +31382,20 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual network gateways by resource group. + * Deletes the specified local network gateway. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} localNetworkGatewayName The name of the local network + * gateway. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26153,7 +31408,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26161,27 +31416,30 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the connections in a virtual network gateway. + * Updates a local network gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26189,20 +31447,25 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listConnectionsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the connections in a virtual network gateway. + * Updates a local network gateway tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network + * @param {string} localNetworkGatewayName The name of the local network * gateway. * + * @param {object} parameters Parameters supplied to update local network + * gateway tags. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -26215,7 +31478,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayListConnectionsResult} - The deserialized result object. + * @resolve {LocalNetworkGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26223,58 +31486,45 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * for more information. + * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGateway} 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. */ - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the local network gateways in a resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * * @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. */ - resetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the local network gateways in a resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -26285,7 +31535,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {LocalNetworkGatewayListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26293,46 +31543,34 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LocalNetworkGatewayListResult} 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. */ - reset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - reset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - reset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : 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; +} + +/** + * @class + * VirtualWANs + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualWANs { /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Retrieves the details of a VirtualWAN. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} virtualWANName The name of the VirtualWAN being retrieved. * * @param {object} [options] Optional Parameters. * @@ -26341,40 +31579,18 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generatevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' + * Retrieves the details of a VirtualWAN. * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} virtualWANName The name of the VirtualWAN being retrieved. * * @param {object} [options] Optional Parameters. * @@ -26388,7 +31604,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {VirtualWAN} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26396,45 +31612,42 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {VirtualWAN} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualWAN} 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. */ - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. + * @param {string} [wANParameters.id] Resource ID. * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26443,40 +31656,36 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. + * @param {string} [wANParameters.id] Resource ID. * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26490,7 +31699,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {VirtualWAN} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26498,26 +31707,28 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {VirtualWAN} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualWAN} 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. */ - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. + * Updates a VirtualWAN tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26526,21 +31737,22 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. + * Updates a VirtualWAN tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26554,7 +31766,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {VirtualWAN} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26562,54 +31774,47 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {VirtualWAN} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualWAN} 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. */ - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * Deletes a VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being deleted. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * * @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. */ - getBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * Deletes a VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being deleted. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -26620,7 +31825,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {BgpPeerStatusListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26628,26 +31833,21 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpPeerStatusListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a xml format representation for supported vpn devices. + * Lists all the VirtualWANs in a resource group. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * * @param {object} [options] Optional Parameters. * @@ -26656,19 +31856,16 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - supportedVpnDevicesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the VirtualWANs in a resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * * @param {object} [options] Optional Parameters. * @@ -26682,7 +31879,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {ListVirtualWANsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26690,25 +31887,20 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualWANsResult} 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. */ - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * Lists all the VirtualWANs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -26717,20 +31909,14 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * Lists all the VirtualWANs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -26744,7 +31930,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {ListVirtualWANsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26752,29 +31938,42 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} for more - * information. + * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualWANsResult} 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. */ - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. * - * @param {string} peer The IP address of the peer + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26783,22 +31982,36 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. * - * @param {string} peer The IP address of the peer + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26812,7 +32025,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VirtualWAN} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26820,64 +32033,28 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} for more - * information. + * {VirtualWAN} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualWAN} 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. */ - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' + * Updates a VirtualWAN tags. * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' + * @param {string} virtualWANName The name of the VirtualWAN being updated. * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26886,57 +32063,22 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * Updates a VirtualWAN tags. * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' + * @param {string} virtualWANName The name of the VirtualWAN being updated. * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * @param {object} [wANParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -26950,7 +32092,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VpnClientIPsecParameters} - The deserialized result object. + * @resolve {VirtualWAN} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26958,27 +32100,24 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} for more - * information. + * {VirtualWAN} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualWAN} 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. */ - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. + * Deletes a VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. + * @param {string} virtualWANName The name of the VirtualWAN being deleted. * * @param {object} [options] Optional Parameters. * @@ -26987,20 +32126,18 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. + * Deletes a VirtualWAN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualWan. * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. + * @param {string} virtualWANName The name of the VirtualWAN being deleted. * * @param {object} [options] Optional Parameters. * @@ -27014,7 +32151,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VpnClientIPsecParameters} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27022,37 +32159,22 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the VirtualWANs in a resource group. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -27061,30 +32183,17 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the VirtualWANs in a resource group. * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -27098,7 +32207,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {ListVirtualWANsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27106,121 +32215,90 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualWANsResult} 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. */ - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, callback: ServiceCallback): void; - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * Lists all the VirtualWANs in a subscription. * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.sku.capacity] The capacity. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the VirtualWANs in a subscription. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. + * {Promise} A promise is returned. * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. + * @resolve {ListVirtualWANsResult} - The deserialized result object. * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. + * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualWANsResult} for more information. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.id] Resource ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VpnSites + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VpnSites { + + + /** + * Retrieves the details of a VPNsite. * - * @param {string} [parameters.location] Resource location. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} vpnSiteName The name of the VpnSite being retrieved. * * @param {object} [options] Optional Parameters. * @@ -27229,177 +32307,183 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a virtual network gateway in the specified resource - * group. + * Retrieves the details of a VPNsite. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being retrieved. * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. + * {Promise} A promise is returned. * - * @param {boolean} [parameters.activeActive] ActiveActive flag + * @resolve {VpnSite} - The deserialized result object. * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * {VpnSite} [result] - The deserialized result object if an error did not occur. + * See {@link VpnSite} for more information. * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [parameters.sku.capacity] The capacity. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * @param {object} [vpnSiteParameters.deviceProperties] The device properties * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @param {string} [parameters.location] Resource location. + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @returns {Promise} A promise is returned * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {Promise} A promise is returned. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @reject {Error|ServiceError} - The error object. + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [vpnSiteParameters.deviceProperties] The device properties * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network gateway. + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. * - * @param {object} [options] Optional Parameters. + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @returns {Promise} A promise is returned + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network gateway. + * @param {string} [vpnSiteParameters.id] Resource ID. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [vpnSiteParameters.location] Resource location. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27413,7 +32497,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VpnSite} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27421,29 +32505,29 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VpnSite} [result] - The deserialized result object if an error did not occur. + * See {@link VpnSite} 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. */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network gateway tags. + * Updates VpnSite tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being updated. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27452,24 +32536,23 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a virtual network gateway tags. + * Updates VpnSite tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being updated. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27483,7 +32566,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {VpnSite} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27491,57 +32574,47 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {VpnSite} [result] - The deserialized result object if an error did not occur. + * See {@link VpnSite} 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. */ - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resets the primary of the virtual network gateway in the specified resource - * group. + * Deletes a VpnSite. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being deleted. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * * @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. */ - beginResetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resets the primary of the virtual network gateway in the specified resource - * group. + * Deletes a VpnSite. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being deleted. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -27552,7 +32625,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGateway} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27560,46 +32633,21 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. + * Lists all the vpnSites in a resource group. * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} resourceGroupName The resource group name of the VpnSite. * * @param {object} [options] Optional Parameters. * @@ -27608,40 +32656,16 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' + * Lists all the vpnSites in a resource group. * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * @param {string} resourceGroupName The resource group name of the VpnSite. * * @param {object} [options] Optional Parameters. * @@ -27655,7 +32679,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {ListVpnSitesResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27663,45 +32687,20 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnSitesResult} 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. */ - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * Lists all the VpnSites in a subscription. * * @param {object} [options] Optional Parameters. * @@ -27710,40 +32709,14 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. + * Lists all the VpnSites in a subscription. * * @param {object} [options] Optional Parameters. * @@ -27757,7 +32730,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {ListVpnSitesResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27765,26 +32738,77 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnSitesResult} 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. */ - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27793,89 +32817,73 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. * - * {Promise} A promise is returned. + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. * - * @resolve {String} - The deserialized result object. + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs * - * @reject {Error|ServiceError} - The error object. + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [vpnSiteParameters.deviceProperties] The device properties * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. * - * {String} [result] - The deserialized result object if an error did not occur. + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. * - * @param {object} [options] Optional Parameters. + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. * - * @returns {Promise} A promise is returned + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. * - * @reject {Error|ServiceError} - The error object. - */ - beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [vpnSiteParameters.id] Resource ID. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} [vpnSiteParameters.location] Resource location. * - * @param {object} [options] Optional Parameters. + * @param {object} [vpnSiteParameters.tags] Resource tags. * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27887,7 +32895,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {BgpPeerStatusListResult} - The deserialized result object. + * @resolve {VpnSite} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27895,27 +32903,29 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpPeerStatusListResult} for more - * information. + * {VpnSite} [result] - The deserialized result object if an error did not occur. + * See {@link VpnSite} 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. */ - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * Updates VpnSite tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27924,20 +32934,23 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * Updates VpnSite tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -27951,7 +32964,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VpnSite} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27959,29 +32972,24 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} for more - * information. + * {VpnSite} [result] - The deserialized result object if an error did not occur. + * See {@link VpnSite} 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. */ - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * Deletes a VpnSite. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} peer The IP address of the peer + * @param {string} vpnSiteName The name of the VpnSite being deleted. * * @param {object} [options] Optional Parameters. * @@ -27990,22 +32998,18 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. + * Deletes a VpnSite. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. + * @param {string} resourceGroupName The resource group name of the VpnSite. * - * @param {string} peer The IP address of the peer + * @param {string} vpnSiteName The name of the VpnSite being deleted. * * @param {object} [options] Optional Parameters. * @@ -28019,7 +33023,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28027,64 +33031,22 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. + * Lists all the vpnSites in a resource group. * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -28093,57 +33055,17 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the vpnSites in a resource group. * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -28157,7 +33079,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VpnClientIPsecParameters} - The deserialized result object. + * @resolve {ListVpnSitesResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28165,27 +33087,23 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} for more - * information. + * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnSitesResult} 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. */ - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the VpnSites in a subscription. * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -28194,20 +33112,17 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. + * Lists all the VpnSites in a subscription. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -28221,7 +33136,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VpnClientIPsecParameters} - The deserialized result object. + * @resolve {ListVpnSitesResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28229,24 +33144,44 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} for more - * information. + * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnSitesResult} 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. */ - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { 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; +} + +/** + * @class + * VpnSitesConfiguration + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VpnSitesConfiguration { /** - * Gets all virtual network gateways by resource group. + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites * * @param {object} [options] Optional Parameters. * @@ -28255,17 +33190,29 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + downloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all virtual network gateways by resource group. + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites * * @param {object} [options] Optional Parameters. * @@ -28279,7 +33226,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28287,24 +33234,34 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, callback: ServiceCallback): void; + download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the connections in a virtual network gateway. + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites * * @param {object} [options] Optional Parameters. * @@ -28313,17 +33270,29 @@ export interface VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listConnectionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDownloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the connections in a virtual network gateway. + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites * * @param {object} [options] Optional Parameters. * @@ -28337,7 +33306,7 @@ export interface VirtualNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayListConnectionsResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28345,398 +33314,343 @@ export interface VirtualNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listConnectionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listConnectionsNext(nextPageLink: string, callback: ServiceCallback): void; - listConnectionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, callback: ServiceCallback): void; + beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * VirtualNetworkGatewayConnections + * VirtualHubs * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface VirtualNetworkGatewayConnections { +export interface VirtualHubs { /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Retrieves the details of a VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {string} [parameters.authorizationKey] The authorizationKey. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves the details of a VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * {Promise} A promise is returned. * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. + * @resolve {VirtualHub} - The deserialized result object. * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. + * @reject {Error|ServiceError} - The error object. * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * {VirtualHub} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualHub} for more information. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. + * @param {string} [virtualHubParameters.id] Resource ID. * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. + * @param {string} [virtualHubParameters.location] Resource location. * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @param {object} [virtualHubParameters.tags] Resource tags. * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. + * @returns {Promise} A promise is returned * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. * - * @param {number} [parameters.routingWeight] The routing weight. + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. * - * @param {string} [parameters.sharedKey] The IPSec shared key. + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {object} [parameters.peer] The reference to peerings resource. + * @param {string} [virtualHubParameters.id] Resource ID. * - * @param {string} [parameters.peer.id] Resource ID. + * @param {string} [virtualHubParameters.location] Resource location. * - * @param {boolean} [parameters.enableBgp] EnableBgp flag + * @param {object} [virtualHubParameters.tags] Resource tags. * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.id] Resource ID. + * {Promise} A promise is returned. * - * @param {string} [parameters.location] Resource location. + * @resolve {VirtualHub} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [options] Optional Parameters. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @returns {Promise} A promise is returned + * {VirtualHub} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualHub} for more information. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @reject {Error|ServiceError} - The error object. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * Updates VirtualHub tags. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. + * @param {object} [virtualHubParameters.tags] Resource tags. * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. + * @returns {Promise} A promise is returned * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates VirtualHub tags. * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. + * @param {object} [virtualHubParameters.tags] Resource tags. * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. + * @param {object} [options] Optional Parameters. * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * {Promise} A promise is returned. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @resolve {VirtualHub} - The deserialized result object. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. + * @reject {Error|ServiceError} - The error object. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. + * {VirtualHub} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualHub} for more information. * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a VirtualHub. * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a VirtualHub. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. + * {Promise} A promise is returned. * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * @resolve {null} - The deserialized result object. * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @reject {Error|ServiceError} - The error object. * - * @param {number} [parameters.routingWeight] The routing weight. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sharedKey] The IPSec shared key. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.peer] The reference to peerings resource. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [parameters.peer.id] Resource ID. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [parameters.enableBgp] EnableBgp flag + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the VirtualHubs in a resource group. * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.id] Resource ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.location] Resource location. + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the VirtualHubs in a resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * * @param {object} [options] Optional Parameters. * @@ -28750,7 +33664,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. + * @resolve {ListVirtualHubsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28758,26 +33672,20 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} for more - * information. + * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualHubsResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * Lists all the VirtualHubs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -28786,19 +33694,14 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * Lists all the VirtualHubs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -28812,7 +33715,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. + * @resolve {ListVirtualHubsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28820,26 +33723,49 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} for more - * information. + * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualHubsResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network Gateway connection. + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -28848,19 +33774,43 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network Gateway connection. + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -28874,7 +33824,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualHub} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28882,29 +33832,29 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualHub} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualHub} 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. */ - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network gateway connection tags. + * Updates VirtualHub tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [virtualHubParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -28913,24 +33863,23 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a virtual network gateway connection tags. + * Updates VirtualHub tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [virtualHubParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -28944,7 +33893,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VirtualHub} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28952,36 +33901,24 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnectionListEntity} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListEntity} - * for more information. + * {VirtualHub} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualHub} 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. */ - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. + * Deletes a VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} parameters.value The virtual network connection shared key - * value. + * @param {string} virtualHubName The name of the VirtualHub. * * @param {object} [options] Optional Parameters. * @@ -28990,29 +33927,74 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - setSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. + * Deletes a VirtualHub. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. + * @param {string} virtualHubName The name of the VirtualHub. * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the VirtualHubs in a resource group. * - * @param {string} parameters.value The virtual network connection shared key - * value. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -29026,7 +34008,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {ConnectionSharedKey} - The deserialized result object. + * @resolve {ListVirtualHubsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29034,27 +34016,23 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} for more information. + * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualHubsResult} 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. */ - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the VirtualHubs in a subscription. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -29063,21 +34041,17 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists all the VirtualHubs in a subscription. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -29091,7 +34065,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {ConnectionSharedKey} - The deserialized result object. + * @resolve {ListVirtualHubsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29099,23 +34073,35 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} for more information. + * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVirtualHubsResult} 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. */ - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { 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; +} + +/** + * @class + * HubVirtualNetworkConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface HubVirtualNetworkConnections { /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. + * Retrieves the details of a HubVirtualNetworkConnection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {string} connectionName The name of the vpn connection. * * @param {object} [options] Optional Parameters. * @@ -29124,17 +34110,20 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. + * Retrieves the details of a HubVirtualNetworkConnection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {string} connectionName The name of the vpn connection. * * @param {object} [options] Optional Parameters. * @@ -29148,7 +34137,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListResult} - The deserialized result object. + * @resolve {HubVirtualNetworkConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29156,36 +34145,25 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListResult} - * for more information. + * {HubVirtualNetworkConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HubVirtualNetworkConnection} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualHubName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, virtualHubName: string, connectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, virtualHubName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. + * Retrieves the details of all HubVirtualNetworkConnections. * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. + * @param {string} virtualHubName The name of the VirtualHub. * * @param {object} [options] Optional Parameters. * @@ -29194,29 +34172,18 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - resetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. + * Retrieves the details of all HubVirtualNetworkConnections. * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. + * @param {string} resourceGroupName The resource group name of the VirtualHub. * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. + * @param {string} virtualHubName The name of the VirtualHub. * * @param {object} [options] Optional Parameters. * @@ -29230,7 +34197,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {ConnectionResetSharedKey} - The deserialized result object. + * @resolve {ListHubVirtualNetworkConnectionsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29238,197 +34205,194 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionResetSharedKey} for more - * information. + * {ListHubVirtualNetworkConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListHubVirtualNetworkConnectionsResult} 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. */ - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. + * Retrieves the details of all HubVirtualNetworkConnections. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.authorizationKey] The authorizationKey. + * @returns {Promise} A promise is returned * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves the details of all HubVirtualNetworkConnections. * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. + * {Promise} A promise is returned. * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @resolve {ListHubVirtualNetworkConnectionsResult} - The deserialized result object. * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. + * {ListHubVirtualNetworkConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListHubVirtualNetworkConnectionsResult} for + * more information. * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VpnGateways + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VpnGateways { + + + /** + * Retrieves the details of a virtual wan vpn gateway. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * @param {string} gatewayName The name of the gateway. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves the details of a virtual wan vpn gateway. * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * @param {string} gatewayName The name of the gateway. * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * {Promise} A promise is returned. * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. + * @resolve {VpnGateway} - The deserialized result object. * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. + * @reject {Error|ServiceError} - The error object. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. + * {VpnGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VpnGateway} for more information. * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * @param {string} gatewayName The name of the gateway. * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. * - * @param {number} [parameters.routingWeight] The routing weight. + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. * - * @param {string} [parameters.sharedKey] The IPSec shared key. + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. * - * @param {object} [parameters.peer] The reference to peerings resource. + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. * - * @param {string} [parameters.peer.id] Resource ID. + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @param {boolean} [parameters.enableBgp] EnableBgp flag + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [vpnGatewayParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [vpnGatewayParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -29437,190 +34401,189 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. * - * @param {string} [parameters.authorizationKey] The authorizationKey. + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * @param {string} [vpnGatewayParameters.id] Resource ID. * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. + * @param {string} [vpnGatewayParameters.location] Resource location. * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. + * @param {object} [options] Optional Parameters. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. + * {Promise} A promise is returned. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. + * @resolve {VpnGateway} - The deserialized result object. * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. + * {VpnGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VpnGateway} for more information. * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates virtual wan vpn gateway tags. * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. + * @param {string} gatewayName The name of the gateway. * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. + * @returns {Promise} A promise is returned * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates virtual wan vpn gateway tags. * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. + * @param {string} gatewayName The name of the gateway. * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. + * @param {object} [options] Optional Parameters. * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.routingWeight] The routing weight. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.sharedKey] The IPSec shared key. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.peer] The reference to peerings resource. + * {Promise} A promise is returned. * - * @param {string} [parameters.peer.id] Resource ID. + * @resolve {VpnGateway} - The deserialized result object. * - * @param {boolean} [parameters.enableBgp] EnableBgp flag + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. + * {VpnGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VpnGateway} for more information. * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.id] Resource ID. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a virtual wan vpn gateway. * - * @param {string} [parameters.location] Resource location. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} gatewayName The name of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. * * @param {object} [options] Optional Parameters. * @@ -29634,7 +34597,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29642,26 +34605,74 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified virtual network Gateway connection. + * Lists all the VpnGateways in a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the VpnGateways in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @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 {ListVpnGatewaysResult} - 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. + * + * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnGatewaysResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the VpnGateways in a subscription. * * @param {object} [options] Optional Parameters. * @@ -29670,19 +34681,14 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * Lists all the VpnGateways in a subscription. * * @param {object} [options] Optional Parameters. * @@ -29696,7 +34702,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ListVpnGatewaysResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29704,29 +34710,67 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnGatewaysResult} 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. */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a virtual network gateway connection tags. + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -29735,24 +34779,61 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a virtual network gateway connection tags. + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -29766,7 +34847,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VpnGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29774,36 +34855,29 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnectionListEntity} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListEntity} - * for more information. + * {VpnGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VpnGateway} 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. */ - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. + * Updates virtual wan vpn gateway tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. * - * @param {string} parameters.value The virtual network connection shared key - * value. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -29812,29 +34886,23 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginSetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. + * Updates virtual wan vpn gateway tags. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. * - * @param {string} parameters.value The virtual network connection shared key - * value. + * @param {object} [vpnGatewayParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -29848,7 +34916,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {ConnectionSharedKey} - The deserialized result object. + * @resolve {VpnGateway} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29856,35 +34924,24 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} for more information. + * {VpnGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VpnGateway} 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. */ - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. + * Deletes a virtual wan vpn gateway. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. + * @param {string} gatewayName The name of the gateway. * * @param {object} [options] Optional Parameters. * @@ -29893,29 +34950,18 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginResetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. + * Deletes a virtual wan vpn gateway. * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. + * @param {string} gatewayName The name of the gateway. * * @param {object} [options] Optional Parameters. * @@ -29929,7 +34975,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {ConnectionResetSharedKey} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29937,22 +34983,19 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionResetSharedKey} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. + * Lists all the VpnGateways in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -29964,15 +35007,14 @@ export interface VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. + * Lists all the VpnGateways in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -29989,7 +35031,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListResult} - The deserialized result object. + * @resolve {ListVpnGatewaysResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29997,70 +35039,23 @@ export interface VirtualNetworkGatewayConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListResult} - * for more information. + * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnGatewaysResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LocalNetworkGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LocalNetworkGateways { + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. + * Lists all the VpnGateways in a subscription. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -30069,54 +35064,17 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * Lists all the VpnGateways in a subscription. * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -30130,7 +35088,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGateway} - The deserialized result object. + * @resolve {ListVpnGatewaysResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30138,25 +35096,35 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} for more information. + * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnGatewaysResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { 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; +} + +/** + * @class + * VpnConnections + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VpnConnections { /** - * Gets the specified local network gateway in a resource group. + * Retrieves the details of a vpn connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} connectionName The name of the vpn connection. * * @param {object} [options] Optional Parameters. * @@ -30165,19 +35133,20 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified local network gateway in a resource group. + * Retrieves the details of a vpn connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the vpn connection. * * @param {object} [options] Optional Parameters. * @@ -30191,7 +35160,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGateway} - The deserialized result object. + * @resolve {VpnConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30199,25 +35168,60 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} for more information. + * {VpnConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VpnConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified local network gateway. + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -30226,19 +35230,54 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified local network gateway. + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -30252,7 +35291,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VpnConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30260,29 +35299,26 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VpnConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VpnConnection} 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. */ - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Deletes a vpn connection. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. + * @param {string} gatewayName The name of the gateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionName The name of the connection. * * @param {object} [options] Optional Parameters. * @@ -30291,24 +35327,20 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. + * Deletes a vpn connection. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. + * @param {string} gatewayName The name of the gateway. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} connectionName The name of the connection. * * @param {object} [options] Optional Parameters. * @@ -30322,7 +35354,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGateway} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30330,22 +35362,23 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the local network gateways in a resource group. + * Retrieves all vpn connections for a particular virtual wan vpn gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. * * @param {object} [options] Optional Parameters. * @@ -30354,16 +35387,18 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByVpnGatewayWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the local network gateways in a resource group. + * Retrieves all vpn connections for a particular virtual wan vpn gateway. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. * * @param {object} [options] Optional Parameters. * @@ -30377,7 +35412,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGatewayListResult} - The deserialized result object. + * @resolve {ListVpnConnectionsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30385,61 +35420,61 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGatewayListResult} for more + * {ListVpnConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnConnectionsResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByVpnGateway(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByVpnGateway(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; + listByVpnGateway(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a local network gateway in the specified resource group. + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. + * @param {string} connectionName The name of the connection. * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {string} [parameters.id] Resource ID. + * @param {string} [vpnConnectionParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [vpnConnectionParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -30448,54 +35483,54 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a local network gateway in the specified resource group. + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. + * @param {string} connectionName The name of the connection. * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' * - * @param {string} [parameters.id] Resource ID. + * @param {string} [vpnConnectionParameters.id] Resource ID. * - * @param {string} [parameters.location] Resource location. + * @param {string} [vpnConnectionParameters.location] Resource location. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [vpnConnectionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -30509,7 +35544,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGateway} - The deserialized result object. + * @resolve {VpnConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30517,25 +35552,26 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} for more information. + * {VpnConnection} [result] - The deserialized result object if an error did not occur. + * See {@link VpnConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified local network gateway. + * Deletes a vpn connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. * * @param {object} [options] Optional Parameters. * @@ -30548,15 +35584,16 @@ export interface LocalNetworkGateways { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified local network gateway. + * Deletes a vpn connection. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The resource group name of the VpnGateway. * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. * * @param {object} [options] Optional Parameters. * @@ -30584,84 +35621,13 @@ export interface LocalNetworkGateways { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the local network gateways in a resource group. + * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -30673,14 +35639,14 @@ export interface LocalNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByVpnGatewayNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the local network gateways in a resource group. + * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -30697,7 +35663,7 @@ export interface LocalNetworkGateways { * * {Promise} A promise is returned. * - * @resolve {LocalNetworkGatewayListResult} - The deserialized result object. + * @resolve {ListVpnConnectionsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -30705,15 +35671,15 @@ export interface LocalNetworkGateways { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGatewayListResult} for more + * {ListVpnConnectionsResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListVpnConnectionsResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByVpnGatewayNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByVpnGatewayNext(nextPageLink: string, callback: ServiceCallback): void; + listByVpnGatewayNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js index b71044c90d..65816959b8 100644 --- a/lib/services/networkManagement2/lib/operations/index.js +++ b/lib/services/networkManagement2/lib/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.AzureFirewalls = require('./azureFirewalls'); exports.ApplicationGateways = require('./applicationGateways'); exports.ApplicationSecurityGroups = require('./applicationSecurityGroups'); exports.DdosProtectionPlans = require('./ddosProtectionPlans'); @@ -55,3 +56,10 @@ exports.VirtualNetworkPeerings = require('./virtualNetworkPeerings'); exports.VirtualNetworkGateways = require('./virtualNetworkGateways'); exports.VirtualNetworkGatewayConnections = require('./virtualNetworkGatewayConnections'); exports.LocalNetworkGateways = require('./localNetworkGateways'); +exports.VirtualWANs = require('./virtualWANs'); +exports.VpnSites = require('./vpnSites'); +exports.VpnSitesConfiguration = require('./vpnSitesConfiguration'); +exports.VirtualHubs = require('./virtualHubs'); +exports.HubVirtualNetworkConnections = require('./hubVirtualNetworkConnections'); +exports.VpnGateways = require('./vpnGateways'); +exports.VpnConnections = require('./vpnConnections'); diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js index 48c39799aa..119685121e 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -197,6 +195,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,9 +207,6 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (backendAddressPoolName === null || backendAddressPoolName === undefined || typeof backendAddressPoolName.valueOf() !== 'string') { throw new Error('backendAddressPoolName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -229,7 +225,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio requestUrl = requestUrl.replace('{backendAddressPoolName}', encodeURIComponent(backendAddressPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js index fd396ac90b..c514809cdc 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -51,6 +51,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59,9 +60,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -79,7 +77,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - 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 _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -211,9 +210,6 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (frontendIPConfigurationName === null || frontendIPConfigurationName === undefined || typeof frontendIPConfigurationName.valueOf() !== 'string') { throw new Error('frontendIPConfigurationName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -232,7 +228,7 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, requestUrl = requestUrl.replace('{frontendIPConfigurationName}', encodeURIComponent(frontendIPConfigurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js index 40590cf2c2..6610a194bd 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -197,6 +195,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,9 +207,6 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (loadBalancingRuleName === null || loadBalancingRuleName === undefined || typeof loadBalancingRuleName.valueOf() !== 'string') { throw new Error('loadBalancingRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -229,7 +225,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option requestUrl = requestUrl.replace('{loadBalancingRuleName}', encodeURIComponent(loadBalancingRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js index 543a490d40..75d413b24d 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js index 4f03ac9afc..1791978c67 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -197,6 +195,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,9 +207,6 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (probeName === null || probeName === undefined || typeof probeName.valueOf() !== 'string') { throw new Error('probeName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -229,7 +225,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) requestUrl = requestUrl.replace('{probeName}', encodeURIComponent(probeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js index 8bd21d2254..93a55f2af0 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancers.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, loadBalancerName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, loadBalancerName, options, callback) { if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -146,7 +144,7 @@ function _get(resourceGroupName, loadBalancerName, options, callback) { requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -478,11 +476,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -498,7 +494,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -614,14 +610,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -638,7 +632,7 @@ function _list(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('&'); } @@ -754,6 +748,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -762,9 +757,6 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -782,7 +774,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -937,6 +929,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -948,9 +941,6 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -968,7 +958,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1120,6 +1110,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1131,9 +1122,6 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1151,7 +1139,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js index 9d43427a97..f4d9a8536e 100644 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js @@ -164,6 +164,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -178,9 +179,6 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -198,7 +196,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -462,14 +460,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -486,7 +482,7 @@ function _list(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('&'); } @@ -639,6 +635,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -656,9 +653,6 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -676,7 +670,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -824,6 +818,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -838,9 +833,6 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -858,7 +850,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -964,6 +956,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -981,9 +974,6 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1001,7 +991,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js index db53f4db14..1750d4d95c 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -198,6 +196,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -209,9 +208,6 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -230,7 +226,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js index db1e16ac06..040fabb791 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js @@ -50,6 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +76,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js index c24fdf2233..a298f16e6f 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaces.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, networkInterfaceName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, networkInterfaceName, options, callback) { if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -146,7 +144,7 @@ function _get(resourceGroupName, networkInterfaceName, options, callback) { requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -515,11 +513,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -535,7 +531,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -651,14 +647,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -675,7 +669,7 @@ function _list(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('&'); } @@ -955,7 +949,7 @@ function _listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtu if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1104,7 +1098,7 @@ function _listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtual if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1255,7 +1249,7 @@ function _getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMa throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1422,7 +1416,7 @@ function _listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualM throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1591,7 +1585,7 @@ function _getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMac throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1751,6 +1745,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1759,9 +1754,6 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1779,7 +1771,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1970,6 +1962,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1981,9 +1974,6 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2001,7 +1991,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2154,6 +2144,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2165,9 +2156,6 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2185,7 +2173,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2317,6 +2305,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2325,9 +2314,6 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2345,7 +2331,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2463,6 +2449,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2471,9 +2458,6 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2491,7 +2475,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js index 60dd20b7a6..c2bb3bf542 100644 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js @@ -117,6 +117,7 @@ function _get(resourceGroupName, networkSecurityGroupName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -125,9 +126,6 @@ function _get(resourceGroupName, networkSecurityGroupName, options, callback) { if (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -148,7 +146,7 @@ function _get(resourceGroupName, networkSecurityGroupName, options, callback) { requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -453,11 +451,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -473,7 +469,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -589,14 +585,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -613,7 +607,7 @@ function _list(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('&'); } @@ -730,6 +724,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -738,9 +733,6 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -758,7 +750,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -884,6 +876,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -895,9 +888,6 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -915,7 +905,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1069,6 +1059,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1080,9 +1071,6 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1100,7 +1088,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index ba75241a11..c744d25aae 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -61,6 +61,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -72,9 +73,6 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -92,7 +90,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -240,6 +238,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -248,9 +247,6 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -268,7 +264,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -453,6 +449,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -464,9 +461,6 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -484,7 +478,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -614,14 +608,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -638,7 +630,7 @@ function _list(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('&'); } @@ -752,11 +744,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -772,7 +762,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -903,6 +893,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -914,9 +905,6 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -934,7 +922,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1492,7 +1480,8 @@ function _getTroubleshootingResult(resourceGroupName, networkWatcherName, parame /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -1503,7 +1492,7 @@ function _getTroubleshootingResult(resourceGroupName, networkWatcherName, parame * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -1518,6 +1507,27 @@ function _getTroubleshootingResult(resourceGroupName, networkWatcherName, parame * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1590,7 +1600,8 @@ function _setFlowLogConfiguration(resourceGroupName, networkWatcherName, paramet /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -1598,10 +1609,10 @@ function _setFlowLogConfiguration(resourceGroupName, networkWatcherName, paramet * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -2025,6 +2036,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2033,9 +2045,6 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2053,7 +2062,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2185,6 +2194,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2196,9 +2206,6 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2216,7 +2223,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2378,6 +2385,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2389,9 +2397,6 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2409,7 +2414,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2563,6 +2568,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2574,9 +2580,6 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2594,7 +2597,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2754,6 +2757,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2765,9 +2769,6 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2785,7 +2786,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2939,6 +2940,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2950,9 +2952,6 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2970,7 +2969,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3084,7 +3083,8 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p } /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -3095,7 +3095,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -3110,6 +3110,27 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3138,6 +3159,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3149,9 +3171,6 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3169,7 +3188,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3283,7 +3302,8 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa } /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -3291,10 +3311,10 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -3324,6 +3344,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3335,9 +3356,6 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3355,7 +3373,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3546,6 +3564,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3557,9 +3576,6 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3577,7 +3593,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3751,6 +3767,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3762,9 +3779,6 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3782,7 +3796,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3945,6 +3959,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3956,9 +3971,6 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3976,7 +3988,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5349,7 +5361,8 @@ class NetworkWatchers { } /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -5360,7 +5373,7 @@ class NetworkWatchers { * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -5375,6 +5388,27 @@ class NetworkWatchers { * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5401,7 +5435,8 @@ class NetworkWatchers { } /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -5412,7 +5447,7 @@ class NetworkWatchers { * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -5427,6 +5462,27 @@ class NetworkWatchers { * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5475,7 +5531,8 @@ class NetworkWatchers { } /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -5483,10 +5540,10 @@ class NetworkWatchers { * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -5514,7 +5571,8 @@ class NetworkWatchers { } /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -5522,10 +5580,10 @@ class NetworkWatchers { * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -6651,7 +6709,8 @@ class NetworkWatchers { } /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -6662,7 +6721,7 @@ class NetworkWatchers { * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -6677,6 +6736,27 @@ class NetworkWatchers { * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6703,7 +6783,8 @@ class NetworkWatchers { } /** - * Configures flow log on a specified resource. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -6714,7 +6795,7 @@ class NetworkWatchers { * log. * * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * configure for flow log and traffic analytics (optional) . * * @param {string} parameters.storageId ID of the storage account which is used * to store the flow log. @@ -6729,6 +6810,27 @@ class NetworkWatchers { * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable * retention. * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6777,7 +6879,8 @@ class NetworkWatchers { } /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -6785,10 +6888,10 @@ class NetworkWatchers { * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -6816,7 +6919,8 @@ class NetworkWatchers { } /** - * Queries status of flow log on a specified resource. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * * @param {string} resourceGroupName The name of the network watcher resource * group. @@ -6824,10 +6928,10 @@ class NetworkWatchers { * @param {string} networkWatcherName The name of the network watcher resource. * * @param {object} parameters Parameters that define a resource to query flow - * log status. + * log and traffic analytics (optional) status. * * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/networkManagement2/lib/operations/operations.js b/lib/services/networkManagement2/lib/operations/operations.js index fb99365869..2cd6898159 100644 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ b/lib/services/networkManagement2/lib/operations/operations.js @@ -45,11 +45,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.'); } @@ -61,7 +59,7 @@ function _list(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Network/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/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index 0e78bd995f..089c5b1985 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -163,6 +163,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -174,9 +175,6 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -195,7 +193,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -525,6 +523,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -533,9 +532,6 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -553,7 +549,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -704,6 +700,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -718,9 +715,6 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -739,7 +733,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -871,6 +865,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -882,9 +877,6 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -903,7 +895,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1004,6 +996,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1015,9 +1008,6 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1036,7 +1026,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1140,6 +1130,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1151,9 +1142,6 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1172,7 +1160,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index d571cbb250..22e4718f80 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, publicIpAddressName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, publicIpAddressName, options, callback) { if (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -146,7 +144,7 @@ function _get(resourceGroupName, publicIpAddressName, options, callback) { requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -487,11 +485,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -507,7 +503,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -623,14 +619,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -647,7 +641,7 @@ function _list(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('&'); } @@ -767,7 +761,7 @@ function _listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtual if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -919,7 +913,7 @@ function _listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtu if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1086,7 +1080,7 @@ function _getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMac throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-02-01'; + let apiVersion = '2017-03-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1250,6 +1244,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1258,9 +1253,6 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1278,7 +1270,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1441,6 +1433,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1452,9 +1445,6 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1472,7 +1462,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1625,6 +1615,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1636,9 +1627,6 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1656,7 +1644,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js index f75f1724e6..f3528b9f62 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ b/lib/services/networkManagement2/lib/operations/routeFilterRules.js @@ -116,6 +116,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -127,9 +128,6 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { throw new Error('ruleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -148,7 +146,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -456,6 +454,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -464,9 +463,6 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -484,7 +480,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -602,6 +598,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -613,9 +610,6 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { throw new Error('ruleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -634,7 +628,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -758,6 +752,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout { routeFilterRuleParameters = {}; } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -772,9 +767,6 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { throw new Error('routeFilterRuleParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -793,7 +785,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -959,6 +951,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR { routeFilterRuleParameters = {}; } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -973,9 +966,6 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { throw new Error('routeFilterRuleParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -994,7 +984,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js index 3dc57d7eb0..504bcb10c1 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ b/lib/services/networkManagement2/lib/operations/routeFilters.js @@ -116,6 +116,7 @@ function _get(resourceGroupName, routeFilterName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -124,9 +125,6 @@ function _get(resourceGroupName, routeFilterName, options, callback) { if (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -147,7 +145,7 @@ function _get(resourceGroupName, routeFilterName, options, callback) { requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -449,14 +447,12 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -473,7 +469,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('&'); } @@ -586,11 +582,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -606,7 +600,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -722,6 +716,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -730,9 +725,6 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -750,7 +742,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -865,6 +857,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -876,9 +869,6 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (routeFilterParameters === null || routeFilterParameters === undefined) { throw new Error('routeFilterParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -896,7 +886,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1057,6 +1047,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1068,9 +1059,6 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (routeFilterParameters === null || routeFilterParameters === undefined) { throw new Error('routeFilterParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1088,7 +1076,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js index 4a5ee2f20a..517f17c260 100644 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ b/lib/services/networkManagement2/lib/operations/routeTables.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, routeTableName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, routeTableName, options, callback) { if (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -146,7 +144,7 @@ function _get(resourceGroupName, routeTableName, options, callback) { requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -446,14 +444,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -470,7 +466,7 @@ function _list(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('&'); } @@ -583,11 +579,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -603,7 +597,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -719,6 +713,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -727,9 +722,6 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -747,7 +739,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -869,6 +861,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -880,9 +873,6 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -900,7 +890,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1052,6 +1042,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1063,9 +1054,6 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1083,7 +1071,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js index cdb3db5d01..4b6ef8a695 100644 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ b/lib/services/networkManagement2/lib/operations/routes.js @@ -116,6 +116,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -127,9 +128,6 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -148,7 +146,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { 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('&'); } @@ -373,6 +371,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -381,9 +380,6 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -401,7 +397,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -519,6 +515,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -530,9 +527,6 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -551,7 +545,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option 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('&'); } @@ -681,6 +675,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -695,9 +690,6 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (routeParameters === null || routeParameters === undefined) { throw new Error('routeParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -716,7 +708,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout 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('&'); } diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js index a1ed0bc9bc..7fd121a9bf 100644 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ b/lib/services/networkManagement2/lib/operations/securityRules.js @@ -118,6 +118,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -129,9 +130,6 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -150,7 +148,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -424,6 +422,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -432,9 +431,6 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -452,7 +448,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -571,6 +567,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -582,9 +579,6 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -603,7 +597,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -780,6 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -794,9 +789,6 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (securityRuleParameters === null || securityRuleParameters === undefined) { throw new Error('securityRuleParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -815,7 +807,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index d0ba19ebaa..624a0eeae2 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -119,6 +119,7 @@ function _get(resourceGroupName, virtualNetworkName, subnetName, options, callba throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -130,9 +131,6 @@ function _get(resourceGroupName, virtualNetworkName, subnetName, options, callba if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { throw new Error('subnetName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -154,7 +152,7 @@ function _get(resourceGroupName, virtualNetworkName, subnetName, options, callba requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -427,6 +425,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -435,9 +434,6 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -455,7 +451,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -573,6 +569,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -584,9 +581,6 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { throw new Error('subnetName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -605,7 +599,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -780,6 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -794,9 +789,6 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (subnetParameters === null || subnetParameters === undefined) { throw new Error('subnetParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -815,7 +807,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js index e3a083f0ba..fddfb0b8e2 100644 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ b/lib/services/networkManagement2/lib/operations/usages.js @@ -47,6 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -58,9 +59,6 @@ function _list(location, options, callback) { throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -77,7 +75,7 @@ function _list(location, options, callback) { requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/virtualHubs.js b/lib/services/networkManagement2/lib/operations/virtualHubs.js new file mode 100644 index 0000000000..b4e5b81077 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/virtualHubs.js @@ -0,0 +1,2519 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualHubName, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + 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['ErrorModel']().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['VirtualHub']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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.beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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['VirtualHub']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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.beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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['VirtualHub']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 _deleteMethod(resourceGroupName, virtualHubName, 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.beginDeleteMethod(resourceGroupName, virtualHubName, 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); + }); + }); +} + +/** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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-06-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 (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 (this.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.Network/virtualHubs'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ErrorModel']().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['ListVirtualHubsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VirtualHubs in a subscription. + * + * @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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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-06-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.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}/providers/Microsoft.Network/virtualHubs'; + 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['ErrorModel']().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['ListVirtualHubsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (virtualHubParameters === null || virtualHubParameters === undefined) { + throw new Error('virtualHubParameters cannot be null or undefined.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (virtualHubParameters !== null && virtualHubParameters !== undefined) { + let requestModelMapper = new client.models['VirtualHub']().mapper(); + requestModel = client.serialize(requestModelMapper, virtualHubParameters, 'virtualHubParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(virtualHubParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VirtualHub']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualHub']().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); + }); +} + +/** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (virtualHubParameters === null || virtualHubParameters === undefined) { + throw new Error('virtualHubParameters cannot be null or undefined.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + 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 = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (virtualHubParameters !== null && virtualHubParameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, virtualHubParameters, 'virtualHubParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(virtualHubParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VirtualHub']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualHub']().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); + }); +} + +/** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualHubName, 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-06-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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { + throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/virtualHubs/{virtualHubName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); + 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 = '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 !== 202 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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); + }); +} + +/** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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['ErrorModel']().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['ListVirtualHubsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VirtualHubs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVirtualHubsResult} for more information. + * + * {object} [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['ErrorModel']().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['ListVirtualHubsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualHubs. */ +class VirtualHubs { + /** + * Create a VirtualHubs. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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 {VirtualHub} - 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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualHubName, 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._get(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualHubName, options, optionalCallback); + } + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualHub} - 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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); + } + } + + /** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualHub} - 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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); + } + } + + /** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualHubName, 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._deleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualHubName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Lists all the VirtualHubs in 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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} for more information. + * + * {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); + } + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing + * VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to create or update + * VirtualHub. + * + * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which + * the VirtualHub belongs + * + * @param {string} [virtualHubParameters.virtualWan.id] Resource ID. + * + * @param {array} [virtualHubParameters.hubVirtualNetworkConnections] list of + * all vnet connections with this VirtualHub. + * + * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this + * VirtualHub. + * + * @param {string} [virtualHubParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [virtualHubParameters.id] Resource ID. + * + * @param {string} [virtualHubParameters.location] Resource location. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualHub} - 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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); + } + } + + /** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates VirtualHub tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @param {object} virtualHubParameters Parameters supplied to update + * VirtualHub tags. + * + * @param {object} [virtualHubParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualHub} - 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 VirtualHub} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); + } + } + + /** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VirtualHub. + * + * @param {string} resourceGroupName The resource group name of the VirtualHub. + * + * @param {string} virtualHubName The name of the VirtualHub. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualHubName, 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._beginDeleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualHubName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualHubs; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js index e40db35d68..44e00197cb 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js @@ -63,11 +63,13 @@ const WebResource = msRest.WebResource; * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -302,6 +304,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -310,9 +313,6 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -330,7 +330,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -502,8 +502,8 @@ function _deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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 VirtualNetworkGatewayConnectionListEntity} - * for more information. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -546,7 +546,7 @@ function _updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, par parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayConnectionListEntity']().mapper(); + let resultMapper = new client.models['VirtualNetworkGatewayConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -580,6 +580,8 @@ function _updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, par * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -688,6 +690,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -696,9 +699,6 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -716,7 +716,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -833,14 +833,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -857,7 +855,7 @@ function _list(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('&'); } @@ -1077,11 +1075,13 @@ function _resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -1237,6 +1237,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1248,9 +1249,6 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1268,7 +1266,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1416,6 +1414,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1424,9 +1423,6 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1444,7 +1440,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1534,8 +1530,8 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListEntity} - * for more information. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1551,6 +1547,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1562,9 +1559,6 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1582,7 +1576,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1663,7 +1657,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayConnectionListEntity']().mapper(); + let resultMapper = new client.models['VirtualNetworkGatewayConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1696,6 +1690,8 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1724,6 +1720,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1735,9 +1732,6 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1755,7 +1749,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1915,6 +1909,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1926,9 +1921,6 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1946,7 +1938,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2243,11 +2235,13 @@ class VirtualNetworkGatewayConnections { * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -2447,11 +2441,13 @@ class VirtualNetworkGatewayConnections { * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -2822,7 +2818,7 @@ class VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2865,7 +2861,7 @@ class VirtualNetworkGatewayConnections { * * {Promise} A promise is returned * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2874,8 +2870,8 @@ class VirtualNetworkGatewayConnections { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListEntity} - * for more information. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2919,6 +2915,8 @@ class VirtualNetworkGatewayConnections { * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2962,6 +2960,8 @@ class VirtualNetworkGatewayConnections { * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3343,11 +3343,13 @@ class VirtualNetworkGatewayConnections { * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -3547,11 +3549,13 @@ class VirtualNetworkGatewayConnections { * * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', + * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The * capacity. @@ -3833,7 +3837,7 @@ class VirtualNetworkGatewayConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3876,7 +3880,7 @@ class VirtualNetworkGatewayConnections { * * {Promise} A promise is returned * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3885,8 +3889,8 @@ class VirtualNetworkGatewayConnections { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListEntity} - * for more information. + * See {@link VirtualNetworkGatewayConnection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3930,6 +3934,8 @@ class VirtualNetworkGatewayConnections { * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3973,6 +3979,8 @@ class VirtualNetworkGatewayConnections { * @param {string} parameters.value The virtual network connection shared key * value. * + * @param {string} [parameters.id] Resource ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index c649890237..f75d16fb1c 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js @@ -56,11 +56,13 @@ const WebResource = msRest.WebResource; * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * @@ -226,6 +228,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -234,9 +237,6 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -254,7 +254,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -518,14 +518,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -542,7 +540,7 @@ function _list(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('&'); } @@ -661,6 +659,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -669,9 +668,6 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -689,7 +685,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1268,6 +1264,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1276,9 +1273,6 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1296,7 +1290,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1793,6 +1787,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1804,9 +1799,6 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1824,7 +1816,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1967,11 +1959,13 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * @@ -2059,6 +2053,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2070,9 +2065,6 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2090,7 +2082,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2238,6 +2230,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2246,9 +2239,6 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2266,7 +2256,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2372,6 +2362,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2383,9 +2374,6 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2403,7 +2391,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2540,6 +2528,7 @@ function _beginReset(resourceGroupName, virtualNetworkGatewayName, options, call throw new Error('callback cannot be null.'); } let gatewayVip = (options && options.gatewayVip !== undefined) ? options.gatewayVip : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2551,9 +2540,6 @@ function _beginReset(resourceGroupName, virtualNetworkGatewayName, options, call if (gatewayVip !== null && gatewayVip !== undefined && typeof gatewayVip.valueOf() !== 'string') { throw new Error('gatewayVip must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2574,7 +2560,7 @@ function _beginReset(resourceGroupName, virtualNetworkGatewayName, options, call if (gatewayVip !== null && gatewayVip !== undefined) { queryParameters.push('gatewayVip=' + encodeURIComponent(gatewayVip)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2712,6 +2698,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2723,9 +2710,6 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2743,7 +2727,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2901,6 +2885,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2912,9 +2897,6 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2932,7 +2914,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3071,6 +3053,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3079,9 +3062,6 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3099,7 +3079,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3228,6 +3208,7 @@ function _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, op throw new Error('callback cannot be null.'); } let peer = (options && options.peer !== undefined) ? options.peer : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3239,9 +3220,6 @@ function _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, op if (peer !== null && peer !== undefined && typeof peer.valueOf() !== 'string') { throw new Error('peer must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3262,7 +3240,7 @@ function _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, op if (peer !== null && peer !== undefined) { queryParameters.push('peer=' + encodeURIComponent(peer)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3382,6 +3360,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3390,9 +3369,6 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3410,7 +3386,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3532,6 +3508,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3543,9 +3520,6 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (peer === null || peer === undefined || typeof peer.valueOf() !== 'string') { throw new Error('peer cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3564,7 +3538,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('peer=' + encodeURIComponent(peer)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3721,6 +3695,7 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3732,9 +3707,6 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (vpnclientIpsecParams === null || vpnclientIpsecParams === undefined) { throw new Error('vpnclientIpsecParams cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3752,7 +3724,7 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3886,6 +3858,7 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3894,9 +3867,6 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -3914,7 +3884,7 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4334,11 +4304,13 @@ class VirtualNetworkGateways { * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * @@ -4464,11 +4436,13 @@ class VirtualNetworkGateways { * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * @@ -6239,11 +6213,13 @@ class VirtualNetworkGateways { * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * @@ -6369,11 +6345,13 @@ class VirtualNetworkGateways { * * @param {string} [parameters.sku.name] Gateway SKU name. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3' + * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', + * 'ErGw2AZ', 'ErGw3AZ' * * @param {number} [parameters.sku.capacity] The capacity. * diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js index 2bf0999f6b..5e2bfeb81f 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js @@ -118,6 +118,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -129,9 +130,6 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -150,7 +148,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -403,6 +401,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -411,9 +410,6 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -431,7 +427,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -550,6 +546,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -561,9 +558,6 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -582,7 +576,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -739,6 +733,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -753,9 +748,6 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (virtualNetworkPeeringParameters === null || virtualNetworkPeeringParameters === undefined) { throw new Error('virtualNetworkPeeringParameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -774,7 +766,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js index 412ea8f563..e2c13908cc 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworks.js @@ -115,6 +115,7 @@ function _get(resourceGroupName, virtualNetworkName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -123,9 +124,6 @@ function _get(resourceGroupName, virtualNetworkName, options, callback) { if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -146,7 +144,7 @@ function _get(resourceGroupName, virtualNetworkName, options, callback) { requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { queryParameters.push('$expand=' + encodeURIComponent(expand)); } @@ -472,11 +470,9 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -492,7 +488,7 @@ function _listAll(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -608,14 +604,12 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -632,7 +626,7 @@ function _list(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('&'); } @@ -753,6 +747,7 @@ function _checkIPAddressAvailability(resourceGroupName, virtualNetworkName, opti throw new Error('callback cannot be null.'); } let ipAddress = (options && options.ipAddress !== undefined) ? options.ipAddress : undefined; + let apiVersion = '2018-06-01'; // Validate try { if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { @@ -764,9 +759,6 @@ function _checkIPAddressAvailability(resourceGroupName, virtualNetworkName, opti if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -787,7 +779,7 @@ function _checkIPAddressAvailability(resourceGroupName, virtualNetworkName, opti if (ipAddress !== null && ipAddress !== undefined) { queryParameters.push('ipAddress=' + encodeURIComponent(ipAddress)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -905,6 +897,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -913,9 +906,6 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -933,7 +923,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1049,6 +1039,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1057,9 +1048,6 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1077,7 +1065,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1225,6 +1213,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1236,9 +1225,6 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1256,7 +1242,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1409,6 +1395,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1420,9 +1407,6 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1440,7 +1424,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.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/networkManagement2/lib/operations/virtualWANs.js b/lib/services/networkManagement2/lib/operations/virtualWANs.js new file mode 100644 index 0000000000..27a5a3b901 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/virtualWANs.js @@ -0,0 +1,2471 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being retrieved. + * + * @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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, virtualWANName, 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-06-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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { + throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.Network/virtualWans/{VirtualWANName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); + 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['ErrorModel']().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['VirtualWAN']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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.beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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['VirtualWAN']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, virtualWANName, wANParameters, 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.beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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['VirtualWAN']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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 _deleteMethod(resourceGroupName, virtualWANName, 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.beginDeleteMethod(resourceGroupName, virtualWANName, 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); + }); + }); +} + +/** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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-06-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 (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 (this.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.Network/virtualWans'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ErrorModel']().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['ListVirtualWANsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VirtualWANs in a subscription. + * + * @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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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-06-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.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}/providers/Microsoft.Network/virtualWans'; + 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['ErrorModel']().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['ListVirtualWANsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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-06-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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { + throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); + } + if (wANParameters === null || wANParameters === undefined) { + throw new Error('wANParameters cannot be null or undefined.'); + } + if (this.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.Network/virtualWans/{VirtualWANName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (wANParameters !== null && wANParameters !== undefined) { + let requestModelMapper = new client.models['VirtualWAN']().mapper(); + requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(wANParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VirtualWAN']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualWAN']().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); + }); +} + +/** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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-06-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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { + throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); + } + if (wANParameters === null || wANParameters === undefined) { + throw new Error('wANParameters cannot be null or undefined.'); + } + if (this.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.Network/virtualWans/{VirtualWANName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); + 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 = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (wANParameters !== null && wANParameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(wANParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VirtualWAN']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualWAN']().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); + }); +} + +/** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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 _beginDeleteMethod(resourceGroupName, virtualWANName, 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-06-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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { + throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/virtualWans/{VirtualWANName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); + 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 = '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 !== 202 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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); + }); +} + +/** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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['ErrorModel']().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['ListVirtualWANsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VirtualWANs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVirtualWANsResult} for more information. + * + * {object} [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['ErrorModel']().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['ListVirtualWANsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualWANs. */ +class VirtualWANs { + /** + * Create a VirtualWANs. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being retrieved. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being retrieved. + * + * @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 {VirtualWAN} - 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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, virtualWANName, 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._get(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, virtualWANName, options, optionalCallback); + } + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualWAN} - 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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); + } + } + + /** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualWAN} - 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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, virtualWANName, wANParameters, 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._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); + } + } + + /** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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. + */ + deleteMethod(resourceGroupName, virtualWANName, 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._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Lists all the VirtualWANs in 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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} for more information. + * + * {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); + } + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing + * VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being created or + * updated. + * + * @param {object} wANParameters Parameters supplied to create or update + * VirtualWAN. + * + * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be + * disabled or not. + * + * @param {string} [wANParameters.provisioningState] The provisioning state of + * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', + * 'Failed' + * + * @param {string} [wANParameters.id] Resource ID. + * + * @param {string} [wANParameters.location] Resource location. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualWAN} - 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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); + } + } + + /** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being updated. + * + * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. + * + * @param {object} [wANParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualWAN} - 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 VirtualWAN} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); + } + } + + /** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param {string} resourceGroupName The resource group name of the VirtualWan. + * + * @param {string} virtualWANName The name of the VirtualWAN being deleted. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, virtualWANName, 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._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); + } + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualWANs; diff --git a/lib/services/networkManagement2/lib/operations/vpnConnections.js b/lib/services/networkManagement2/lib/operations/vpnConnections.js new file mode 100644 index 0000000000..a355bcbce9 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/vpnConnections.js @@ -0,0 +1,1745 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, gatewayName, connectionName, 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-06-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 (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 (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 (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + 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['ErrorModel']().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['VpnConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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.beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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['VpnConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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 _deleteMethod(resourceGroupName, gatewayName, connectionName, 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.beginDeleteMethod(resourceGroupName, gatewayName, connectionName, 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); + }); + }); +} + +/** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 ListVpnConnectionsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByVpnGateway(resourceGroupName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.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.Network/vpnGateways/{gatewayName}/vpnConnections'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + 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['ErrorModel']().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['ListVpnConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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-06-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 (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 (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 (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (vpnConnectionParameters === null || vpnConnectionParameters === undefined) { + throw new Error('vpnConnectionParameters cannot be null or undefined.'); + } + if (this.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.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vpnConnectionParameters !== null && vpnConnectionParameters !== undefined) { + let requestModelMapper = new client.models['VpnConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnConnectionParameters, 'vpnConnectionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnConnectionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VpnConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VpnConnection']().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); + }); +} + +/** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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 _beginDeleteMethod(resourceGroupName, gatewayName, connectionName, 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-06-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 (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 (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 (connectionName === null || connectionName === undefined || typeof connectionName.valueOf() !== 'string') { + throw new Error('connectionName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); + 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 = '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 !== 202 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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); + }); +} + +/** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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 ListVpnConnectionsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByVpnGatewayNext(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['ErrorModel']().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['ListVpnConnectionsResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VpnConnections. */ +class VpnConnections { + /** + * Create a VpnConnections. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByVpnGateway = _listByVpnGateway; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByVpnGatewayNext = _listByVpnGatewayNext; + } + + /** + * Retrieves the details of a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the vpn connection. + * + * @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 {VpnConnection} - 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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, gatewayName, connectionName, 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._get(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, gatewayName, connectionName, options, optionalCallback); + } + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnConnection} - 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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, optionalCallback); + } + } + + /** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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. + */ + deleteMethod(resourceGroupName, gatewayName, connectionName, 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._deleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, gatewayName, connectionName, options, optionalCallback); + } + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + listByVpnGatewayWithHttpOperationResponse(resourceGroupName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 {ListVpnConnectionsResult} - 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 ListVpnConnectionsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByVpnGateway(resourceGroupName, gatewayName, 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._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByVpnGateway(resourceGroupName, gatewayName, options, optionalCallback); + } + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + * updates the existing connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @param {object} vpnConnectionParameters Parameters supplied to create or + * Update a VPN Connection. + * + * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected + * vpn site. + * + * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. + * + * @param {number} [vpnConnectionParameters.routingWeight] routing weight for + * vpn connection. + * + * @param {string} [vpnConnectionParameters.connectionStatus] The connection + * status. Possible values include: 'Unknown', 'Connecting', 'Connected', + * 'NotConnected' + * + * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn + * connection. + * + * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag + * + * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to + * be considered by this connection. + * + * @param {string} [vpnConnectionParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnConnectionParameters.id] Resource ID. + * + * @param {string} [vpnConnectionParameters.location] Resource location. + * + * @param {object} [vpnConnectionParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnConnection} - 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 VpnConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, optionalCallback); + } + } + + /** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a vpn connection. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {string} connectionName The name of the connection. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, gatewayName, connectionName, 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._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, optionalCallback); + } + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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. + */ + listByVpnGatewayNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByVpnGatewayNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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 {ListVpnConnectionsResult} - 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 ListVpnConnectionsResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByVpnGatewayNext(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._listByVpnGatewayNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByVpnGatewayNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VpnConnections; diff --git a/lib/services/networkManagement2/lib/operations/vpnGateways.js b/lib/services/networkManagement2/lib/operations/vpnGateways.js new file mode 100644 index 0000000000..238e248b70 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/vpnGateways.js @@ -0,0 +1,2627 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.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.Network/vpnGateways/{gatewayName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + 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['ErrorModel']().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['VpnGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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.beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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['VpnGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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.beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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['VpnGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 _deleteMethod(resourceGroupName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, gatewayName, 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); + }); + }); +} + +/** + * Lists all the VpnGateways in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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-06-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 (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 (this.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.Network/vpnGateways'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ErrorModel']().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['ListVpnGatewaysResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VpnGateways in a subscription. + * + * @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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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-06-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.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}/providers/Microsoft.Network/vpnGateways'; + 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['ErrorModel']().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['ListVpnGatewaysResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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-06-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 (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 (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 (vpnGatewayParameters === null || vpnGatewayParameters === undefined) { + throw new Error('vpnGatewayParameters cannot be null or undefined.'); + } + if (this.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.Network/vpnGateways/{gatewayName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vpnGatewayParameters !== null && vpnGatewayParameters !== undefined) { + let requestModelMapper = new client.models['VpnGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnGatewayParameters, 'vpnGatewayParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnGatewayParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VpnGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VpnGateway']().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); + }); +} + +/** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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-06-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 (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 (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 (vpnGatewayParameters === null || vpnGatewayParameters === undefined) { + throw new Error('vpnGatewayParameters cannot be null or undefined.'); + } + if (this.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.Network/vpnGateways/{gatewayName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + 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 = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vpnGatewayParameters !== null && vpnGatewayParameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnGatewayParameters, 'vpnGatewayParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnGatewayParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VpnGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VpnGateway']().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); + }); +} + +/** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 _beginDeleteMethod(resourceGroupName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.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.Network/vpnGateways/{gatewayName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + 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 = '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 !== 202 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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); + }); +} + +/** + * Lists all the VpnGateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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['ErrorModel']().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['ListVpnGatewaysResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VpnGateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVpnGatewaysResult} for more information. + * + * {object} [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['ErrorModel']().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['ListVpnGatewaysResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VpnGateways. */ +class VpnGateways { + /** + * Create a VpnGateways. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, gatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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 {VpnGateway} - 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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, gatewayName, 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._get(resourceGroupName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, gatewayName, options, optionalCallback); + } + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnGateway} - 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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); + } + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnGateway} - 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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); + } + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + deleteMethod(resourceGroupName, gatewayName, 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._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, gatewayName, options, optionalCallback); + } + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Lists all the VpnGateways in 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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} for more information. + * + * {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); + } + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the + * existing gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to create or Update + * a virtual wan vpn gateway. + * + * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which + * the gateway belongs + * + * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. + * + * @param {array} [vpnGatewayParameters.connections] list of all vpn + * connections to the gateway. + * + * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's + * BGP speaker settings. + * + * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's + * ASN. + * + * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnGatewayParameters.provisioningState] The provisioning + * state of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {object} [vpnGatewayParameters.policies] The policies applied to this + * vpn gateway. + * + * @param {boolean} [vpnGatewayParameters.policies.allowBranchToBranchTraffic] + * True if branch to branch traffic is allowed. + * + * @param {boolean} [vpnGatewayParameters.policies.allowVnetToVnetTraffic] True + * if Vnet to Vnet traffic is allowed. + * + * @param {string} [vpnGatewayParameters.id] Resource ID. + * + * @param {string} [vpnGatewayParameters.location] Resource location. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnGateway} - 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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); + } + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @param {object} vpnGatewayParameters Parameters supplied to update a virtual + * wan vpn gateway tags. + * + * @param {object} [vpnGatewayParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnGateway} - 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 VpnGateway} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); + } + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param {string} resourceGroupName The resource group name of the VpnGateway. + * + * @param {string} gatewayName The name of the gateway. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, gatewayName, 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._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, gatewayName, options, optionalCallback); + } + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VpnGateways; diff --git a/lib/services/networkManagement2/lib/operations/vpnSites.js b/lib/services/networkManagement2/lib/operations/vpnSites.js new file mode 100644 index 0000000000..a9023614cd --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/vpnSites.js @@ -0,0 +1,2687 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves the details of a VPNsite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being retrieved. + * + * @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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vpnSiteName, 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-06-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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { + throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/vpnSites/{vpnSiteName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); + 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['ErrorModel']().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['VpnSite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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.beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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['VpnSite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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.beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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['VpnSite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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 _deleteMethod(resourceGroupName, vpnSiteName, 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.beginDeleteMethod(resourceGroupName, vpnSiteName, 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); + }); + }); +} + +/** + * Lists all the vpnSites in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, 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-06-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 (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 (this.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.Network/vpnSites'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ErrorModel']().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['ListVpnSitesResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VpnSites in a subscription. + * + * @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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(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-06-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.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}/providers/Microsoft.Network/vpnSites'; + 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['ErrorModel']().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['ListVpnSitesResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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-06-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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { + throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); + } + if (vpnSiteParameters === null || vpnSiteParameters === undefined) { + throw new Error('vpnSiteParameters cannot be null or undefined.'); + } + if (this.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.Network/vpnSites/{vpnSiteName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vpnSiteParameters !== null && vpnSiteParameters !== undefined) { + let requestModelMapper = new client.models['VpnSite']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnSiteParameters, 'vpnSiteParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnSiteParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VpnSite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VpnSite']().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); + }); +} + +/** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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-06-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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { + throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); + } + if (vpnSiteParameters === null || vpnSiteParameters === undefined) { + throw new Error('vpnSiteParameters cannot be null or undefined.'); + } + if (this.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.Network/vpnSites/{vpnSiteName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); + 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 = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vpnSiteParameters !== null && vpnSiteParameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, vpnSiteParameters, 'vpnSiteParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vpnSiteParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ErrorModel']().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['VpnSite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VpnSite']().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); + }); +} + +/** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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 _beginDeleteMethod(resourceGroupName, vpnSiteName, 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-06-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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { + throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); + } + if (this.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.Network/vpnSites/{vpnSiteName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); + 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 = '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 !== 202 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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); + }); +} + +/** + * Lists all the vpnSites in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* 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['ErrorModel']().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['ListVpnSitesResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the VpnSites in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 ListVpnSitesResult} for more information. + * + * {object} [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['ErrorModel']().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['ListVpnSitesResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VpnSites. */ +class VpnSites { + /** + * Create a VpnSites. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Retrieves the details of a VPNsite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being retrieved. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, vpnSiteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being retrieved. + * + * @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 {VpnSite} - 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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vpnSiteName, 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._get(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vpnSiteName, options, optionalCallback); + } + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnSite} - 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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); + } + } + + /** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnSite} - 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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); + } + } + + /** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vpnSiteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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. + */ + deleteMethod(resourceGroupName, vpnSiteName, 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._deleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vpnSiteName, options, optionalCallback); + } + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @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 {ListVpnSitesResult} - 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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - 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; + }); + }); + } + + /** + * Lists all the VpnSites in 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 {ListVpnSitesResult} - 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 ListVpnSitesResult} for more information. + * + * {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); + } + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing + * VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being created or + * updated. + * + * @param {object} vpnSiteParameters Parameters supplied to create or update + * VpnSite. + * + * @param {object} [vpnSiteParameters.virtualWAN] The VirtualWAN to which the + * vpnSite belongs + * + * @param {string} [vpnSiteParameters.virtualWAN.id] Resource ID. + * + * @param {object} [vpnSiteParameters.deviceProperties] The device properties + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of + * the device Vendor. + * + * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of + * the device. + * + * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link + * speed. + * + * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the + * vpn-site. + * + * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be + * used for connections. + * + * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that + * contains an array of IP address ranges. + * + * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of + * address blocks reserved for this virtual network in CIDR notation. + * + * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. + * + * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. + * + * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP + * peering address and BGP identifier of this BGP speaker. + * + * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight + * added to routes learned from this BGP speaker. + * + * @param {string} [vpnSiteParameters.provisioningState] The provisioning state + * of the resource. Possible values include: 'Succeeded', 'Updating', + * 'Deleting', 'Failed' + * + * @param {string} [vpnSiteParameters.id] Resource ID. + * + * @param {string} [vpnSiteParameters.location] Resource location. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnSite} - 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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); + } + } + + /** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates VpnSite tags. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being updated. + * + * @param {object} vpnSiteParameters Parameters supplied to update VpnSite + * tags. + * + * @param {object} [vpnSiteParameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VpnSite} - 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 VpnSite} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); + } + } + + /** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vpnSiteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VpnSite. + * + * @param {string} resourceGroupName The resource group name of the VpnSite. + * + * @param {string} vpnSiteName The name of the VpnSite being deleted. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, vpnSiteName, 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._beginDeleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vpnSiteName, options, optionalCallback); + } + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVpnSitesResult} - 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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {ListVpnSitesResult} - 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 ListVpnSitesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VpnSites; diff --git a/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js b/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js new file mode 100644 index 0000000000..a008dbf71b --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js @@ -0,0 +1,473 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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 _download(resourceGroupName, virtualWANName, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDownload(resourceGroupName, virtualWANName, request, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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 _beginDownload(resourceGroupName, virtualWANName, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { + throw new Error('virtualWANName 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.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.Network/virtualWans/{virtualWANName}/vpnConfiguration'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualWANName}', encodeURIComponent(virtualWANName)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['GetVpnSitesConfigurationRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorModel']().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 VpnSitesConfiguration. */ +class VpnSitesConfiguration { + /** + * Create a VpnSitesConfiguration. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._download = _download; + this._beginDownload = _beginDownload; + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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. + */ + downloadWithHttpOperationResponse(resourceGroupName, virtualWANName, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._download(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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. + */ + download(resourceGroupName, virtualWANName, request, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._download(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._download(resourceGroupName, virtualWANName, request, options, optionalCallback); + } + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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. + */ + beginDownloadWithHttpOperationResponse(resourceGroupName, virtualWANName, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDownload(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource + * group. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} virtualWANName The name of the VirtualWAN for which + * configuration of all vpn-sites is needed. + * + * @param {object} request Parameters supplied to download vpn-sites + * configuration. + * + * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for + * which config is to be downloaded. + * + * @param {string} [request.outputBlobSasUrl] The sas-url to download the + * configurations for vpn-sites + * + * @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. + */ + beginDownload(resourceGroupName, virtualWANName, request, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDownload(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDownload(resourceGroupName, virtualWANName, request, options, optionalCallback); + } + } + +} + +module.exports = VpnSitesConfiguration; diff --git a/lib/services/networkManagement2/lib/package.json b/lib/services/networkManagement2/lib/package.json new file mode 100644 index 0000000000..dd479f1635 --- /dev/null +++ b/lib/services/networkManagement2/lib/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-network", + "author": "Microsoft Corporation", + "description": "NetworkManagementClient Library with typescript type definitions for node", + "version": "", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/networkManagementClient.js", + "types": "./lib/networkManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +} diff --git a/lib/services/networkManagement2/package-lock.json b/lib/services/networkManagement2/package-lock.json new file mode 100644 index 0000000000..5eb7616791 --- /dev/null +++ b/lib/services/networkManagement2/package-lock.json @@ -0,0 +1,473 @@ +{ + "name": "azure-arm-network", + "version": "6.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.10.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.21.tgz", + "integrity": "sha512-87XkD9qDXm8fIax+5y7drx84cXsu34ZZqfB7Cial3Q/2lxSoJ/+DRaWckkCbxP41wFSIrrb939VhzaNxj4eY1w==" + }, + "adal-node": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", + "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "requires": { + "@types/node": "^8.0.47", + "async": ">=0.6.0", + "date-utils": "*", + "jws": "3.x.x", + "request": ">= 2.52.0", + "underscore": ">= 1.3.1", + "uuid": "^3.1.0", + "xmldom": ">= 0.1.x", + "xpath.js": "~1.1.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "^4.14.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-utils": { + "version": "1.2.21", + "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", + "integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "requires": { + "jwa": "^1.1.5", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "~1.35.0" + } + }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + }, + "ms-rest": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.6.tgz", + "integrity": "sha512-M+Lx9P7Wy4TeAk7jqPLwGS1QS1gvxF6Xo+OHv5j1g3Kcb44T/GTUuSjxTKarF6aKyeacZH1ZD++Nt7pcql7dDA==", + "requires": { + "duplexer": "^0.1.1", + "is-buffer": "^1.1.6", + "is-stream": "^1.1.0", + "moment": "^2.21.0", + "request": "^2.87.0", + "through": "^2.3.8", + "tunnel": "0.0.5", + "uuid": "^3.2.1" + } + }, + "ms-rest-azure": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.7.tgz", + "integrity": "sha512-e4lgB0z29Dx4ufu/c+PmEAYY1WXq98GYUBkE+iRx7WsxsN04lrM3B1vj8y+B8rKt7clPUE0niqB9VovVL8zvag==", + "requires": { + "adal-node": "^0.1.28", + "async": "2.6.0", + "moment": "^2.22.2", + "ms-rest": "^2.3.2", + "uuid": "^3.2.1" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "^1.4.1" + } + }, + "tunnel": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.5.tgz", + "integrity": "sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.1.0.tgz", + "integrity": "sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ==" + } + } +} diff --git a/lib/services/networkManagement2/package.json b/lib/services/networkManagement2/package.json index ee0013bb1d..92b6ed492f 100644 --- a/lib/services/networkManagement2/package.json +++ b/lib/services/networkManagement2/package.json @@ -2,21 +2,24 @@ "name": "azure-arm-network", "author": "Microsoft Corporation", "description": "NetworkManagementClient Library with typescript type definitions for node", - "version": "5.3.0", + "version": "6.0.0", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/networkManagementClient.js", "types": "./lib/networkManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/networkManagement2", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md deleted file mode 100644 index dd95909622..0000000000 --- a/lib/services/websiteManagement2/README.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -uid: azure-arm-website -summary: *content - ---- -# Microsoft Azure SDK for Node.js - WebSiteManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-website -``` - -## How to use - -### Authentication, client creation and list appServiceCertificateOrders as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const WebSiteManagementClient = require("azure-arm-website"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new WebSiteManagementClient(creds, subscriptionId); - return client.appServiceCertificateOrders.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js deleted file mode 100644 index 7442dc0ebd..0000000000 --- a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * IP security restriction on an app. - * - */ -class IpSecurityRestriction { - /** - * Create a IpSecurityRestriction. - * @member {string} ipAddress IP address the security restriction is valid - * for. - * It can be in form of pure ipv4 address (required SubnetMask property) or - * CIDR notation such as ipv4/mask (leading bit match). For CIDR, - * SubnetMask property must not be specified. - * @member {string} [subnetMask] Subnet mask for the range of IP addresses - * the restriction is valid for. - * @member {string} [action] Allow or Deny access for this IP range. - * @member {string} [tag] Defines what this IP filter will be used for. This - * is to support IP filtering on proxies. Possible values include: 'Default', - * 'XffProxy' - * @member {number} [priority] Priority of IP restriction rule. - * @member {string} [name] IP restriction rule name. - * @member {string} [description] IP restriction rule description. - */ - constructor() { - } - - /** - * Defines the metadata of IpSecurityRestriction - * - * @returns {object} metadata of IpSecurityRestriction - * - */ - mapper() { - return { - required: false, - serializedName: 'IpSecurityRestriction', - type: { - name: 'Composite', - className: 'IpSecurityRestriction', - modelProperties: { - ipAddress: { - required: true, - serializedName: 'ipAddress', - type: { - name: 'String' - } - }, - subnetMask: { - required: false, - serializedName: 'subnetMask', - type: { - name: 'String' - } - }, - action: { - required: false, - serializedName: 'action', - type: { - name: 'String' - } - }, - tag: { - required: false, - serializedName: 'tag', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'XffProxy' ] - } - }, - priority: { - required: false, - serializedName: 'priority', - type: { - name: 'Number' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json deleted file mode 100644 index 1334d7fee4..0000000000 --- a/lib/services/websiteManagement2/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "azure-arm-website", - "author": "Microsoft Corporation", - "description": "WebSiteManagementClient Library with typescript type definitions for node", - "version": "4.0.0", - "dependencies": { - "ms-rest": "^2.3.3", - "ms-rest-azure": "^2.5.5" - }, - "keywords": [ - "node", - "azure" - ], - "license": "MIT", - "main": "./lib/webSiteManagementClient.js", - "types": "./lib/webSiteManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/websiteManagement2", - "repository": { - "type": "git", - "url": "https://github.com/azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-node/issues" - } -}