From 2554d02319eb29187a8c8c929f810bf8a7111b61 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 29 Mar 2018 17:21:18 -0700 Subject: [PATCH 01/21] Generated from 3c5a775d910055a60fea74423e7b4599f410abe1 (#2609) Network 2018-02 for Go and Python --- .../networkManagement2/lib/LICENSE.txt | 21 + .../lib/lib/models/addressSpace.js | 61 + .../lib/lib/models/applicationGateway.js | 407 + ...icationGatewayAuthenticationCertificate.js | 99 + .../applicationGatewayAvailableSslOptions.js | 151 + ...onGatewayAvailableSslPredefinedPolicies.js | 67 + ...cationGatewayAvailableWafRuleSetsResult.js | 62 + .../applicationGatewayBackendAddress.js | 60 + .../applicationGatewayBackendAddressPool.js | 124 + .../models/applicationGatewayBackendHealth.js | 62 + ...icationGatewayBackendHealthHttpSettings.js | 116 + .../applicationGatewayBackendHealthPool.js | 84 + .../applicationGatewayBackendHealthServer.js | 292 + .../applicationGatewayBackendHttpSettings.js | 214 + .../applicationGatewayConnectionDraining.js | 67 + ...icationGatewayFirewallDisabledRuleGroup.js | 69 + .../models/applicationGatewayFirewallRule.js | 62 + .../applicationGatewayFirewallRuleGroup.js | 81 + .../applicationGatewayFirewallRuleSet.js | 136 + ...plicationGatewayFrontendIPConfiguration.js | 128 + .../models/applicationGatewayFrontendPort.js | 98 + .../models/applicationGatewayHttpListener.js | 150 + .../applicationGatewayIPConfiguration.js | 103 + .../models/applicationGatewayListResult.js | 67 + .../lib/models/applicationGatewayPathRule.js | 138 + .../lib/lib/models/applicationGatewayProbe.js | 180 + ...licationGatewayProbeHealthResponseMatch.js | 69 + ...applicationGatewayRedirectConfiguration.js | 177 + .../applicationGatewayRequestRoutingRule.js | 155 + .../lib/lib/models/applicationGatewaySku.js | 72 + .../applicationGatewaySslCertificate.js | 118 + .../lib/models/applicationGatewaySslPolicy.js | 105 + .../applicationGatewaySslPredefinedPolicy.js | 89 + .../models/applicationGatewayUrlPathMap.js | 141 + ...ewayWebApplicationFirewallConfiguration.js | 118 + .../lib/models/applicationSecurityGroup.js | 125 + .../applicationSecurityGroupListResult.js | 68 + .../lib/lib/models/authorizationListResult.js | 68 + .../lib/lib/models/availability.js | 68 + .../lib/lib/models/availableProvidersList.js | 62 + .../lib/models/availableProvidersListCity.js | 67 + .../models/availableProvidersListCountry.js | 85 + .../availableProvidersListParameters.js | 83 + .../lib/models/availableProvidersListState.js | 85 + .../lib/models/azureAsyncOperationResult.js | 77 + .../lib/lib/models/azureReachabilityReport.js | 84 + .../lib/models/azureReachabilityReportItem.js | 79 + .../azureReachabilityReportLatencyInfo.js | 65 + .../models/azureReachabilityReportLocation.js | 68 + .../azureReachabilityReportParameters.js | 105 + .../lib/lib/models/bGPCommunity.js | 106 + .../lib/lib/models/backendAddressPool.js | 130 + .../lib/lib/models/bgpPeerStatus.js | 119 + .../lib/lib/models/bgpPeerStatusListResult.js | 62 + .../lib/lib/models/bgpServiceCommunity.js | 116 + .../models/bgpServiceCommunityListResult.js | 67 + .../lib/lib/models/bgpSettings.js | 70 + .../lib/lib/models/connectionMonitor.js | 116 + .../models/connectionMonitorDestination.js | 70 + .../lib/models/connectionMonitorListResult.js | 59 + .../lib/models/connectionMonitorParameters.js | 93 + .../models/connectionMonitorQueryResult.js | 62 + .../lib/lib/models/connectionMonitorResult.js | 183 + .../lib/lib/models/connectionMonitorSource.js | 61 + .../lib/models/connectionResetSharedKey.js | 57 + .../lib/lib/models/connectionSharedKey.js | 52 + .../lib/lib/models/connectionStateSnapshot.js | 98 + .../lib/lib/models/connectivityDestination.js | 71 + .../lib/lib/models/connectivityHop.js | 116 + .../lib/lib/models/connectivityInformation.js | 119 + .../lib/lib/models/connectivityIssue.js | 99 + .../lib/lib/models/connectivityParameters.js | 74 + .../lib/lib/models/connectivitySource.js | 62 + .../lib/lib/models/ddosProtectionPlan.js | 143 + .../models/ddosProtectionPlanListResult.js | 68 + .../lib/lib/models/dhcpOptions.js | 61 + .../lib/lib/models/dimension.js | 68 + .../lib/models/dnsNameAvailabilityResult.js | 52 + .../models/effectiveNetworkSecurityGroup.js | 111 + ...ffectiveNetworkSecurityGroupAssociation.js | 67 + ...effectiveNetworkSecurityGroupListResult.js | 71 + .../models/effectiveNetworkSecurityRule.js | 225 + .../lib/lib/models/effectiveRoute.js | 116 + .../lib/models/effectiveRouteListResult.js | 71 + .../lib/lib/models/endpointServiceResult.js | 73 + .../lib/models/endpointServicesListResult.js | 67 + .../lib/lib/models/errorDetails.js | 67 + .../lib/lib/models/errorModel.js | 93 + .../lib/lib/models/expressRouteCircuit.js | 228 + .../lib/models/expressRouteCircuitArpTable.js | 76 + .../expressRouteCircuitAuthorization.js | 102 + .../models/expressRouteCircuitConnection.js | 135 + .../models/expressRouteCircuitListResult.js | 67 + .../lib/models/expressRouteCircuitPeering.js | 309 + .../expressRouteCircuitPeeringConfig.js | 113 + .../expressRouteCircuitPeeringListResult.js | 68 + .../models/expressRouteCircuitReference.js | 51 + .../models/expressRouteCircuitRoutesTable.js | 84 + .../expressRouteCircuitRoutesTableSummary.js | 87 + ...ssRouteCircuitServiceProviderProperties.js | 68 + .../lib/lib/models/expressRouteCircuitSku.js | 71 + .../lib/models/expressRouteCircuitStats.js | 76 + .../expressRouteCircuitsArpTableListResult.js | 70 + ...pressRouteCircuitsRoutesTableListResult.js | 70 + ...uteCircuitsRoutesTableSummaryListResult.js | 70 + .../lib/models/expressRouteCrossConnection.js | 207 + .../expressRouteCrossConnectionListResult.js | 68 + .../expressRouteCrossConnectionPeering.js | 266 + .../expressRouteCrossConnectionPeeringList.js | 69 + ...sRouteCrossConnectionRoutesTableSummary.js | 80 + ...ConnectionsRoutesTableSummaryListResult.js | 72 + .../lib/models/expressRouteServiceProvider.js | 132 + ...ssRouteServiceProviderBandwidthsOffered.js | 60 + .../expressRouteServiceProviderListResult.js | 67 + .../lib/lib/models/flowLogInformation.js | 85 + .../lib/lib/models/flowLogStatusParameters.js | 53 + .../lib/lib/models/frontendIPConfiguration.js | 374 + .../lib/lib/models/gatewayRoute.js | 107 + .../lib/lib/models/gatewayRouteListResult.js | 62 + .../lib/models/iPAddressAvailabilityResult.js | 68 + .../lib/lib/models/iPConfiguration.js | 207 + .../lib/lib/models/inboundNatPool.js | 155 + .../lib/lib/models/inboundNatRule.js | 389 + .../lib/models/inboundNatRuleListResult.js | 68 + .../lib/lib/models/index.d.ts | 6789 ++++ .../lib/lib/models/index.js | 250 + .../lib/lib/models/ipTag.js | 62 + .../lib/lib/models/ipsecPolicy.js | 124 + .../ipv6ExpressRouteCircuitPeeringConfig.js | 115 + .../lib/lib/models/loadBalancer.js | 260 + ...oadBalancerBackendAddressPoolListResult.js | 68 + ...lancerFrontendIPConfigurationListResult.js | 68 + .../lib/lib/models/loadBalancerListResult.js | 68 + ...loadBalancerLoadBalancingRuleListResult.js | 68 + .../lib/models/loadBalancerProbeListResult.js | 68 + .../lib/lib/models/loadBalancerSku.js | 53 + .../lib/lib/models/loadBalancingRule.js | 187 + .../lib/lib/models/localNetworkGateway.js | 156 + .../models/localNetworkGatewayListResult.js | 68 + .../lib/lib/models/logSpecification.js | 68 + .../lib/lib/models/metricSpecification.js | 178 + .../lib/lib/models/networkInterface.js | 233 + .../lib/models/networkInterfaceAssociation.js | 71 + .../lib/models/networkInterfaceDnsSettings.js | 109 + .../models/networkInterfaceIPConfiguration.js | 374 + ...tworkInterfaceIPConfigurationListResult.js | 68 + .../lib/models/networkInterfaceListResult.js | 68 + .../networkInterfaceLoadBalancerListResult.js | 68 + .../lib/lib/models/networkSecurityGroup.js | 188 + .../models/networkSecurityGroupListResult.js | 67 + .../lib/lib/models/networkWatcher.js | 112 + .../lib/models/networkWatcherListResult.js | 59 + .../lib/lib/models/nextHopParameters.js | 79 + .../lib/lib/models/nextHopResult.js | 73 + .../lib/lib/models/operation.js | 90 + .../lib/lib/models/operationDisplay.js | 77 + .../lib/lib/models/operationListResult.js | 69 + ...ionPropertiesFormatServiceSpecification.js | 78 + .../lib/lib/models/outboundNatRule.js | 120 + .../lib/lib/models/packetCapture.js | 120 + .../lib/lib/models/packetCaptureFilter.js | 101 + .../lib/lib/models/packetCaptureListResult.js | 59 + .../lib/lib/models/packetCaptureParameters.js | 120 + .../models/packetCaptureQueryStatusResult.js | 104 + .../lib/lib/models/packetCaptureResult.js | 158 + .../models/packetCaptureStorageLocation.js | 74 + .../lib/lib/models/patchRouteFilter.js | 144 + .../lib/lib/models/patchRouteFilterRule.js | 120 + .../lib/lib/models/probe.js | 155 + .../lib/lib/models/publicIPAddress.js | 305 + .../lib/models/publicIPAddressDnsSettings.js | 78 + .../lib/models/publicIPAddressListResult.js | 67 + .../lib/lib/models/publicIPAddressSku.js | 53 + .../models/queryTroubleshootingParameters.js | 53 + .../lib/lib/models/resource.js | 97 + .../lib/lib/models/resourceNavigationLink.js | 101 + .../lib/models/retentionPolicyParameters.js | 64 + .../lib/lib/models/route.js | 113 + .../lib/lib/models/routeFilter.js | 147 + .../lib/lib/models/routeFilterListResult.js | 67 + .../lib/lib/models/routeFilterRule.js | 127 + .../lib/models/routeFilterRuleListResult.js | 67 + .../lib/lib/models/routeListResult.js | 67 + .../lib/lib/models/routeTable.js | 153 + .../lib/lib/models/routeTableListResult.js | 67 + .../models/securityGroupNetworkInterface.js | 78 + .../lib/models/securityGroupViewParameters.js | 52 + .../lib/lib/models/securityGroupViewResult.js | 63 + .../lib/lib/models/securityRule.js | 269 + .../lib/models/securityRuleAssociations.js | 104 + .../lib/lib/models/securityRuleListResult.js | 68 + .../models/serviceEndpointPropertiesFormat.js | 76 + .../lib/lib/models/subResource.js | 56 + .../lib/lib/models/subnet.js | 186 + .../lib/lib/models/subnetAssociation.js | 71 + .../lib/lib/models/subnetListResult.js | 68 + .../lib/lib/models/tagsObject.js | 59 + .../lib/lib/models/topology.js | 91 + .../lib/lib/models/topologyAssociation.js | 72 + .../lib/lib/models/topologyParameters.js | 76 + .../lib/lib/models/topologyResource.js | 87 + .../lib/lib/models/troubleshootingDetails.js | 94 + .../lib/models/troubleshootingParameters.js | 70 + .../troubleshootingRecommendedActions.js | 78 + .../lib/lib/models/troubleshootingResult.js | 86 + .../lib/lib/models/tunnelConnectionHealth.js | 94 + .../lib/lib/models/usage.js | 92 + .../lib/lib/models/usageName.js | 61 + .../lib/lib/models/usagesListResult.js | 67 + .../models/verificationIPFlowParameters.js | 119 + .../lib/models/verificationIPFlowResult.js | 62 + .../lib/lib/models/virtualNetwork.js | 210 + ...irtualNetworkConnectionGatewayReference.js | 53 + .../lib/lib/models/virtualNetworkGateway.js | 251 + .../models/virtualNetworkGatewayConnection.js | 447 + ...rtualNetworkGatewayConnectionListEntity.js | 285 + ...rtualNetworkGatewayConnectionListResult.js | 68 + .../virtualNetworkGatewayIPConfiguration.js | 114 + ...tualNetworkGatewayListConnectionsResult.js | 68 + .../models/virtualNetworkGatewayListResult.js | 68 + .../lib/models/virtualNetworkGatewaySku.js | 72 + .../lib/models/virtualNetworkListResult.js | 67 + .../models/virtualNetworkListUsageResult.js | 68 + .../lib/lib/models/virtualNetworkPeering.js | 159 + .../models/virtualNetworkPeeringListResult.js | 68 + .../lib/lib/models/virtualNetworkUsage.js | 97 + .../lib/lib/models/virtualNetworkUsageName.js | 62 + .../lib/lib/models/vpnClientConfiguration.js | 143 + .../lib/models/vpnClientIPsecParameters.js | 122 + .../lib/lib/models/vpnClientParameters.js | 92 + .../lib/models/vpnClientRevokedCertificate.js | 93 + .../lib/models/vpnClientRootCertificate.js | 92 + .../lib/models/vpnDeviceScriptParameters.js | 69 + .../lib/lib/networkManagementClient.d.ts | 166 + .../lib/lib/networkManagementClient.js | 366 + .../lib/lib/operations/applicationGateways.js | 5326 +++ .../operations/applicationSecurityGroups.js | 1995 + .../operations/availableEndpointServices.js | 467 + .../lib/operations/bgpServiceCommunities.js | 457 + .../lib/lib/operations/connectionMonitors.js | 2760 ++ .../lib/lib/operations/ddosProtectionPlans.js | 1974 + .../lib/operations/defaultSecurityRules.js | 728 + .../expressRouteCircuitAuthorizations.js | 1676 + .../expressRouteCircuitConnections.js | 1348 + .../operations/expressRouteCircuitPeerings.js | 2330 ++ .../lib/operations/expressRouteCircuits.js | 4511 +++ .../expressRouteCrossConnectionPeerings.js | 2150 ++ .../expressRouteCrossConnections.js | 3466 ++ .../expressRouteServiceProviders.js | 457 + .../lib/lib/operations/inboundNatRules.js | 1815 + .../lib/lib/operations/index.d.ts | 30651 ++++++++++++++++ .../lib/lib/operations/index.js | 57 + .../loadBalancerBackendAddressPools.js | 719 + .../loadBalancerFrontendIPConfigurations.js | 728 + .../loadBalancerLoadBalancingRules.js | 719 + .../loadBalancerNetworkInterfaces.js | 477 + .../lib/lib/operations/loadBalancerProbes.js | 719 + .../lib/lib/operations/loadBalancers.js | 2701 ++ .../lib/operations/localNetworkGateways.js | 2191 ++ .../networkInterfaceIPConfigurations.js | 721 + .../networkInterfaceLoadBalancers.js | 477 + .../lib/lib/operations/networkInterfaces.js | 5674 +++ .../lib/operations/networkSecurityGroups.js | 2548 ++ .../lib/lib/operations/networkWatchers.js | 7202 ++++ .../lib/lib/operations/operations.js | 449 + .../lib/lib/operations/packetCaptures.js | 2323 ++ .../lib/lib/operations/publicIPAddresses.js | 3981 ++ .../lib/lib/operations/routeFilterRules.js | 2162 ++ .../lib/lib/operations/routeFilters.js | 2510 ++ .../lib/lib/operations/routeTables.js | 2495 ++ .../lib/lib/operations/routes.js | 1708 + .../lib/lib/operations/securityRules.js | 2006 + .../lib/lib/operations/subnets.js | 1991 + .../lib/lib/operations/usages.js | 469 + .../virtualNetworkGatewayConnections.js | 4221 +++ .../lib/operations/virtualNetworkGateways.js | 7822 ++++ .../lib/operations/virtualNetworkPeerings.js | 1883 + .../lib/lib/operations/virtualNetworks.js | 3360 ++ .../networkManagement2/lib/package.json | 22 + 279 files changed, 156560 insertions(+) create mode 100644 lib/services/networkManagement2/lib/LICENSE.txt create mode 100644 lib/services/networkManagement2/lib/lib/models/addressSpace.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGateway.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayAuthenticationCertificate.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslOptions.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayAvailableWafRuleSetsResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddress.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendAddressPool.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealth.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthHttpSettings.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthPool.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHealthServer.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayBackendHttpSettings.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayConnectionDraining.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallDisabledRuleGroup.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleGroup.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFirewallRuleSet.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayFrontendPort.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayHttpListener.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayPathRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayProbe.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayProbeHealthResponseMatch.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayRedirectConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayRequestRoutingRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewaySku.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewaySslCertificate.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPolicy.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewaySslPredefinedPolicy.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayUrlPathMap.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationSecurityGroup.js create mode 100644 lib/services/networkManagement2/lib/lib/models/applicationSecurityGroupListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/authorizationListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availability.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availableProvidersList.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availableProvidersListCity.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availableProvidersListCountry.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availableProvidersListParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/availableProvidersListState.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureAsyncOperationResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureReachabilityReport.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureReachabilityReportItem.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLatencyInfo.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureReachabilityReportLocation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/azureReachabilityReportParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bGPCommunity.js create mode 100644 lib/services/networkManagement2/lib/lib/models/backendAddressPool.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bgpPeerStatus.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bgpPeerStatusListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bgpServiceCommunity.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bgpServiceCommunityListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/bgpSettings.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitor.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorDestination.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorQueryResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionMonitorSource.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionResetSharedKey.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionSharedKey.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectionStateSnapshot.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivityDestination.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivityHop.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivityInformation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivityIssue.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivityParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/connectivitySource.js create mode 100644 lib/services/networkManagement2/lib/lib/models/ddosProtectionPlan.js create mode 100644 lib/services/networkManagement2/lib/lib/models/ddosProtectionPlanListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/dhcpOptions.js create mode 100644 lib/services/networkManagement2/lib/lib/models/dimension.js create mode 100644 lib/services/networkManagement2/lib/lib/models/dnsNameAvailabilityResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroup.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupAssociation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityGroupListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveNetworkSecurityRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveRoute.js create mode 100644 lib/services/networkManagement2/lib/lib/models/effectiveRouteListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/endpointServiceResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/endpointServicesListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/errorDetails.js create mode 100644 lib/services/networkManagement2/lib/lib/models/errorModel.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuit.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitArpTable.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitAuthorization.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitConnection.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeering.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringConfig.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitPeeringListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitReference.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTable.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitRoutesTableSummary.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitServiceProviderProperties.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitSku.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitStats.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsArpTableListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnection.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeering.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionPeeringList.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionRoutesTableSummary.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteServiceProvider.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderBandwidthsOffered.js create mode 100644 lib/services/networkManagement2/lib/lib/models/expressRouteServiceProviderListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/flowLogInformation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/flowLogStatusParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/frontendIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/gatewayRoute.js create mode 100644 lib/services/networkManagement2/lib/lib/models/gatewayRouteListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/iPAddressAvailabilityResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/iPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/inboundNatPool.js create mode 100644 lib/services/networkManagement2/lib/lib/models/inboundNatRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/inboundNatRuleListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/index.d.ts create mode 100644 lib/services/networkManagement2/lib/lib/models/index.js create mode 100644 lib/services/networkManagement2/lib/lib/models/ipTag.js create mode 100644 lib/services/networkManagement2/lib/lib/models/ipsecPolicy.js create mode 100644 lib/services/networkManagement2/lib/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancer.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerBackendAddressPoolListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerFrontendIPConfigurationListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerLoadBalancingRuleListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerProbeListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancerSku.js create mode 100644 lib/services/networkManagement2/lib/lib/models/loadBalancingRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/localNetworkGateway.js create mode 100644 lib/services/networkManagement2/lib/lib/models/localNetworkGatewayListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/logSpecification.js create mode 100644 lib/services/networkManagement2/lib/lib/models/metricSpecification.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterface.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceAssociation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceDnsSettings.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceIPConfigurationListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkInterfaceLoadBalancerListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkSecurityGroup.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkSecurityGroupListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkWatcher.js create mode 100644 lib/services/networkManagement2/lib/lib/models/networkWatcherListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/nextHopParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/nextHopResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/operation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/operationDisplay.js create mode 100644 lib/services/networkManagement2/lib/lib/models/operationListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/operationPropertiesFormatServiceSpecification.js create mode 100644 lib/services/networkManagement2/lib/lib/models/outboundNatRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCapture.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureFilter.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureQueryStatusResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/packetCaptureStorageLocation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/patchRouteFilter.js create mode 100644 lib/services/networkManagement2/lib/lib/models/patchRouteFilterRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/probe.js create mode 100644 lib/services/networkManagement2/lib/lib/models/publicIPAddress.js create mode 100644 lib/services/networkManagement2/lib/lib/models/publicIPAddressDnsSettings.js create mode 100644 lib/services/networkManagement2/lib/lib/models/publicIPAddressListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/publicIPAddressSku.js create mode 100644 lib/services/networkManagement2/lib/lib/models/queryTroubleshootingParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/resource.js create mode 100644 lib/services/networkManagement2/lib/lib/models/resourceNavigationLink.js create mode 100644 lib/services/networkManagement2/lib/lib/models/retentionPolicyParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/route.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeFilter.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeFilterListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeFilterRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeFilterRuleListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeTable.js create mode 100644 lib/services/networkManagement2/lib/lib/models/routeTableListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityGroupNetworkInterface.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityGroupViewParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityGroupViewResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityRule.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityRuleAssociations.js create mode 100644 lib/services/networkManagement2/lib/lib/models/securityRuleListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/serviceEndpointPropertiesFormat.js create mode 100644 lib/services/networkManagement2/lib/lib/models/subResource.js create mode 100644 lib/services/networkManagement2/lib/lib/models/subnet.js create mode 100644 lib/services/networkManagement2/lib/lib/models/subnetAssociation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/subnetListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/tagsObject.js create mode 100644 lib/services/networkManagement2/lib/lib/models/topology.js create mode 100644 lib/services/networkManagement2/lib/lib/models/topologyAssociation.js create mode 100644 lib/services/networkManagement2/lib/lib/models/topologyParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/topologyResource.js create mode 100644 lib/services/networkManagement2/lib/lib/models/troubleshootingDetails.js create mode 100644 lib/services/networkManagement2/lib/lib/models/troubleshootingParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/troubleshootingRecommendedActions.js create mode 100644 lib/services/networkManagement2/lib/lib/models/troubleshootingResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/tunnelConnectionHealth.js create mode 100644 lib/services/networkManagement2/lib/lib/models/usage.js create mode 100644 lib/services/networkManagement2/lib/lib/models/usageName.js create mode 100644 lib/services/networkManagement2/lib/lib/models/usagesListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/verificationIPFlowParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/verificationIPFlowResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetwork.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkConnectionGatewayReference.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGateway.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnection.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListEntity.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayConnectionListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListConnectionsResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewayListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkGatewaySku.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkListUsageResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkPeering.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkPeeringListResult.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkUsage.js create mode 100644 lib/services/networkManagement2/lib/lib/models/virtualNetworkUsageName.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnClientConfiguration.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnClientIPsecParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnClientParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnClientRevokedCertificate.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnClientRootCertificate.js create mode 100644 lib/services/networkManagement2/lib/lib/models/vpnDeviceScriptParameters.js create mode 100644 lib/services/networkManagement2/lib/lib/networkManagementClient.d.ts create mode 100644 lib/services/networkManagement2/lib/lib/networkManagementClient.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/applicationGateways.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/applicationSecurityGroups.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/availableEndpointServices.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/bgpServiceCommunities.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/connectionMonitors.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/ddosProtectionPlans.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/defaultSecurityRules.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitAuthorizations.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitConnections.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCircuitPeerings.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCircuits.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnectionPeerings.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteCrossConnections.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/expressRouteServiceProviders.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/inboundNatRules.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/index.d.ts create mode 100644 lib/services/networkManagement2/lib/lib/operations/index.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancerBackendAddressPools.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancerFrontendIPConfigurations.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancerLoadBalancingRules.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancerNetworkInterfaces.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancerProbes.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/loadBalancers.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/localNetworkGateways.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/networkInterfaceIPConfigurations.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/networkInterfaceLoadBalancers.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/networkInterfaces.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/networkSecurityGroups.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/networkWatchers.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/operations.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/packetCaptures.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/publicIPAddresses.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/routeFilterRules.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/routeFilters.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/routeTables.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/routes.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/securityRules.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/subnets.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/usages.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/virtualNetworkGatewayConnections.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/virtualNetworkGateways.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/virtualNetworkPeerings.js create mode 100644 lib/services/networkManagement2/lib/lib/operations/virtualNetworks.js create mode 100644 lib/services/networkManagement2/lib/package.json 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/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" + } +} From c39bd06317e82b2d0309ed249ae3436bebb00d2b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 2 Apr 2018 15:00:31 -0700 Subject: [PATCH 02/21] [AutoPR network/resource-manager] fix the Version for vmss public ip and nic (#2632) * Generated from 7ad48d8f71799eed22d68bc6052c27714794a3d8 fix the veresion for vmss public ip and nic * Generated from 73c74aeee09b81dbe99d66c083439dc4ce62cf9d fix versions in other files --- lib/services/networkManagement2/LICENSE.txt | 42 +- .../lib/models/applicationGateway.js | 4 + .../applicationGatewayBackendHealthServer.js | 2 + ...ewayWebApplicationFirewallConfiguration.js | 21 + .../lib/models/connectionMonitor.js | 116 + .../models/connectionMonitorDestination.js | 70 + .../lib/models/connectionMonitorListResult.js | 59 + .../lib/models/connectionMonitorParameters.js | 93 + .../models/connectionMonitorQueryResult.js | 71 + .../lib/models/connectionMonitorResult.js | 183 + .../lib/models/connectionMonitorSource.js | 61 + .../lib/models/connectionStateSnapshot.js | 98 + .../lib/models/connectivityParameters.js | 25 + .../lib/models/ddosProtectionPlan.js | 143 + .../models/ddosProtectionPlanListResult.js | 68 + .../models/expressRouteCircuitConnection.js | 135 + .../lib/models/expressRouteCircuitPeering.js | 31 +- .../models/expressRouteCircuitReference.js | 51 + .../lib/models/expressRouteCrossConnection.js | 207 + .../expressRouteCrossConnectionListResult.js | 68 + .../expressRouteCrossConnectionPeering.js | 266 + .../expressRouteCrossConnectionPeeringList.js | 69 + ...sRouteCrossConnectionRoutesTableSummary.js | 80 + ...ConnectionsRoutesTableSummaryListResult.js | 72 + .../lib/models/frontendIPConfiguration.js | 2 + .../lib/models/hTTPConfiguration.js | 85 + .../lib/models/hTTPHeader.js | 60 + .../lib/models/iPConfiguration.js | 2 + .../lib/models/inboundNatPool.js | 23 + .../lib/models/inboundNatRule.js | 2 + .../networkManagement2/lib/models/index.d.ts | 755 +- .../networkManagement2/lib/models/index.js | 25 +- .../networkManagement2/lib/models/ipTag.js | 62 + .../lib/models/ipsecPolicy.js | 10 +- .../models/networkInterfaceIPConfiguration.js | 2 + .../lib/models/patchRouteFilterRule.js | 15 - .../lib/models/protocolConfiguration.js | 59 + .../lib/models/publicIPAddress.js | 17 + .../lib/models/routeFilterRule.js | 15 - .../lib/models/virtualNetwork.js | 21 +- .../lib/models/virtualNetworkGateway.js | 2 + .../models/virtualNetworkGatewayConnection.js | 6 + .../lib/models/vpnClientConfiguration.js | 17 + .../lib/models/vpnClientIPsecParameters.js | 122 + .../lib/networkManagementClient.d.ts | 9 +- .../lib/networkManagementClient.js | 10 +- .../lib/operations/applicationGateways.js | 82 +- .../operations/applicationSecurityGroups.js | 18 +- .../operations/availableEndpointServices.js | 2 +- .../lib/operations/bgpServiceCommunities.js | 2 +- .../lib/operations/connectionMonitors.js | 2746 ++++ .../lib/operations/ddosProtectionPlans.js | 1964 +++ .../lib/operations/defaultSecurityRules.js | 4 +- .../expressRouteCircuitAuthorizations.js | 16 +- .../expressRouteCircuitConnections.js | 1342 ++ .../operations/expressRouteCircuitPeerings.js | 98 +- .../lib/operations/expressRouteCircuits.js | 30 +- .../expressRouteCrossConnectionPeerings.js | 2142 +++ .../expressRouteCrossConnections.js | 3450 ++++ .../expressRouteServiceProviders.js | 2 +- .../lib/operations/inboundNatRules.js | 16 +- .../lib/operations/index.d.ts | 13144 +++++++++++----- .../lib/operations/index.js | 5 + .../loadBalancerBackendAddressPools.js | 4 +- .../loadBalancerFrontendIPConfigurations.js | 4 +- .../loadBalancerLoadBalancingRules.js | 4 +- .../loadBalancerNetworkInterfaces.js | 2 +- .../lib/operations/loadBalancerProbes.js | 4 +- .../lib/operations/loadBalancers.js | 20 +- .../lib/operations/localNetworkGateways.js | 18 +- .../networkInterfaceIPConfigurations.js | 4 +- .../networkInterfaceLoadBalancers.js | 2 +- .../lib/operations/networkInterfaces.js | 24 +- .../lib/operations/networkSecurityGroups.js | 20 +- .../lib/operations/networkWatchers.js | 136 +- .../lib/operations/operations.js | 2 +- .../lib/operations/packetCaptures.js | 14 +- .../lib/operations/publicIPAddresses.js | 38 +- .../lib/operations/routeFilterRules.js | 36 +- .../lib/operations/routeFilters.js | 14 +- .../lib/operations/routeTables.js | 14 +- .../lib/operations/routes.js | 10 +- .../lib/operations/securityRules.js | 10 +- .../lib/operations/subnets.js | 10 +- .../lib/operations/usages.js | 2 +- .../virtualNetworkGatewayConnections.js | 46 +- .../lib/operations/virtualNetworkGateways.js | 1263 +- .../lib/operations/virtualNetworkPeerings.js | 10 +- .../lib/operations/virtualNetworks.js | 90 +- lib/services/networkManagement2/package.json | 35 +- 90 files changed, 25363 insertions(+), 4892 deletions(-) create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitor.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorDestination.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorListResult.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorParameters.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorResult.js create mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorSource.js create mode 100644 lib/services/networkManagement2/lib/models/connectionStateSnapshot.js create mode 100644 lib/services/networkManagement2/lib/models/ddosProtectionPlan.js create mode 100644 lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js create mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js create mode 100644 lib/services/networkManagement2/lib/models/hTTPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/models/hTTPHeader.js create mode 100644 lib/services/networkManagement2/lib/models/ipTag.js create mode 100644 lib/services/networkManagement2/lib/models/protocolConfiguration.js create mode 100644 lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js create mode 100644 lib/services/networkManagement2/lib/operations/connectionMonitors.js create mode 100644 lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js create mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js create mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js create mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js diff --git a/lib/services/networkManagement2/LICENSE.txt b/lib/services/networkManagement2/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/networkManagement2/LICENSE.txt +++ b/lib/services/networkManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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. \ No newline at end of file +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/models/applicationGateway.js b/lib/services/networkManagement2/lib/models/applicationGateway.js index 2b1ee1b006..47ddea3f90 100644 --- a/lib/services/networkManagement2/lib/models/applicationGateway.js +++ b/lib/services/networkManagement2/lib/models/applicationGateway.js @@ -82,6 +82,10 @@ class ApplicationGateway extends models['Resource'] { * 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 diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js index bea1e6adb1..1c0b56e51c 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js @@ -215,6 +215,8 @@ class ApplicationGatewayBackendHealthServer { * 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] diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js index e5975e174d..188a421193 100644 --- a/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js +++ b/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js @@ -27,6 +27,9 @@ class ApplicationGatewayWebApplicationFirewallConfiguration { * 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() { } @@ -87,6 +90,24 @@ class ApplicationGatewayWebApplicationFirewallConfiguration { } } } + }, + requestBodyCheck: { + required: false, + serializedName: 'requestBodyCheck', + type: { + name: 'Boolean' + } + }, + maxRequestBodySize: { + required: false, + serializedName: 'maxRequestBodySize', + constraints: { + InclusiveMaximum: 128, + InclusiveMinimum: 8 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/networkManagement2/lib/models/connectionMonitor.js b/lib/services/networkManagement2/lib/models/connectionMonitor.js new file mode 100644 index 0000000000..d690fcf86d --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionMonitorDestination.js b/lib/services/networkManagement2/lib/models/connectionMonitorDestination.js new file mode 100644 index 0000000000..063b721c85 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionMonitorListResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorListResult.js new file mode 100644 index 0000000000..d9a476a324 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionMonitorParameters.js b/lib/services/networkManagement2/lib/models/connectionMonitorParameters.js new file mode 100644 index 0000000000..513f5d6b79 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionMonitorQueryResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js new file mode 100644 index 0000000000..e5040f8fa3 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.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'); + +/** + * List of connection states snaphots. + * + */ +class ConnectionMonitorQueryResult { + /** + * Create a ConnectionMonitorQueryResult. + * @member {string} [sourceStatus] Status of connection monitor source. + * Possible values include: 'Uknown', 'Active', 'Inactive' + * @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: { + sourceStatus: { + required: false, + serializedName: 'sourceStatus', + type: { + name: 'String' + } + }, + 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/models/connectionMonitorResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorResult.js new file mode 100644 index 0000000000..a26ce4b8f8 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionMonitorSource.js b/lib/services/networkManagement2/lib/models/connectionMonitorSource.js new file mode 100644 index 0000000000..135c604d84 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectionStateSnapshot.js b/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js new file mode 100644 index 0000000000..ccf3aeec06 --- /dev/null +++ b/lib/services/networkManagement2/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/models/connectivityParameters.js b/lib/services/networkManagement2/lib/models/connectivityParameters.js index 28edbba72a..5177d874fd 100644 --- a/lib/services/networkManagement2/lib/models/connectivityParameters.js +++ b/lib/services/networkManagement2/lib/models/connectivityParameters.js @@ -31,6 +31,16 @@ class ConnectivityParameters { * to which a connection attempt will be made. * @member {number} [destination.port] Port on which check connectivity will * be performed. + * @member {string} [protocol] Network protocol. Possible values include: + * 'Tcp', 'Http', 'Https', 'Icmp' + * @member {object} [protocolConfiguration] + * @member {object} [protocolConfiguration.hTTPConfiguration] + * @member {string} [protocolConfiguration.hTTPConfiguration.method] HTTP + * method. Possible values include: 'Get' + * @member {array} [protocolConfiguration.hTTPConfiguration.headers] List of + * HTTP headers. + * @member {array} [protocolConfiguration.hTTPConfiguration.validStatusCodes] + * Valid status codes. */ constructor() { } @@ -64,6 +74,21 @@ class ConnectivityParameters { name: 'Composite', className: 'ConnectivityDestination' } + }, + protocol: { + required: false, + serializedName: 'protocol', + type: { + name: 'String' + } + }, + protocolConfiguration: { + required: false, + serializedName: 'protocolConfiguration', + type: { + name: 'Composite', + className: 'ProtocolConfiguration' + } } } } diff --git a/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js b/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js new file mode 100644 index 0000000000..d246e24d1f --- /dev/null +++ b/lib/services/networkManagement2/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/models/ddosProtectionPlanListResult.js b/lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js new file mode 100644 index 0000000000..076979f5cd --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCircuitConnection.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js new file mode 100644 index 0000000000..053141896d --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCircuitPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js index bf2fd98924..d965a8eb65 100644 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js +++ b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js @@ -20,12 +20,10 @@ const models = require('./index'); class ExpressRouteCircuitPeering extends models['SubResource'] { /** * Create a ExpressRouteCircuitPeering. - * @member {string} [peeringType] The PeeringType. Possible values are: - * 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. - * Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * @member {string} [state] The state of peering. Possible values are: - * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + * @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. @@ -113,6 +111,8 @@ class ExpressRouteCircuitPeering extends models['SubResource'] { * @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 @@ -167,6 +167,10 @@ class ExpressRouteCircuitPeering extends models['SubResource'] { peerASN: { required: false, serializedName: 'properties.peerASN', + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 1 + }, type: { name: 'Number' } @@ -266,6 +270,21 @@ class ExpressRouteCircuitPeering extends models['SubResource'] { 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', diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js new file mode 100644 index 0000000000..d7c4e7081c --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnection.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js new file mode 100644 index 0000000000..21e3b6f300 --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnectionListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js new file mode 100644 index 0000000000..b96c2712da --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnectionPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js new file mode 100644 index 0000000000..31abfbf098 --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnectionPeeringList.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js new file mode 100644 index 0000000000..5f35071118 --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnectionRoutesTableSummary.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js new file mode 100644 index 0000000000..20f7e76770 --- /dev/null +++ b/lib/services/networkManagement2/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/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js new file mode 100644 index 0000000000..cb01c31a22 --- /dev/null +++ b/lib/services/networkManagement2/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/models/frontendIPConfiguration.js b/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js index 1e90c90edf..561dccc025 100644 --- a/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js @@ -186,6 +186,8 @@ class FrontendIPConfiguration extends models['SubResource'] { * 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 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/hTTPHeader.js b/lib/services/networkManagement2/lib/models/hTTPHeader.js new file mode 100644 index 0000000000..fd5ca3516c --- /dev/null +++ b/lib/services/networkManagement2/lib/models/hTTPHeader.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'; + +/** + * Describes the HTTP header. + * + */ +class HTTPHeader { + /** + * Create a HTTPHeader. + * @member {string} [name] The name in HTTP header. + * @member {string} [value] The value in HTTP header. + */ + constructor() { + } + + /** + * Defines the metadata of HTTPHeader + * + * @returns {object} metadata of HTTPHeader + * + */ + mapper() { + return { + required: false, + serializedName: 'HTTPHeader', + type: { + name: 'Composite', + className: 'HTTPHeader', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HTTPHeader; diff --git a/lib/services/networkManagement2/lib/models/iPConfiguration.js b/lib/services/networkManagement2/lib/models/iPConfiguration.js index d5879e150a..dbdb4959c8 100644 --- a/lib/services/networkManagement2/lib/models/iPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/iPConfiguration.js @@ -99,6 +99,8 @@ class IPConfiguration extends models['SubResource'] { * 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 diff --git a/lib/services/networkManagement2/lib/models/inboundNatPool.js b/lib/services/networkManagement2/lib/models/inboundNatPool.js index 546d840112..b8304b9e92 100644 --- a/lib/services/networkManagement2/lib/models/inboundNatPool.js +++ b/lib/services/networkManagement2/lib/models/inboundNatPool.js @@ -33,6 +33,15 @@ class InboundNatPool extends models['SubResource'] { * 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'. @@ -102,6 +111,20 @@ class InboundNatPool extends models['SubResource'] { 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', diff --git a/lib/services/networkManagement2/lib/models/inboundNatRule.js b/lib/services/networkManagement2/lib/models/inboundNatRule.js index 384809d653..09299a448c 100644 --- a/lib/services/networkManagement2/lib/models/inboundNatRule.js +++ b/lib/services/networkManagement2/lib/models/inboundNatRule.js @@ -231,6 +231,8 @@ class InboundNatRule extends models['SubResource'] { * 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} diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index e100141028..e620b9e1f6 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -270,6 +270,8 @@ export interface BackendAddressPool extends SubResource { * 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} @@ -685,6 +687,22 @@ export interface PublicIPAddressDnsSettings { 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. @@ -783,6 +801,8 @@ export interface PublicIPAddressDnsSettings { * 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 @@ -802,6 +822,7 @@ export interface PublicIPAddress extends Resource { publicIPAddressVersion?: string; readonly ipConfiguration?: IPConfiguration; dnsSettings?: PublicIPAddressDnsSettings; + ipTags?: IpTag[]; ipAddress?: string; idleTimeoutInMinutes?: number; resourceGuid?: string; @@ -893,6 +914,8 @@ export interface PublicIPAddress extends Resource { * 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 @@ -1177,6 +1200,8 @@ export interface Subnet extends SubResource { * 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 @@ -1536,6 +1561,8 @@ export interface ApplicationGatewayBackendHttpSettings extends SubResource { * 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 @@ -2151,6 +2178,9 @@ export interface ApplicationGatewayFirewallDisabledRuleGroup { * 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; @@ -2158,6 +2188,8 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration { ruleSetType: string; ruleSetVersion: string; disabledRuleGroups?: ApplicationGatewayFirewallDisabledRuleGroup[]; + requestBodyCheck?: boolean; + maxRequestBodySize?: number; } /** @@ -2226,6 +2258,10 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration { * 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 @@ -2390,6 +2426,31 @@ 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. @@ -2475,7 +2536,6 @@ export interface ExpressRouteCircuitPeeringConfig { * @member {string} [location] Resource location. * @member {string} [etag] A unique read-only string that changes whenever the * resource is updated. - * @member {object} [tags] Resource tags. */ export interface RouteFilterRule extends SubResource { access: string; @@ -2484,7 +2544,6 @@ export interface RouteFilterRule extends SubResource { name?: string; location?: string; readonly etag?: string; - tags?: { [propertyName: string]: string }; } /** @@ -2505,18 +2564,53 @@ export interface ExpressRouteCircuitStats { 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 PeeringType. Possible values are: - * 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. - * Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * @member {string} [state] The state of peering. Possible values are: - * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + * @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. @@ -2603,6 +2697,8 @@ export interface ExpressRouteCircuitStats { * @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 @@ -2626,6 +2722,7 @@ export interface ExpressRouteCircuitPeering extends SubResource { lastModifiedBy?: string; routeFilter?: RouteFilter; ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; + connections?: ExpressRouteCircuitConnection[]; name?: string; readonly etag?: string; } @@ -2921,6 +3018,201 @@ export interface ExpressRouteServiceProvider extends Resource { 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. @@ -3101,6 +3393,8 @@ export interface LoadBalancerSku { * 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 @@ -3265,6 +3559,14 @@ export interface Probe extends SubResource { * 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'. @@ -3279,6 +3581,8 @@ export interface InboundNatPool extends SubResource { frontendPortRangeStart: number; frontendPortRangeEnd: number; backendPort: number; + idleTimeoutInMinutes?: number; + enableFloatingIP?: boolean; provisioningState?: string; name?: string; etag?: string; @@ -4265,6 +4569,52 @@ export interface ConnectivityDestination { port?: number; } +/** + * @class + * Initializes a new instance of the HTTPHeader class. + * @constructor + * Describes the HTTP header. + * + * @member {string} [name] The name in HTTP header. + * @member {string} [value] The value in HTTP header. + */ +export interface HTTPHeader { + name?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the HTTPConfiguration class. + * @constructor + * HTTP configuration of the connectivity check. + * + * @member {string} [method] HTTP method. Possible values include: 'Get' + * @member {array} [headers] List of HTTP headers. + * @member {array} [validStatusCodes] Valid status codes. + */ +export interface HTTPConfiguration { + method?: string; + headers?: HTTPHeader[]; + validStatusCodes?: number[]; +} + +/** + * @class + * Initializes a new instance of the ProtocolConfiguration class. + * @constructor + * Configuration of the protocol. + * + * @member {object} [hTTPConfiguration] + * @member {string} [hTTPConfiguration.method] HTTP method. Possible values + * include: 'Get' + * @member {array} [hTTPConfiguration.headers] List of HTTP headers. + * @member {array} [hTTPConfiguration.validStatusCodes] Valid status codes. + */ +export interface ProtocolConfiguration { + hTTPConfiguration?: HTTPConfiguration; +} + /** * @class * Initializes a new instance of the ConnectivityParameters class. @@ -4283,10 +4633,22 @@ export interface ConnectivityDestination { * which a connection attempt will be made. * @member {number} [destination.port] Port on which check connectivity will be * performed. + * @member {string} [protocol] Network protocol. Possible values include: + * 'Tcp', 'Http', 'Https', 'Icmp' + * @member {object} [protocolConfiguration] + * @member {object} [protocolConfiguration.hTTPConfiguration] + * @member {string} [protocolConfiguration.hTTPConfiguration.method] HTTP + * method. Possible values include: 'Get' + * @member {array} [protocolConfiguration.hTTPConfiguration.headers] List of + * HTTP headers. + * @member {array} [protocolConfiguration.hTTPConfiguration.validStatusCodes] + * Valid status codes. */ export interface ConnectivityParameters { source: ConnectivitySource; destination: ConnectivityDestination; + protocol?: string; + protocolConfiguration?: ProtocolConfiguration; } /** @@ -4528,6 +4890,190 @@ 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 {string} [sourceStatus] Status of connection monitor source. + * Possible values include: 'Uknown', 'Active', 'Inactive' + * @member {array} [states] Information about connection states. + */ +export interface ConnectionMonitorQueryResult { + sourceStatus?: string; + states?: ConnectionStateSnapshot[]; +} + /** * @class * Initializes a new instance of the OperationDisplay class. @@ -4692,7 +5238,6 @@ export interface Operation { * 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 {object} [tags] Resource tags. */ export interface PatchRouteFilterRule extends SubResource { access: string; @@ -4700,7 +5245,6 @@ export interface PatchRouteFilterRule extends SubResource { readonly provisioningState?: string; readonly name?: string; readonly etag?: string; - tags?: { [propertyName: string]: string }; } /** @@ -4909,9 +5453,13 @@ export interface DhcpOptions { * @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 a Virtual Network. - * @member {boolean} [enableVmProtection] Indicates if Vm protection is enabled - * for all the subnets in a Virtual Network. + * 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. */ @@ -4924,6 +5472,7 @@ export interface VirtualNetwork extends Resource { provisioningState?: string; enableDdosProtection?: boolean; enableVmProtection?: boolean; + ddosProtectionPlan?: SubResource; etag?: string; } @@ -5074,6 +5623,48 @@ export interface VpnClientRevokedCertificate extends SubResource { 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. @@ -5090,6 +5681,8 @@ export interface VpnClientRevokedCertificate extends SubResource { * 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 @@ -5100,6 +5693,7 @@ export interface VpnClientConfiguration { vpnClientRootCertificates?: VpnClientRootCertificate[]; vpnClientRevokedCertificates?: VpnClientRevokedCertificate[]; vpnClientProtocols?: string[]; + vpnClientIpsecPolicies?: IpsecPolicy[]; radiusServerAddress?: string; radiusServerSecret?: string; } @@ -5220,6 +5814,8 @@ export interface GatewayRoute { * 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. @@ -5366,46 +5962,6 @@ export interface LocalNetworkGateway extends Resource { 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' - * @member {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). - * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' - * @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 DH Groups used in IKE Phase 2 for new child - * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - * 'ECP384', 'PFS24' - */ -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 VirtualNetworkGatewayConnection class. @@ -5460,6 +6016,9 @@ export interface IpsecPolicy { * @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 @@ -5530,6 +6089,9 @@ export interface IpsecPolicy { * @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 @@ -5653,6 +6215,46 @@ 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. @@ -5789,6 +6391,18 @@ export interface ApplicationSecurityGroupListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the EndpointServicesListResult class. @@ -5851,6 +6465,31 @@ export interface ExpressRouteServiceProviderListResult 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. @@ -6004,6 +6643,16 @@ export interface NetworkWatcherListResult extends Array { 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. diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index f00395fbf5..4f242870be 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -32,6 +32,7 @@ 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'); @@ -70,11 +71,13 @@ exports.ApplicationGatewayAvailableSslOptions = require('./applicationGatewayAva 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'); @@ -89,6 +92,11 @@ exports.ExpressRouteCircuitRoutesTableSummary = require('./expressRouteCircuitRo 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'); @@ -136,6 +144,9 @@ exports.FlowLogStatusParameters = require('./flowLogStatusParameters'); exports.FlowLogInformation = require('./flowLogInformation'); exports.ConnectivitySource = require('./connectivitySource'); exports.ConnectivityDestination = require('./connectivityDestination'); +exports.HTTPHeader = require('./hTTPHeader'); +exports.HTTPConfiguration = require('./hTTPConfiguration'); +exports.ProtocolConfiguration = require('./protocolConfiguration'); exports.ConnectivityParameters = require('./connectivityParameters'); exports.ConnectivityIssue = require('./connectivityIssue'); exports.ConnectivityHop = require('./connectivityHop'); @@ -150,6 +161,13 @@ 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'); @@ -174,6 +192,7 @@ exports.VirtualNetworkGatewayIPConfiguration = require('./virtualNetworkGatewayI 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'); @@ -184,21 +203,24 @@ exports.BgpPeerStatusListResult = require('./bgpPeerStatusListResult'); exports.GatewayRouteListResult = require('./gatewayRouteListResult'); exports.TunnelConnectionHealth = require('./tunnelConnectionHealth'); exports.LocalNetworkGateway = require('./localNetworkGateway'); -exports.IpsecPolicy = require('./ipsecPolicy'); 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'); @@ -212,6 +234,7 @@ exports.NetworkSecurityGroupListResult = require('./networkSecurityGroupListResu 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'); diff --git a/lib/services/networkManagement2/lib/models/ipTag.js b/lib/services/networkManagement2/lib/models/ipTag.js new file mode 100644 index 0000000000..f6352a0ffa --- /dev/null +++ b/lib/services/networkManagement2/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/models/ipsecPolicy.js b/lib/services/networkManagement2/lib/models/ipsecPolicy.js index e760342aa7..ee16d6a604 100644 --- a/lib/services/networkManagement2/lib/models/ipsecPolicy.js +++ b/lib/services/networkManagement2/lib/models/ipsecPolicy.js @@ -30,15 +30,17 @@ class IpsecPolicy { * 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' + * 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' + * 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 DH Groups used in IKE Phase 2 for new child + * @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' + * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' */ constructor() { } diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js index 1cba348048..21466e3abc 100644 --- a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js +++ b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js @@ -190,6 +190,8 @@ class NetworkInterfaceIPConfiguration extends models['SubResource'] { * 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 diff --git a/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js b/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js index 6554b189cc..2a576e68a4 100644 --- a/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js +++ b/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js @@ -31,7 +31,6 @@ class PatchRouteFilterRule extends models['SubResource'] { * 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 {object} [tags] Resource tags. */ constructor() { super(); @@ -111,20 +110,6 @@ class PatchRouteFilterRule extends models['SubResource'] { type: { name: 'String' } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } } } } diff --git a/lib/services/networkManagement2/lib/models/protocolConfiguration.js b/lib/services/networkManagement2/lib/models/protocolConfiguration.js new file mode 100644 index 0000000000..e9073a2149 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/protocolConfiguration.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'); + +/** + * Configuration of the protocol. + * + */ +class ProtocolConfiguration { + /** + * Create a ProtocolConfiguration. + * @member {object} [hTTPConfiguration] + * @member {string} [hTTPConfiguration.method] HTTP method. Possible values + * include: 'Get' + * @member {array} [hTTPConfiguration.headers] List of HTTP headers. + * @member {array} [hTTPConfiguration.validStatusCodes] Valid status codes. + */ + constructor() { + } + + /** + * Defines the metadata of ProtocolConfiguration + * + * @returns {object} metadata of ProtocolConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ProtocolConfiguration', + type: { + name: 'Composite', + className: 'ProtocolConfiguration', + modelProperties: { + hTTPConfiguration: { + required: false, + serializedName: 'HTTPConfiguration', + type: { + name: 'Composite', + className: 'HTTPConfiguration' + } + } + } + } + }; + } +} + +module.exports = ProtocolConfiguration; diff --git a/lib/services/networkManagement2/lib/models/publicIPAddress.js b/lib/services/networkManagement2/lib/models/publicIPAddress.js index 8c75b26ff2..343142c9ae 100644 --- a/lib/services/networkManagement2/lib/models/publicIPAddress.js +++ b/lib/services/networkManagement2/lib/models/publicIPAddress.js @@ -115,6 +115,8 @@ class PublicIPAddress extends models['Resource'] { * 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 @@ -230,6 +232,21 @@ class PublicIPAddress extends models['Resource'] { 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', diff --git a/lib/services/networkManagement2/lib/models/routeFilterRule.js b/lib/services/networkManagement2/lib/models/routeFilterRule.js index 4782bf3bee..026d2ba3cb 100644 --- a/lib/services/networkManagement2/lib/models/routeFilterRule.js +++ b/lib/services/networkManagement2/lib/models/routeFilterRule.js @@ -32,7 +32,6 @@ class RouteFilterRule extends models['SubResource'] { * @member {string} [location] Resource location. * @member {string} [etag] A unique read-only string that changes whenever * the resource is updated. - * @member {object} [tags] Resource tags. */ constructor() { super(); @@ -118,20 +117,6 @@ class RouteFilterRule extends models['SubResource'] { type: { name: 'String' } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } } } } diff --git a/lib/services/networkManagement2/lib/models/virtualNetwork.js b/lib/services/networkManagement2/lib/models/virtualNetwork.js index 57858bfad9..824d27e2a4 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetwork.js +++ b/lib/services/networkManagement2/lib/models/virtualNetwork.js @@ -37,9 +37,14 @@ class VirtualNetwork extends models['Resource'] { * PublicIP resource. Possible values are: 'Updating', 'Deleting', and * 'Failed'. * @member {boolean} [enableDdosProtection] Indicates if DDoS protection is - * enabled for all the protected resources in a Virtual Network. - * @member {boolean} [enableVmProtection] Indicates if Vm protection is - * enabled for all the subnets in a Virtual Network. + * 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. */ @@ -168,6 +173,7 @@ class VirtualNetwork extends models['Resource'] { enableDdosProtection: { required: false, serializedName: 'properties.enableDdosProtection', + defaultValue: false, type: { name: 'Boolean' } @@ -175,10 +181,19 @@ class VirtualNetwork extends models['Resource'] { 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', diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js b/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js index 78394c86a4..a8853085dc 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js +++ b/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js @@ -60,6 +60,8 @@ class VirtualNetworkGateway extends models['Resource'] { * 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. diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js index f271073db5..b6dc8791ef 100644 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js +++ b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js @@ -70,6 +70,9 @@ class VirtualNetworkGatewayConnection extends models['Resource'] { * @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 @@ -142,6 +145,9 @@ class VirtualNetworkGatewayConnection extends models['Resource'] { * @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 diff --git a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js b/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js index bacec54289..b4f14facc0 100644 --- a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js +++ b/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js @@ -29,6 +29,8 @@ class VpnClientConfiguration { * 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 @@ -103,6 +105,21 @@ class VpnClientConfiguration { } } }, + vpnClientIpsecPolicies: { + required: false, + serializedName: 'vpnClientIpsecPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpsecPolicyElementType', + type: { + name: 'Composite', + className: 'IpsecPolicy' + } + } + } + }, radiusServerAddress: { required: false, serializedName: 'radiusServerAddress', diff --git a/lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js b/lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js new file mode 100644 index 0000000000..b166295913 --- /dev/null +++ b/lib/services/networkManagement2/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/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts index 07537b5c79..259f40a1a6 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -13,7 +13,7 @@ import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; import * as models from "./models"; import * as operations from "./operations"; -declare class NetworkManagementClient extends AzureServiceClient { +export default class NetworkManagementClient extends AzureServiceClient { /** * Initializes a new instance of the NetworkManagementClient class. * @constructor @@ -56,11 +56,15 @@ declare class NetworkManagementClient extends AzureServiceClient { // 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; @@ -76,6 +80,7 @@ declare class NetworkManagementClient extends AzureServiceClient { defaultSecurityRules: operations.DefaultSecurityRules; networkWatchers: operations.NetworkWatchers; packetCaptures: operations.PacketCaptures; + connectionMonitors: operations.ConnectionMonitors; operations: operations.Operations; publicIPAddresses: operations.PublicIPAddresses; routeFilters: operations.RouteFilters; @@ -156,4 +161,4 @@ declare class NetworkManagementClient extends AzureServiceClient { checkDnsNameAvailability(location: string, domainNameLabel: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -export = NetworkManagementClient; +export { NetworkManagementClient, models as NetworkManagementModels }; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index c8732ee23d..96ad44890a 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -61,7 +61,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -220,11 +220,15 @@ class NetworkManagementClient extends ServiceClient { } 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); @@ -240,6 +244,7 @@ class NetworkManagementClient extends ServiceClient { 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); @@ -353,3 +358,6 @@ class NetworkManagementClient extends ServiceClient { } module.exports = NetworkManagementClient; +module.exports['default'] = NetworkManagementClient; +module.exports.NetworkManagementClient = NetworkManagementClient; +module.exports.NetworkManagementModels = models; diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js index e1de4ed13c..c05e4b5530 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -321,6 +321,14 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { * [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. * @@ -527,7 +535,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -663,7 +671,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1005,7 +1013,7 @@ function _listAvailableWafRuleSets(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1137,7 +1145,7 @@ function _listAvailableSslOptions(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1270,7 +1278,7 @@ function _listAvailableSslPredefinedPolicies(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1404,7 +1412,7 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1542,7 +1550,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1600,7 +1608,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1733,6 +1741,14 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, * [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. * @@ -1780,7 +1796,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1855,7 +1871,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1884,7 +1900,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1901,7 +1917,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1962,7 +1978,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2121,7 +2137,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2246,7 +2262,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2378,7 +2394,7 @@ function _beginBackendHealth(resourceGroupName, applicationGatewayName, options, throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3180,6 +3196,14 @@ class ApplicationGateways { * [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. * @@ -3324,6 +3348,14 @@ class ApplicationGateways { * [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. * @@ -4420,6 +4452,14 @@ class ApplicationGateways { * [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. * @@ -4564,6 +4604,14 @@ class ApplicationGateways { * [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. * diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js index 0d2f12cbd3..7c8972e9d1 100644 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js @@ -115,7 +115,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -344,7 +344,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -478,7 +478,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -617,7 +617,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -675,7 +675,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -754,7 +754,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,7 +829,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -858,7 +858,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -875,7 +875,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js index 92db2c1283..d406ad216c 100644 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js @@ -48,7 +48,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js index 9116ccbc69..301e2a5673 100644 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js new file mode 100644 index 0000000000..6cb83da8c6 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -0,0 +1,2746 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js new file mode 100644 index 0000000000..907ea57fc1 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js @@ -0,0 +1,1964 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + let apiVersion = '2018-02-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(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.'); + } + 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js index 81747498c8..b3c7d514ec 100644 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js index 41d8e4bc94..f8f6c392ae 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -367,7 +367,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -512,7 +512,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -574,7 +574,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -665,7 +665,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,7 +744,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -773,7 +773,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -790,7 +790,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js new file mode 100644 index 0000000000..910077bc4c --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js @@ -0,0 +1,1342 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 40550eba60..772e968fe7 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js @@ -117,7 +117,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -242,14 +242,12 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -362,6 +360,9 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { * 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. @@ -475,7 +476,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -619,7 +620,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -726,14 +727,12 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -846,6 +845,9 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options * 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. @@ -881,7 +883,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1364,14 +1366,12 @@ class ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -1484,6 +1484,9 @@ class ExpressRouteCircuitPeerings { * 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. @@ -1527,14 +1530,12 @@ class ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -1647,6 +1648,9 @@ class ExpressRouteCircuitPeerings { * 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. @@ -1889,14 +1893,12 @@ class ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -2009,6 +2011,9 @@ class ExpressRouteCircuitPeerings { * 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. @@ -2052,14 +2057,12 @@ class ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -2172,6 +2175,9 @@ class ExpressRouteCircuitPeerings { * 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. diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index e39fd37f59..96abaea1ec 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -728,7 +728,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -874,7 +874,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1020,7 +1020,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1156,7 +1156,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1290,7 +1290,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1348,7 +1348,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1474,7 +1474,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1549,7 +1549,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1578,7 +1578,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1595,7 +1595,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1656,7 +1656,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1822,7 +1822,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1979,7 +1979,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js new file mode 100644 index 0000000000..335d82ab08 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -0,0 +1,2142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js new file mode 100644 index 0000000000..3529e8b314 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -0,0 +1,3450 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2018-02-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(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.'); + } + 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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.'); + } + 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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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(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/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js index 2346cc366e..5ce17fe6e4 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js index 0e2bb1a5ff..bc908254e8 100644 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ b/lib/services/networkManagement2/lib/operations/inboundNatRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -263,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -540,7 +540,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -602,7 +602,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -715,7 +715,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -794,7 +794,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -823,7 +823,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -840,7 +840,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 2b86ea5a8b..ebd9602206 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -238,6 +238,14 @@ export interface ApplicationGateways { * [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. * @@ -370,6 +378,14 @@ export interface ApplicationGateways { * [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. * @@ -1154,6 +1170,14 @@ export interface ApplicationGateways { * [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. * @@ -1286,6 +1310,14 @@ export interface ApplicationGateways { * [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. * @@ -2342,17 +2374,19 @@ export interface ApplicationSecurityGroups { /** * @class - * AvailableEndpointServices + * DdosProtectionPlans * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface AvailableEndpointServices { +export interface DdosProtectionPlans { /** - * List what values of endpoint services are available for use. + * Deletes the specified DDoS protection plan. * - * @param {string} location The location to check available endpoint services. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2361,16 +2395,18 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List what values of endpoint services are available for use. + * Deletes the specified DDoS protection plan. * - * @param {string} location The location to check available endpoint services. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2384,7 +2420,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. * @@ -2392,24 +2428,23 @@ 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; + 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; /** - * List what values of endpoint services are available for use. + * Gets information about the specified DDoS protection plan. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2418,17 +2453,18 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List what values of endpoint services are available for use. + * Gets information about the specified DDoS protection plan. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2442,7 +2478,7 @@ export interface AvailableEndpointServices { * * {Promise} A promise is returned. * - * @resolve {EndpointServicesListResult} - The deserialized result object. + * @resolve {DdosProtectionPlan} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2450,37 +2486,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. + * {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. */ - 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 { + 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.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2489,21 +2521,27 @@ 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>; + 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.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2517,7 +2555,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. * @@ -2525,25 +2563,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. */ - 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; + 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 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. + * Gets all DDoS protection plans in a subscription. * * @param {object} [options] Optional Parameters. * @@ -2552,20 +2585,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. */ - getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(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. + * Gets all DDoS protection plans in a subscription. * * @param {object} [options] Optional Parameters. * @@ -2579,7 +2606,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. * @@ -2587,48 +2614,24 @@ 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. */ - 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; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an authorization in the specified express route circuit. + * Gets all the DDoS protection plans 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} 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 @@ -2636,41 +2639,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an authorization in the specified express route circuit. + * Gets all the DDoS protection plans 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} 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 @@ -2683,7 +2662,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. * @@ -2691,25 +2670,25 @@ 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. */ - 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; + 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 authorizations in an 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 circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2718,18 +2697,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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all authorizations in an 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 circuit. + * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. * * @param {object} [options] Optional Parameters. * @@ -2743,7 +2722,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {AuthorizationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2751,28 +2730,32 @@ 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. + * {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; + 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; /** - * 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.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2781,21 +2764,27 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(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.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2809,7 +2798,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. * @@ -2817,45 +2806,23 @@ 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; + 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 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. + * Gets all DDoS protection plans in a subscription. * - * @param {string} [authorizationParameters.id] Resource ID. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2864,40 +2831,75 @@ 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>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an authorization in the specified express route circuit. + * Gets all DDoS protection plans in a subscription. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} circuitName The name of the express route circuit. + * @param {object} [options] Optional Parameters. * - * @param {string} authorizationName The name of the authorization. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' + * {Promise} A promise is returned. * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @resolve {DdosProtectionPlanListResult} - The deserialized result object. * - * @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. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [authorizationParameters.id] Resource ID. + * {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. * @@ -2911,7 +2913,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. * @@ -2919,21 +2921,86 @@ 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; + 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 { /** - * Gets all authorizations in an express route circuit. + * 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. @@ -2945,14 +3012,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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all authorizations in an express route circuit. + * List what values of endpoint services are available for use. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2969,7 +3036,7 @@ export interface ExpressRouteCircuitAuthorizations { * * {Promise} A promise is returned. * - * @resolve {AuthorizationListResult} - The deserialized result object. + * @resolve {EndpointServicesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2977,36 +3044,37 @@ 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 + * {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; + 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 + * ExpressRouteCircuitAuthorizations * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface ExpressRouteCircuitPeerings { +export interface ExpressRouteCircuitAuthorizations { /** - * Deletes the specified peering from the 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} peeringName The name of the peering. + * @param {string} authorizationName The name of the authorization. * * @param {object} [options] Optional Parameters. * @@ -3019,16 +3087,17 @@ export interface ExpressRouteCircuitPeerings { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified peering from the 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} peeringName The name of the peering. + * @param {string} authorizationName The name of the authorization. * * @param {object} [options] Optional Parameters. * @@ -3056,9 +3125,9 @@ 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; + 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; /** @@ -3068,7 +3137,7 @@ export interface ExpressRouteCircuitPeerings { * * @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. * @@ -3077,11 +3146,11 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the specified authorization from the specified express route circuit. @@ -3090,7 +3159,7 @@ export interface ExpressRouteCircuitPeerings { * * @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. * @@ -3104,7 +3173,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. * @@ -3112,156 +3181,129 @@ 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. */ - 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; + 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 PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. 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 {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} authorizationParameters Parameters supplied to the create or + * update express route circuit authorization operation. * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. + * @param {string} [authorizationParameters.authorizationKey] The authorization + * key. * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. + * @param {string} [authorizationParameters.authorizationUseStatus] + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse' * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @param {string} [authorizationParameters.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 {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.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. + * @param {string} [authorizationParameters.id] Resource ID. * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering + * @param {object} [options] Optional Parameters. * - * @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.customHeaders] Headers that will be added to the + * request * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN 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 {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. + * {Promise} A promise is returned. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. + * @resolve {ExpressRouteCircuitAuthorization} - The deserialized result object. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. + * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. + * See {@link ExpressRouteCircuitAuthorization} for more + * information. * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' + * {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. * @@ -3270,149 +3312,18 @@ 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(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} 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 PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. 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 {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} circuitName The name of the circuit. * * @param {object} [options] Optional Parameters. * @@ -3426,7 +3337,7 @@ export interface ExpressRouteCircuitPeerings { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitPeering} - The deserialized result object. + * @resolve {AuthorizationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3434,26 +3345,29 @@ 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 + * {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. */ - 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; + 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 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 @@ -3461,19 +3375,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>; + beginDeleteMethodWithHttpOperationResponse(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 @@ -3486,7 +3403,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. * @@ -3494,17 +3411,186 @@ 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; + 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 { /** @@ -3527,7 +3613,7 @@ export interface ExpressRouteCircuitPeerings { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes the specified peering from the specified express route circuit. @@ -3564,9 +3650,73 @@ export interface ExpressRouteCircuitPeerings { * * {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; + 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; /** @@ -3581,14 +3731,12 @@ export interface ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -3701,6 +3849,9 @@ export interface ExpressRouteCircuitPeerings { * 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. @@ -3718,7 +3869,7 @@ export interface ExpressRouteCircuitPeerings { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -3732,14 +3883,12 @@ export interface ExpressRouteCircuitPeerings { * @param {object} peeringParameters Parameters supplied to the create or * update express route circuit peering operation. * - * @param {string} [peeringParameters.peeringType] The PeeringType. Possible - * values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - * 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - * 'AzurePrivatePeering', 'MicrosoftPeering' + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [peeringParameters.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * * @param {number} [peeringParameters.azureASN] The Azure ASN. * @@ -3852,6 +4001,9 @@ export interface ExpressRouteCircuitPeerings { * 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. @@ -3886,16 +4038,17 @@ export interface ExpressRouteCircuitPeerings { * * {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; + 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} 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. * @@ -3908,13 +4061,14 @@ export interface ExpressRouteCircuitPeerings { * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, circuitName: 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 {string} resourceGroupName The name of the resource group. + * + * @param {string} circuitName The name of the express route circuit. * * @param {object} [options] Optional Parameters. * @@ -3944,27 +4098,20 @@ export interface ExpressRouteCircuitPeerings { * * {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 - * ExpressRouteCircuits - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuits { + 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 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 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 @@ -3976,15 +4123,17 @@ export interface ExpressRouteCircuits { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes 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 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 @@ -4011,134 +4160,149 @@ export interface ExpressRouteCircuits { * * {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; + 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; /** - * Gets information about 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. * - * @param {string} circuitName The name of express route circuit. + * @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. * - * @returns {Promise} A promise is returned + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @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 {number} [peeringParameters.azureASN] The Azure ASN. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {string} circuitName The name of express route circuit. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {object} [options] Optional Parameters. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [peeringParameters.primaryAzurePort] The primary port. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * {Promise} A promise is returned. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [peeringParameters.stats] Gets peering stats. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the + * peering. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of + * the peering. * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} for more information. + * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of + * the peering. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of + * the peering. * - * {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} [peeringParameters.provisioningState] Gets the provisioning + * state of the public IP resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager + * Etag. * - * @param {string} circuitName The name of the circuit. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. + * @param {object} [peeringParameters.routeFilter] The reference of the + * RouteFilter resource. * - * @param {object} [parameters.sku] The SKU. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * @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.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded' * - * @param {array} [parameters.authorizations] The list of authorizations. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * @param {array} [parameters.peerings] The list of peerings. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] + * Resource tags. * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * @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 {array} [peeringParameters.connections] The list of circuit + * connections associated with Azure Private Peering for this circuit. * - * @param {string} [parameters.location] Resource location. + * @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} [parameters.tags] Resource tags. + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -4147,76 +4311,3526 @@ 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 {string} circuitName The name of the express route circuit. * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.sku] The SKU. + * @param {object} peeringParameters Parameters supplied to the create or + * update express route circuit peering operation. * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {string} [peeringParameters.peeringType] The peering type. Possible + * values include: 'AzurePublicPeering', 'AzurePrivatePeering', + * 'MicrosoftPeering' * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {string} [peeringParameters.state] The peering state. Possible values + * include: 'Disabled', 'Enabled' * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {number} [peeringParameters.azureASN] The Azure ASN. * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @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.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {array} [parameters.authorizations] The list of authorizations. + * @param {string} [peeringParameters.primaryAzurePort] The primary port. * - * @param {array} [parameters.peerings] The list of peerings. + * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * @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. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * {Promise} A promise is returned. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * @resolve {null} - The deserialized result object. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * {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. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {object} [parameters.tags] Resource tags. + * {WebResource} [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. * @@ -4230,7 +7844,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4238,29 +7852,125 @@ 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. + * {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, 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; + 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 an express route circuit tags. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the circuit. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -4269,23 +7979,118 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an express route circuit tags. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the circuit. + * @param {string} crossConnectionName The name of the + * ExpressRouteCrossConnection. * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. + * @param {string} peeringName The name of the peering. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -4299,7 +8104,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4307,30 +8112,29 @@ 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. + * {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. */ - 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; + 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; /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. + * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route 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. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4338,24 +8142,22 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: 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 peering from the ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route 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. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4368,7 +8170,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. * @@ -4376,100 +8178,123 @@ 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; + 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; /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. + * Creates or updates a peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route 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. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection 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' * - * @returns {Promise} A promise is returned + * @param {number} [peeringParameters.peerASN] The peer ASN. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * @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} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @param {string} circuitName The name of the express route circuit. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * @param {string} peeringName The name of the peering. + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * @param {string} devicePath The path of the device. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * @param {object} [options] Optional Parameters. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The + * secondary address prefix. * - * @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.microsoftPeeringConfig] + * The Microsoft peering configuration. * - * {Promise} A promise is returned. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @resolve {ExpressRouteCircuitsRoutesTableListResult} - 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. + * @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' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * for more information. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The + * reference of the RouteFilter resource. * - * {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 {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] + * Collection of RouteFilterRules contained within a route filter. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A + * collection of references to express route circuit peerings. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] + * Resource ID. * - * @param {string} peeringName The name of the peering. + * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] + * Resource location. * - * @param {string} devicePath The path of the device. + * @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. * @@ -4478,84 +8303,118 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, 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 peering in the specified ExpressRouteCrossConnection. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route 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. + * @param {object} peeringParameters Parameters supplied to the create or + * update ExpressRouteCrossConnection 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.peerASN] The peer ASN. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary + * address prefix. * - * {Promise} A promise is returned. + * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary + * address prefix. * - * @resolve {ExpressRouteCircuitsRoutesTableSummaryListResult} - The deserialized result object. + * @param {string} [peeringParameters.sharedKey] The shared key. * - * @reject {Error|ServiceError} - The error object. + * @param {number} [peeringParameters.vlanId] The VLAN ID. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft + * peering configuration. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider + * or the customer last modified the peering. * - * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCircuitsRoutesTableSummaryListResult} for - * more information. + * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering + * configuration. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} + * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary + * address prefix. * - * {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} + * [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 express route circuit. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] + * The reference of AdvertisedPublicPrefixes. * - * @param {object} [options] Optional Parameters. + * @param {array} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] + * The communities of bgp peering. Spepcified for microsoft peering * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @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 {Promise} A promise is returned + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The + * legacy mode of the peering. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The + * CustomerASN of the peering. * - * @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} + * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] + * The RoutingRegistryName of the configuration. * - * @param {string} resourceGroupName The name of the resource group. + * @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} circuitName The name of the express route circuit. + * @param {string} [peeringParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -4569,7 +8428,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitStats} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeering} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4577,27 +8436,24 @@ 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 + * {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. */ - 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; + 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 stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all peerings in a specified ExpressRouteCrossConnection. * - * @param {string} circuitName The name of the express route circuit. - * - * @param {string} peeringName The name of the peering. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -4606,20 +8462,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. */ - getPeeringStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: 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. + * Gets all peerings in a specified ExpressRouteCrossConnection. * - * @param {string} peeringName The name of the peering. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -4633,7 +8486,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitStats} - The deserialized result object. + * @resolve {ExpressRouteCrossConnectionPeeringList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4641,24 +8494,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 - * 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. */ - 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; + 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 express route circuits in a resource group. + * 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 @@ -4666,17 +8530,19 @@ 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a resource group. + * 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 @@ -4689,7 +8555,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. * @@ -4697,40 +8563,50 @@ 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. */ - 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; + 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 express route circuits in a subscription. + * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a subscription. + * 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 * @@ -4741,7 +8617,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4749,25 +8625,79 @@ 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. + * {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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Deletes the specified express route circuit. + * Creates or updates a load balancer. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @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. * @@ -4776,112 +8706,114 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified express route circuit. + * Creates or updates a load balancer. * * @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. + * @param {string} loadBalancerName The name of the load balancer. * - * {Promise} A promise is returned. + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. * - * @resolve {null} - The deserialized result object. + * @param {object} [parameters.sku] The load balancer SKU. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible + * values include: 'Basic', 'Standard' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [parameters.frontendIPConfigurations] Object representing the + * frontend IPs to be used for the load balancer * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.backendAddressPools] Collection of backend + * address pools used by a load balancer * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {array} [parameters.loadBalancingRules] Object collection + * representing the load balancing rules Gets the provisioning * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.probes] Collection of probe objects used in the + * load balancer * - * {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 {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} resourceGroupName The name of the resource group. + * @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 {string} circuitName The name of the circuit. + * @param {array} [parameters.outboundNatRules] The outbound NAT rules. * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. + * @param {string} [parameters.resourceGuid] The resource GUID property of the + * load balancer resource. * - * @param {object} [parameters.sku] The SKU. + * @param {string} [parameters.provisioningState] Gets the provisioning state + * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {string} [parameters.id] Resource ID. * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {string} [parameters.location] Resource location. * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.authorizations] The list of authorizations. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.peerings] The list of peerings. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * {Promise} A promise is returned. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * @resolve {LoadBalancer} - The deserialized result object. * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * {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} [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 Parameters supplied to update load balancer tags. * * @param {object} [parameters.tags] Resource tags. * @@ -4892,76 +8824,73 @@ 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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an express route circuit. + * Updates a load balancer tags. * * @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} loadBalancerName The name of the load balancer. * - * @param {string} [parameters.sku.name] The name of the SKU. + * @param {object} parameters Parameters supplied to update load balancer tags. * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @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' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [parameters.authorizations] The list of authorizations. + * {Promise} A promise is returned. * - * @param {array} [parameters.peerings] The list of peerings. + * @resolve {LoadBalancer} - The deserialized result object. * - * @param {string} [parameters.serviceKey] The ServiceKey. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. + * {LoadBalancer} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancer} for more information. * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. + * {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} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.id] Resource ID. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.location] Resource location. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -4975,7 +8904,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4983,30 +8912,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. + * {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. */ - 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; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an express route circuit tags. + * Gets all the load balancers in a resource group. * * @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 @@ -5014,24 +8937,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. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an express route circuit tags. + * Gets all the load balancers in a resource group. * * @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 @@ -5044,7 +8960,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuit} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5052,29 +8968,25 @@ 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. + * {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. */ - 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; + 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 the currently advertised ARP table associated with the express route - * circuit in a resource group. + * Deletes the specified load balancer. * * @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 {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -5083,23 +8995,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. */ - beginListArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: 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 load balancer. * * @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 {string} loadBalancerName The name of the load balancer. * * @param {object} [options] Optional Parameters. * @@ -5113,7 +9020,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. * @@ -5121,30 +9028,78 @@ 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. - */ - 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. + * {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} 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} circuitName The name of the express route circuit. + * @param {string} [parameters.id] Resource ID. * - * @param {string} peeringName The name of the peering. + * @param {string} [parameters.location] Resource location. * - * @param {string} devicePath The path of the device. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5153,23 +9108,73 @@ 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. */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. + * Creates or updates a load balancer. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to the create or update load + * balancer operation. * - * @param {string} devicePath The path of the device. + * @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. * @@ -5183,7 +9188,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableListResult} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5191,30 +9196,28 @@ 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. + * {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. */ - 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; + 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 currently advertised routes table summary associated with the - * express route circuit in a resource group. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to update load balancer tags. * - * @param {string} devicePath The path of the device. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5223,23 +9226,22 @@ 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. */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. + * Updates a load balancer tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} circuitName The name of the express route circuit. + * @param {string} loadBalancerName The name of the load balancer. * - * @param {string} peeringName The name of the peering. + * @param {object} parameters Parameters supplied to update load balancer tags. * - * @param {string} devicePath The path of the device. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5253,7 +9255,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitsRoutesTableSummaryListResult} - The deserialized result object. + * @resolve {LoadBalancer} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5261,22 +9263,20 @@ 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. + * {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. */ - 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; + 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 express route circuits in a resource group. + * Gets all the load balancers in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5288,14 +9288,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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a resource group. + * Gets all the load balancers in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5312,7 +9312,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5320,21 +9320,21 @@ 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 + * {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; + 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 express route circuits in a subscription. + * Gets all the load balancers in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5346,14 +9346,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. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the express route circuits in a subscription. + * Gets all the load balancers in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5370,7 +9370,7 @@ export interface ExpressRouteCircuits { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteCircuitListResult} - The deserialized result object. + * @resolve {LoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5378,30 +9378,34 @@ 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 + * {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; + 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 - * ExpressRouteServiceProviders + * LoadBalancerBackendAddressPools * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface ExpressRouteServiceProviders { +export interface LoadBalancerBackendAddressPools { /** - * Gets all the available express route service providers. + * 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. * @@ -5410,14 +9414,18 @@ 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available express route service providers. + * 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. * @@ -5431,7 +9439,7 @@ export interface ExpressRouteServiceProviders { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. + * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5439,24 +9447,27 @@ 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. + * {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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(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 the available express route service providers. + * Gets load balancer backend address pool. * - * @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} backendAddressPoolName The name of the backend address pool. * * @param {object} [options] Optional Parameters. * @@ -5465,17 +9476,20 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the available express route service providers. + * Gets load balancer backend address pool. * - * @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} backendAddressPoolName The name of the backend address pool. * * @param {object} [options] Optional Parameters. * @@ -5489,7 +9503,7 @@ export interface ExpressRouteServiceProviders { * * {Promise} A promise is returned. * - * @resolve {ExpressRouteServiceProviderListResult} - The deserialized result object. + * @resolve {BackendAddressPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5497,34 +9511,23 @@ 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. - * - * {WebResource} [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 { + * {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; /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the load balancer backed address pools. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5533,18 +9536,17 @@ 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>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the load balancer backed address pools. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5558,7 +9560,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5566,19 +9568,30 @@ 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. + * {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. */ - 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; + 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 the specified load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} resourceGroupName The name of the resource group. * @@ -5586,21 +9599,19 @@ export interface LoadBalancers { * * @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, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified load balancer. + * Gets all the load balancer frontend IP configurations. * * @param {string} resourceGroupName The name of the resource group. * @@ -5608,8 +9619,6 @@ export interface LoadBalancers { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5620,7 +9629,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5628,79 +9637,29 @@ 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. + * {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. */ - 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; + 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. + * 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 {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 {string} frontendIPConfigurationName The name of the frontend IP + * configuration. * * @param {object} [options] Optional Parameters. * @@ -5709,73 +9668,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, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer. + * 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 {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 {string} frontendIPConfigurationName The name of the frontend IP + * configuration. * * @param {object} [options] Optional Parameters. * @@ -5789,7 +9696,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {FrontendIPConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5797,28 +9704,24 @@ 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. + * {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. */ - 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, 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; /** - * 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 the load balancer frontend IP configurations. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5827,22 +9730,17 @@ 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. */ - updateTagsWithHttpOperationResponse(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 the load balancer frontend IP configurations. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5856,7 +9754,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5864,20 +9762,35 @@ 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. + * {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. */ - 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; + 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 load balancers in a subscription. + * 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. * @@ -5886,14 +9799,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. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a subscription. + * 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. * @@ -5907,7 +9824,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {InboundNatRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5915,24 +9832,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 + * {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. */ - 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 the load balancers in a resource group. + * 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 @@ -5940,17 +9861,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. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a resource group. + * 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 @@ -5963,7 +9888,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. * @@ -5971,48 +9896,54 @@ 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. */ - 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; + 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; /** - * Deletes the specified load balancer. + * 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. */ - beginDeleteMethodWithHttpOperationResponse(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>; /** - * Deletes the specified load balancer. + * 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 * @@ -6023,7 +9954,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6031,78 +9962,69 @@ 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. + * {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. */ - 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; + 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. + * 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 {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 {string} inboundNatRuleName The name of the inbound nat rule. * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. * - * @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} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' * - * @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} [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 {array} [parameters.outboundNatRules] The outbound NAT rules. + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. + * @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} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @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} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @param {string} [parameters.id] Resource ID. + * @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} [parameters.location] Resource location. + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [inboundNatRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -6111,73 +10033,63 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer. + * 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 {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 {string} inboundNatRuleName The name of the inbound nat rule. * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer + * @param {object} inboundNatRuleParameters Parameters supplied to the create + * or update inbound nat rule operation. * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning + * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A + * reference to frontend IP addresses. * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer + * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] + * Resource ID. * - * @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} [inboundNatRuleParameters.protocol] Possible values include: + * 'Udp', 'Tcp', 'All' * - * @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} [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 {array} [parameters.outboundNatRules] The outbound NAT rules. + * @param {number} [inboundNatRuleParameters.backendPort] The port used for the + * internal endpoint. Acceptable values range from 1 to 65535. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. + * @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} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * @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} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. * - * @param {string} [parameters.id] Resource ID. + * @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} [parameters.location] Resource location. + * @param {string} [inboundNatRuleParameters.etag] A unique read-only string + * that changes whenever the resource is updated. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [inboundNatRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -6191,7 +10103,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancer} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6199,28 +10111,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. + * {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, 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; + 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; /** - * Updates a load balancer tags. + * 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 {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -6229,22 +10139,20 @@ 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. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a load balancer tags. + * 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 {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} inboundNatRuleName The name of the inbound nat rule. * * @param {object} [options] Optional Parameters. * @@ -6258,7 +10166,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. * @@ -6266,23 +10174,68 @@ 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. */ - 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; + 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 all the load balancers in a subscription. + * Creates or updates a 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} 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. * @@ -6291,17 +10244,63 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a subscription. + * Creates or updates a 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} 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. * @@ -6315,7 +10314,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {InboundNatRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6323,21 +10322,20 @@ 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. + * {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. */ - 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; + 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 load balancers in a resource group. + * Gets all the inbound nat rules in a load balancer. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6349,14 +10347,14 @@ 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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancers in a resource group. + * Gets all the inbound nat rules in a load balancer. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6373,7 +10371,7 @@ export interface LoadBalancers { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerListResult} - The deserialized result object. + * @resolve {InboundNatRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6381,30 +10379,30 @@ 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 + * {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; + 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 + * LoadBalancerLoadBalancingRules * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface LoadBalancerBackendAddressPools { +export interface LoadBalancerLoadBalancingRules { /** - * Gets all the load balancer backed address pools. + * Gets all the load balancing rules in a load balancer. * * @param {string} resourceGroupName The name of the resource group. * @@ -6417,14 +10415,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. */ - 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 balancer backed address pools. + * Gets all the load balancing rules in a load balancer. * * @param {string} resourceGroupName The name of the resource group. * @@ -6442,7 +10440,7 @@ export interface LoadBalancerBackendAddressPools { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. + * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6450,27 +10448,27 @@ 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. + * {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; + 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. + * 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} backendAddressPoolName The name of the backend address pool. + * @param {string} loadBalancingRuleName The name of the load balancing rule. * * @param {object} [options] Optional Parameters. * @@ -6479,77 +10477,20 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets load balancer backend address pool. + * 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} 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 {string} loadBalancingRuleName The name of the load balancing rule. * * @param {object} [options] Optional Parameters. * @@ -6563,7 +10504,7 @@ export interface LoadBalancerBackendAddressPools { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerBackendAddressPoolListResult} - The deserialized result object. + * @resolve {LoadBalancingRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6571,34 +10512,23 @@ 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. + * {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. */ - 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 { + 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 balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the load balancing rules in a load balancer. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6607,18 +10537,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>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the load balancing rules in a load balancer. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6632,7 +10561,7 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. + * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6640,30 +10569,35 @@ 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 - * 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. */ - 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; + 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 load balancer frontend IP configuration. + * 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 {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 @@ -6671,22 +10605,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>; + listWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets load balancer frontend IP configuration. + * 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 {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 @@ -6699,7 +10630,7 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {FrontendIPConfiguration} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6707,21 +10638,21 @@ 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 + * {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. */ - 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; + 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 the load balancer frontend IP configurations. + * Gets associated load balancer network interfaces. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6733,14 +10664,14 @@ 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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer frontend IP configurations. + * Gets associated load balancer network interfaces. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6757,7 +10688,7 @@ export interface LoadBalancerFrontendIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerFrontendIPConfigurationListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6765,31 +10696,30 @@ 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 + * {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; + 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 + * LoadBalancerProbes * __NOTE__: An instance of this class is automatically created for an * instance of the NetworkManagementClient. */ -export interface InboundNatRules { +export interface LoadBalancerProbes { /** - * Gets all the inbound nat rules in a load balancer. + * Gets all the load balancer probes. * * @param {string} resourceGroupName The name of the resource group. * @@ -6802,14 +10732,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. */ - 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 inbound nat rules in a load balancer. + * Gets all the load balancer probes. * * @param {string} resourceGroupName The name of the resource group. * @@ -6827,7 +10757,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRuleListResult} - The deserialized result object. + * @resolve {LoadBalancerProbeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6835,27 +10765,27 @@ 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 + * {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; + 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. + * Gets load balancer probe. * * @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 {string} probeName The name of the probe. * * @param {object} [options] Optional Parameters. * @@ -6864,20 +10794,20 @@ 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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer inbound nat rule. + * Gets load balancer probe. * * @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 {string} probeName The name of the probe. * * @param {object} [options] Optional Parameters. * @@ -6891,7 +10821,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Probe} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6899,54 +10829,45 @@ 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. + * {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. */ - 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; + 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 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 balancer probes. * - * @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. * - * @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, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { 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. + * Gets all the load balancer probes. * - * @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. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -6957,7 +10878,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {LoadBalancerProbeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6965,69 +10886,34 @@ 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. + * {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. */ - 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; + 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 { /** - * 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. + * Deletes the specified network interface. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -7036,63 +10922,18 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a load balancer inbound nat rule. + * Deletes the specified network interface. * * @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 {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -7106,7 +10947,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7114,51 +10955,50 @@ 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. + * {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, 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; + 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; /** - * Deletes the specified load balancer inbound nat rule. + * Gets information about the specified network interface. * * @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 {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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified load balancer inbound nat rule. + * Gets information about the specified network interface. * * @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 {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 * @@ -7169,7 +11009,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7177,133 +11017,226 @@ 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. + * {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. */ - 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; + 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 load balancer inbound nat rule. + * Creates or updates a network interface. * * @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 {string} networkInterfaceName The name of the network interface. * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. + * @param {object} parameters Parameters supplied to the create or update + * network interface operation. * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. + * @param {object} [parameters.virtualMachine] The reference of a virtual + * machine. * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' + * @param {string} [parameters.virtualMachine.id] Resource ID. * - * @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} [parameters.networkSecurityGroup] The reference of the + * NetworkSecurityGroup resource. * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. + * @param {array} [parameters.networkSecurityGroup.securityRules] A collection + * of security rules of the network security 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 {array} [parameters.networkSecurityGroup.defaultSecurityRules] The + * default security rules of network security group. * - * @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} [parameters.networkSecurityGroup.resourceGuid] The resource + * GUID property of the network security group resource. * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the + * @param {string} [parameters.networkSecurityGroup.provisioningState] 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} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. * - * @param {string} [inboundNatRuleParameters.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} [inboundNatRuleParameters.id] Resource ID. + * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only + * string that changes whenever the resource is updated. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.networkSecurityGroup.id] Resource ID. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.networkSecurityGroup.location] Resource + * location. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of + * the network interface. * - * @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 {object} [parameters.dnsSettings] The DNS settings in network + * interface. * - * @param {string} resourceGroupName The name of the resource group. + * @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} loadBalancerName The name of the load balancer. + * @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} inboundNatRuleName The name of the inbound nat rule. + * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS + * name for this NIC used for internal communications between VMs in the same + * virtual network. * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. + * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS + * name supporting internal communications between VMs in the same virtual + * network. * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. + * @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} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. + * @param {string} [parameters.macAddress] The MAC address of the network + * interface. * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' + * @param {boolean} [parameters.primary] Gets whether this is a primary network + * interface on a virtual machine. * - * @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 {boolean} [parameters.enableAcceleratedNetworking] If the network + * interface is accelerated networking enabled. * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. + * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP + * forwarding is enabled on this network interface. * - * @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} [parameters.resourceGuid] The resource GUID property of the + * network interface resource. * - * @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} [parameters.provisioningState] The provisioning state of the + * public IP resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets 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} [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} [parameters.id] Resource ID. * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. + * @param {string} [parameters.location] Resource location. * - * @param {string} [inboundNatRuleParameters.id] Resource ID. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7317,7 +11250,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRule} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7325,23 +11258,29 @@ 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. + * {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, 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; + 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; /** - * Gets all the inbound nat rules in a load balancer. + * Updates a network interface 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} 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. * @@ -7350,17 +11289,23 @@ 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>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the inbound nat rules in a load balancer. + * Updates a network interface 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} 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. * @@ -7374,7 +11319,7 @@ export interface InboundNatRules { * * {Promise} A promise is returned. * - * @resolve {InboundNatRuleListResult} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7382,34 +11327,20 @@ 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. + * {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 - * LoadBalancerLoadBalancingRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerLoadBalancingRules { + 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 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. + * Gets all network interfaces in a subscription. * * @param {object} [options] Optional Parameters. * @@ -7418,18 +11349,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>; + listAllWithHttpOperationResponse(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. + * Gets all network interfaces in a subscription. * * @param {object} [options] Optional Parameters. * @@ -7443,7 +11370,7 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7451,28 +11378,24 @@ 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. + * {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; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified load balancer load balancing rule. + * Gets all network interfaces in a resource group. * * @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 @@ -7480,21 +11403,17 @@ 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>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified load balancer load balancing rule. + * Gets all network interfaces in a resource group. * * @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 @@ -7507,7 +11426,7 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancingRule} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7515,23 +11434,25 @@ 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. + * {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. */ - 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; + 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 load balancing rules in a load balancer. + * 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. * @@ -7540,17 +11461,18 @@ 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>; + getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancing rules in a load balancer. + * 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. * @@ -7564,42 +11486,33 @@ export interface LoadBalancerLoadBalancingRules { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerLoadBalancingRuleListResult} - The deserialized result object. + * @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. - * - * {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 { + * {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 associated load balancer network interfaces. + * Gets all network security groups applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -7608,18 +11521,18 @@ 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>; + listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets associated load balancer network interfaces. + * Gets all network security groups applied to a network interface. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} networkInterfaceName The name of the network interface. * * @param {object} [options] Optional Parameters. * @@ -7633,7 +11546,7 @@ export interface LoadBalancerNetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7641,24 +11554,29 @@ 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. + * {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. */ - 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; + 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 associated load balancer network interfaces. + * 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. * @@ -7671,13 +11589,18 @@ export interface LoadBalancerNetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets associated load balancer network interfaces. + * 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. * @@ -7707,26 +11630,18 @@ export interface LoadBalancerNetworkInterfaces { * * {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 { + 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 the load balancer probes. + * Gets all network interfaces in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -7735,18 +11650,19 @@ export interface LoadBalancerProbes { * * @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>; + listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer probes. + * Gets all network interfaces in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * * @param {object} [options] Optional Parameters. * @@ -7760,7 +11676,7 @@ export interface LoadBalancerProbes { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerProbeListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7768,52 +11684,62 @@ 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 + * {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; + 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; /** - * Gets load balancer probe. + * Get the specified network interface in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @param {string} probeName The name of the probe. + * @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. */ - getWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets load balancer probe. + * Get the specified network interface in a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} loadBalancerName The name of the load balancer. + * @param {string} virtualMachineScaleSetName The name of the virtual machine + * scale set. * - * @param {string} probeName The name of the probe. + * @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 * @@ -7824,7 +11750,7 @@ export interface LoadBalancerProbes { * * {Promise} A promise is returned. * - * @resolve {Probe} - The deserialized result object. + * @resolve {NetworkInterface} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7832,45 +11758,63 @@ export interface LoadBalancerProbes { * * {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. + * {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, 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; + 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; /** - * Gets all the load balancer probes. + * 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 {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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the load balancer probes. + * 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 {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 * @@ -7881,7 +11825,7 @@ export interface LoadBalancerProbes { * * {Promise} A promise is returned. * - * @resolve {LoadBalancerProbeListResult} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7889,57 +11833,68 @@ 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. + * {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 - * NetworkInterfaces - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaces { + 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; /** - * Deletes the specified 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 {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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: 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>; /** - * Deletes the specified 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 {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 * @@ -7950,7 +11905,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7958,19 +11913,21 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; /** - * Gets information about the specified network interface. + * Deletes the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * @@ -7978,21 +11935,19 @@ export interface NetworkInterfaces { * * @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, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about the specified network interface. + * Deletes the specified network interface. * * @param {string} resourceGroupName The name of the resource group. * @@ -8000,8 +11955,6 @@ export interface NetworkInterfaces { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] Expands referenced resources. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8012,7 +11965,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8020,16 +11973,15 @@ 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. - * + * {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, 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; + 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; /** @@ -8141,7 +12093,7 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates or updates a network interface. @@ -8268,9 +12220,9 @@ export interface NetworkInterfaces { * * {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; + 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; /** @@ -8296,7 +12248,7 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a network interface tags. @@ -8337,117 +12289,9 @@ export interface NetworkInterfaces { * * {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; + 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; /** @@ -8468,7 +12312,7 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets all route tables applied to a network interface. @@ -8505,9 +12349,9 @@ export interface NetworkInterfaces { * * {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; + 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; /** @@ -8528,7 +12372,7 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets all network security groups applied to a network interface. @@ -8565,21 +12409,16 @@ export interface NetworkInterfaces { * * {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; + 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 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 network interfaces in a subscription. * - * @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. * @@ -8592,18 +12431,13 @@ export interface NetworkInterfaces { * * @reject {Error|ServiceError} - The error object. */ - listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(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 network interfaces in a subscription. * - * @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. * @@ -8633,18 +12467,16 @@ export interface NetworkInterfaces { * * {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; + 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 virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network interfaces in a 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 {object} [options] Optional Parameters. * @@ -8657,92 +12489,16 @@ export interface NetworkInterfaces { * * @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>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { 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. + * Gets all network interfaces in a resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @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 * @@ -8753,7 +12509,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8761,63 +12517,48 @@ 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. + * {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. */ - 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; + 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; /** - * 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. + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. * - * @param {string} networkInterfaceName The name of the network interface. + * @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. */ - listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { 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. + * Gets information about all network interfaces in a virtual machine in a + * virtual machine scale set. * - * @param {string} networkInterfaceName The name of the network interface. + * @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 * @@ -8828,7 +12569,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8836,68 +12577,46 @@ 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. + * {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. */ - 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; + 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; /** - * 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. + * Gets all network interfaces in a virtual machine scale set. * - * @param {string} ipConfigurationName The name of the ip configuration. + * @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. */ - getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { 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. + * Gets all network interfaces in a virtual machine scale set. * - * @param {string} ipConfigurationName The name of the ip configuration. + * @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 * @@ -8908,7 +12627,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfiguration} - The deserialized result object. + * @resolve {NetworkInterfaceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8916,25 +12635,25 @@ export interface NetworkInterfaces { * * {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 + * {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. */ - 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; + 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; /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8943,18 +12662,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. + * Get the specified network interface ip configuration in a virtual machine + * scale set. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8968,7 +12687,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8976,114 +12695,96 @@ export interface NetworkInterfaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 { /** - * Creates or updates a network interface. + * 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} 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 {object} [options] Optional Parameters. * - * @param {string} [parameters.networkSecurityGroup.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 {string} [parameters.networkSecurityGroup.id] Resource ID. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * @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 {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. + * @param {string} networkInterfaceName The name of the 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 {object} [options] Optional Parameters. * - * @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.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @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. + * {Promise} A promise is returned. * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. + * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfigurationListResult} + * for more information. * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP 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. + */ + 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} [parameters.id] Resource ID. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.location] Resource location. + * @param {string} networkInterfaceName The name of the network interface. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} ipConfigurationName The name of the ip configuration name. * * @param {object} [options] Optional Parameters. * @@ -9092,109 +12793,147 @@ 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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network interface. + * 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 {object} parameters Parameters supplied to the create or update - * network interface operation. + * @param {string} ipConfigurationName The name of the ip configuration name. * - * @param {object} [parameters.virtualMachine] The reference of a virtual - * machine. + * @param {object} [options] Optional Parameters. * - * @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. * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. + * @resolve {NetworkInterfaceIPConfiguration} - The deserialized result object. * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. + * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkInterfaceIPConfiguration} for more + * information. * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. + * {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 {object} [parameters.dnsSettings] The DNS settings in network - * interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @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 {object} [options] Optional Parameters. * - * @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.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @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. + * @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} [parameters.macAddress] The MAC address of the network - * interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface 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.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. + * {Promise} A promise is returned. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. * - * @param {string} [parameters.id] Resource ID. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.location] Resource location. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.tags] Resource tags. + * {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. * @@ -9208,7 +12947,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9216,29 +12955,24 @@ 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. + * {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. */ - 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; + 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; /** - * 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. + * List all load balancers in a network interface. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9247,23 +12981,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. */ - beginUpdateTagsWithHttpOperationResponse(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. + * List all load balancers in a network interface. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9277,7 +13005,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterface} - The deserialized result object. + * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9285,24 +13013,35 @@ 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. + * {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. */ - 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; + 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 { /** - * Gets all route tables applied to a network interface. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -9311,18 +13050,19 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all route tables applied to a network interface. + * Deletes the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -9336,7 +13076,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveRouteListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9344,48 +13084,52 @@ 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 - * 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. */ - 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; + 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 network security groups applied to a network interface. + * Gets the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups applied to a network interface. + * Gets the specified network security group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @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 * @@ -9396,7 +13140,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {EffectiveNetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9404,24 +13148,50 @@ 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. + * {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. */ - 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; + 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; /** - * Gets all network interfaces in a subscription. + * Creates or updates a network security group in the specified 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} 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. * @@ -9430,17 +13200,44 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a subscription. + * Creates or updates a network security group in the specified 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} 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. * @@ -9454,7 +13251,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9462,24 +13259,30 @@ 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. + * {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. */ - 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; + 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; /** - * Gets all network interfaces in a resource group. + * Updates a network security group 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} 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. * @@ -9488,17 +13291,24 @@ 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>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a resource group. + * Updates a network security group 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} 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. * @@ -9512,7 +13322,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9520,25 +13330,20 @@ 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. + * {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; + 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 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. + * Gets all network security groups in a subscription. * * @param {object} [options] Optional Parameters. * @@ -9547,18 +13352,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. */ - listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(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. + * Gets all network security groups in a subscription. * * @param {object} [options] Optional Parameters. * @@ -9572,7 +13373,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9580,24 +13381,23 @@ 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 + * {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. */ - 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; + 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 virtual machine scale set. + * 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. * @@ -9606,17 +13406,16 @@ 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. */ - listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network interfaces in a virtual machine scale set. + * 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. * @@ -9630,7 +13429,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9638,25 +13437,26 @@ 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 + * {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. */ - 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; + 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 the specified network interface ip configuration in a virtual machine - * scale set. + * Deletes the specified network 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} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -9665,18 +13465,19 @@ 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. */ - listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. + * Deletes the specified network 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} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -9690,7 +13491,7 @@ export interface NetworkInterfaces { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9698,34 +13499,49 @@ 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. + * {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. */ - 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 { + 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 all ip configurations in a network interface + * Creates or updates a network security group in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @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. * @@ -9734,18 +13550,44 @@ 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. */ - listWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all ip configurations in a network interface + * Creates or updates a network security group in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @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. * @@ -9759,7 +13601,7 @@ export interface NetworkInterfaceIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9767,27 +13609,30 @@ 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. + * {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, 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; + 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; /** - * Gets the specified network interface ip configuration. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} ipConfigurationName The name of the ip configuration name. + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9796,20 +13641,24 @@ 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. */ - getWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network interface ip configuration. + * Updates a network security group tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} networkSecurityGroupName The name of the network security + * group. * - * @param {string} ipConfigurationName The name of the ip configuration name. + * @param {object} parameters Parameters supplied to update network security + * group tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -9823,7 +13672,7 @@ export interface NetworkInterfaceIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfiguration} - The deserialized result object. + * @resolve {NetworkSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9831,21 +13680,20 @@ export interface NetworkInterfaceIPConfigurations { * * {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. + * {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, 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; + 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; /** - * Get all ip configurations in a network interface + * Gets all network security groups in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9857,14 +13705,14 @@ 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>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all ip configurations in a network interface + * Gets all network security groups in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9881,7 +13729,7 @@ export interface NetworkInterfaceIPConfigurations { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceIPConfigurationListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9889,34 +13737,24 @@ 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. + * {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 - * NetworkInterfaceLoadBalancers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceLoadBalancers { + 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; /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9925,18 +13763,17 @@ 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>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all network security groups in a resource group. * - * @param {string} networkInterfaceName The name of the network interface. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9950,7 +13787,7 @@ export interface NetworkInterfaceLoadBalancers { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. + * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9958,24 +13795,37 @@ 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. + * {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, 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; + 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 { /** - * List all load balancers in a network interface. + * Deletes the specified network security 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} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -9984,17 +13834,21 @@ 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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all load balancers in a network interface. + * Deletes the specified network security 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} networkSecurityGroupName The name of the network security + * group. + * + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -10008,7 +13862,7 @@ export interface NetworkInterfaceLoadBalancers { * * {Promise} A promise is returned. * - * @resolve {NetworkInterfaceLoadBalancerListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10016,36 +13870,27 @@ 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. + * {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 - * NetworkSecurityGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkSecurityGroups { + 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; /** - * Deletes the specified network security 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 @@ -10053,20 +13898,22 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security 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 @@ -10079,7 +13926,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10087,51 +13934,200 @@ 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. + * {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. */ - 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; + 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 the specified network security group. + * 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 {object} [options] Optional Parameters. + * @param {string} securityRuleName The name of the security rule. * - * @param {string} [options.expand] Expands referenced resources. + * @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. + * @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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network security group. + * 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 {object} [options] Optional Parameters. + * @param {string} securityRuleName The name of the security rule. * - * @param {string} [options.expand] Expands referenced resources. + * @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 @@ -10143,7 +14139,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10151,51 +14147,26 @@ 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. + * {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, 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; + 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; /** - * Creates or updates a network security group in the specified resource group. + * 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} 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 @@ -10203,44 +14174,19 @@ 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>; + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: 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. + * Gets all security rules in a network security group. * - * @param {string} [parameters.location] Resource location. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} networkSecurityGroupName The name of the network security + * group. * * @param {object} [options] Optional Parameters. * @@ -10254,7 +14200,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10262,30 +14208,28 @@ 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. + * {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. */ - 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; + 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; /** - * Updates a network security group tags. + * 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 {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -10294,24 +14238,21 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network security group tags. + * 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 {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} securityRuleName The name of the security rule. * * @param {object} [options] Optional Parameters. * @@ -10325,7 +14266,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10333,20 +14274,100 @@ 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. + * {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, 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; + 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; /** - * Gets all network security groups in a subscription. + * 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. * @@ -10355,14 +14376,95 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a subscription. + * 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. * @@ -10376,7 +14478,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10384,23 +14486,23 @@ 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. + * {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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(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; /** - * Gets all network security groups in a resource group. + * Gets all security rules in a network security 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. * @@ -10409,16 +14511,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. */ - listWithHttpOperationResponse(resourceGroupName: 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. + * Gets all security rules in a network security 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. * @@ -10432,7 +14535,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10440,21 +14543,30 @@ 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 + * {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, 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 + * DefaultSecurityRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface DefaultSecurityRules { /** - * Deletes the specified network security group. + * Gets all default security rules in a network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -10468,14 +14580,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security group. + * Gets all default security rules in a network security group. * * @param {string} resourceGroupName The name of the resource group. * @@ -10494,7 +14606,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10502,49 +14614,29 @@ 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. + * {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. */ - 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; + 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; /** - * Creates or updates a network security group in the specified resource group. + * 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 {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} defaultSecurityRuleName The name of the default security + * rule. * * @param {object} [options] Optional Parameters. * @@ -10553,44 +14645,22 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network security group in the specified resource group. + * 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 {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} defaultSecurityRuleName The name of the default security + * rule. * * @param {object} [options] Optional Parameters. * @@ -10604,7 +14674,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {SecurityRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10612,30 +14682,23 @@ 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. + * {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, 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; + 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; /** - * 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 default security rules in a network security group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10644,24 +14707,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. */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(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 default security rules in a network security group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10675,7 +14731,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroup} - The deserialized result object. + * @resolve {SecurityRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10683,23 +14739,46 @@ 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. + * {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. */ - 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; + 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 { /** - * Gets all network security groups in a subscription. + * Creates or updates a network watcher in the specified 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} 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. * @@ -10708,17 +14787,30 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a subscription. + * Creates or updates a network watcher in the specified 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} 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. * @@ -10732,7 +14824,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10740,24 +14832,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 - * 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. */ - 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; + 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 all network security groups in a resource group. + * Gets the specified network watcher by 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} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -10766,17 +14858,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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network security groups in a resource group. + * Gets the specified network watcher by 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} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -10790,7 +14883,7 @@ export interface NetworkSecurityGroups { * * {Promise} A promise is returned. * - * @resolve {NetworkSecurityGroupListResult} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10798,37 +14891,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 - * 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. */ - 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 { + 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 security rule. + * Deletes the specified network watcher resource. * * @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} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -10841,17 +14921,14 @@ export interface SecurityRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security rule. + * Deletes the specified network watcher resource. * * @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} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -10879,20 +14956,22 @@ export interface SecurityRules { * * {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; + 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; /** - * Get the specified network security rule. + * Updates a network watcher tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} securityRuleName The name of the security rule. + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -10901,21 +14980,23 @@ 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>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified network security rule. + * Updates a network watcher tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} securityRuleName The name of the security rule. + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -10929,7 +15010,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {NetworkWatcher} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10937,102 +15018,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. + * {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, 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; + 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; /** - * Creates or updates a security rule in the specified network security group. + * Gets all network watchers by 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} 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 @@ -11040,96 +15042,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a security rule in the specified network security group. + * Gets all network watchers by 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} 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 @@ -11142,7 +15065,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {NetworkWatcherListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11150,25 +15073,21 @@ 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. + * {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. */ - 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; + 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 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. + * Gets all network watchers by subscription. * * @param {object} [options] Optional Parameters. * @@ -11177,19 +15096,14 @@ 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. */ - listWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(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. + * Gets all network watchers by subscription. * * @param {object} [options] Optional Parameters. * @@ -11203,7 +15117,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {NetworkWatcherListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11211,28 +15125,39 @@ 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 + * {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, 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; + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the specified network security rule. + * Gets the current network topology by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} securityRuleName The name of the security rule. + * @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. * @@ -11241,21 +15166,32 @@ 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>; + getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network security rule. + * Gets the current network topology by resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} securityRuleName The name of the security rule. + * @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. * @@ -11269,7 +15205,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Topology} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11277,100 +15213,55 @@ 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. + * {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. */ - 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; + 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; /** - * Creates or updates a security rule in the specified network security group. + * 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} 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 {string} networkWatcherName The name of the network watcher. * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @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.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @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.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @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.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.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @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.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.localIPAddress The local 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.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} [securityRuleParameters.id] Resource ID. + * @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. * @@ -11379,95 +15270,49 @@ 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>; + verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a security rule in the specified network security group. + * 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} 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 {string} networkWatcherName The name of the network watcher. * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @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.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @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.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @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.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.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. + * @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.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.localIPAddress The local 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.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} [securityRuleParameters.id] Resource ID. + * @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. * @@ -11481,7 +15326,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {VerificationIPFlowResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11489,23 +15334,39 @@ 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. + * {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. */ - 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; + 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 all security rules in a network security group. + * Gets the next hop from 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 {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. * @@ -11514,17 +15375,32 @@ 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>; + getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all security rules in a network security group. + * Gets the next hop from 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 {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. * @@ -11538,7 +15414,7 @@ export interface SecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {NextHopResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11546,35 +15422,29 @@ 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. + * {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. */ - 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 { + 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 all default security rules in a network security group. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * 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. * @@ -11583,19 +15453,23 @@ 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>; + getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all default security rules in a network security group. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * 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. * @@ -11609,7 +15483,7 @@ export interface DefaultSecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {SecurityGroupViewResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11617,29 +15491,37 @@ 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 + * {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. */ - 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; + 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; /** - * Get the specified default network security rule. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. + * @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. * @@ -11648,22 +15530,30 @@ 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. */ - getWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the specified default network security rule. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkSecurityGroupName The name of the network security - * group. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. + * @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. * @@ -11677,7 +15567,7 @@ export interface DefaultSecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRule} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11685,23 +15575,30 @@ export interface DefaultSecurityRules { * * {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. + * {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. */ - 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; + 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; /** - * Gets all default security rules in a network security group. + * Get the last completed troubleshooting result on a specified resource * - * @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 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. * @@ -11710,17 +15607,24 @@ 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. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all default security rules in a network security group. + * Get the last completed troubleshooting result on a specified resource * - * @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 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. * @@ -11734,7 +15638,7 @@ export interface DefaultSecurityRules { * * {Promise} A promise is returned. * - * @resolve {SecurityRuleListResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11742,46 +15646,44 @@ 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. + * {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. */ - 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 { + 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; /** - * Creates or updates a network watcher in the specified resource group. + * Configures flow log 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 {object} parameters Parameters that define the network watcher - * resource. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. * - * @param {string} [parameters.id] Resource ID. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {string} [parameters.location] Resource location. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -11790,30 +15692,38 @@ 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>; + setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a network watcher in the specified resource group. + * Configures flow log 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 resource. + * + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow logging. * - * @param {object} parameters Parameters that define the network watcher - * resource. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {string} [parameters.id] Resource ID. + * @param {object} [parameters.retentionPolicy] * - * @param {string} [parameters.location] Resource location. + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. * - * @param {object} [parameters.tags] Resource tags. + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. * * @param {object} [options] Optional Parameters. * @@ -11827,7 +15737,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11835,24 +15745,31 @@ 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. + * {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. */ - 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; + 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 the specified network watcher by resource group. + * Queries status of flow log 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 {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. * @@ -11861,18 +15778,25 @@ 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>; + getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified network watcher by resource group. + * Queries status of flow log 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 {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. * @@ -11886,7 +15810,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11894,112 +15818,128 @@ 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. + * {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, 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; + 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 network watcher resource. + * 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 {object} [options] Optional Parameters. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters.source * - * @returns {Promise} A promise is returned + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network watcher resource. + * @param {object} parameters.destination * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. * - * @param {object} [options] Optional Parameters. + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.protocolConfiguration] * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] * - * {Promise} A promise is returned. + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' * - * @resolve {null} - The deserialized result object. + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. * - * @reject {Error|ServiceError} - The error object. + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * - * {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 * - * {null} [result] - The deserialized result object if an error did not occur. + * @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. */ - 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; - + checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a network watcher tags. + * 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 {object} parameters Parameters supplied to update network watcher - * tags. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} parameters.source * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. * - * @returns {Promise} A promise is returned + * @param {object} parameters.destination * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. * - * @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} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' * - * @param {object} parameters Parameters supplied to update network watcher - * tags. + * @param {object} [parameters.protocolConfiguration] * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -12013,7 +15953,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {ConnectivityInformation} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12021,22 +15961,50 @@ 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. + * {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. */ - 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; + 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 all network watchers by resource group. + * 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 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. * @@ -12045,16 +16013,43 @@ 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>; + getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network watchers by resource group. + * 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 {string} resourceGroupName The name of the resource group. + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -12068,7 +16063,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @resolve {AzureReachabilityReport} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12076,21 +16071,39 @@ 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 + * {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. */ - 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; + 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; /** - * Gets all network watchers by subscription. + * 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. * @@ -12099,14 +16112,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. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all network watchers by subscription. + * 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. * @@ -12120,7 +16151,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @resolve {AvailableProvidersList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12128,40 +16159,26 @@ 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 + * {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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(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; /** - * Gets the current network topology by 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. * - * @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 @@ -12169,33 +16186,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. */ - getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the current network topology by 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. * - * @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 @@ -12208,7 +16211,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {Topology} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12216,16 +16219,15 @@ export interface NetworkWatchers { * * {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. + * {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. */ - 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; + 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; /** @@ -12277,7 +16279,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -12345,9 +16347,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12382,7 +16384,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the next hop from the specified VM. @@ -12432,9 +16434,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12460,7 +16462,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -12502,9 +16504,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12537,7 +16539,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Initiate troubleshooting on a specified resource @@ -12585,9 +16587,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12614,7 +16616,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Get the last completed troubleshooting result on a specified resource @@ -12656,9 +16658,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12699,7 +16701,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Configures flow log on a specified resource. @@ -12755,9 +16757,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12785,7 +16787,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Queries status of flow log on a specified resource. @@ -12828,9 +16830,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12865,6 +16867,23 @@ export interface NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12876,7 +16895,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -12910,6 +16929,23 @@ export interface NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12938,9 +16974,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -12986,7 +17022,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -13048,9 +17084,9 @@ export interface NetworkWatchers { * * {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; + 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; /** @@ -13085,7 +17121,7 @@ export interface NetworkWatchers { * * @reject {Error|ServiceError} - The error object. */ - listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -13136,18 +17172,61 @@ export interface NetworkWatchers { * * {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; + 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 { /** - * Deletes the specified network watcher resource. + * 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 @@ -13155,19 +17234,53 @@ 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>; + createWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified network watcher resource. + * 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 @@ -13180,7 +17293,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13188,54 +17301,26 @@ 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. + * {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. */ - 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(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; /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * 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 {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 {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13244,49 +17329,20 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * 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 {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 {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13300,7 +17356,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {VerificationIPFlowResult} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13308,39 +17364,26 @@ 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. + * {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. */ - 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; + 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; /** - * Gets the next hop from the specified VM. + * 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 {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} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13349,32 +17392,20 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the next hop from the specified VM. + * 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 {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} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13388,7 +17419,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {NextHopResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13396,29 +17427,25 @@ 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. + * {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. */ - 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; + 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; /** - * Gets the configured and effective security group rules on the specified VM. + * 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 {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13427,23 +17454,20 @@ 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>; + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the configured and effective security group rules on the specified VM. + * 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 {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13457,7 +17481,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. * @@ -13465,37 +17489,26 @@ 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. */ - 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; + 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; /** - * Initiate troubleshooting on a specified resource + * 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 {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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -13504,30 +17517,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. */ - beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Initiate troubleshooting on a specified resource + * 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 {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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -13541,7 +17545,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13549,30 +17553,25 @@ 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. + * {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. */ - 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; + 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; /** - * Get the last completed troubleshooting result on a specified resource + * 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} 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 {string} networkWatcherName The name of the Network Watcher resource. * * @param {object} [options] Optional Parameters. * @@ -13581,24 +17580,18 @@ 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>; + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get the last completed troubleshooting result on a specified resource + * 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} 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 {string} networkWatcherName The name of the Network Watcher resource. * * @param {object} [options] Optional Parameters. * @@ -13612,7 +17605,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {PacketCaptureListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13620,44 +17613,59 @@ 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. + * {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. */ - 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; + 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; /** - * Configures flow log on a specified resource. + * Create and start a packet capture 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 define the configuration of flow - * log. + * @param {string} packetCaptureName The name of the packet capture session. * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * @param {object} parameters Parameters that define the create packet capture + * operation. * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. * - * @param {object} [parameters.retentionPolicy] + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @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. * @@ -13666,38 +17674,52 @@ 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>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Configures flow log on a specified resource. + * Create and start a packet capture 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 define the configuration of flow - * log. + * @param {string} packetCaptureName The name of the packet capture session. * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow logging. + * @param {object} parameters Parameters that define the create packet capture + * operation. * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. + * @param {string} parameters.target The ID of the targeted resource, only VM + * is currently supported. * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes + * captured per packet, the remaining bytes are truncated. * - * @param {object} [parameters.retentionPolicy] + * @param {number} [parameters.totalBytesPerSession] Maximum size of the + * capture output. * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. + * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the + * capture session in seconds. * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. + * @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. * @@ -13711,7 +17733,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {PacketCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13719,31 +17741,26 @@ 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. + * {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. */ - 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; + 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; /** - * Queries status of flow log on a specified resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * Deletes the specified packet capture session. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13752,25 +17769,20 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: 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. + * Deletes the specified packet capture session. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} parameters Parameters that define a resource to query flow - * log status. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow logging status. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13784,7 +17796,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13792,49 +17804,25 @@ 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. + * {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. */ - 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; + 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; /** - * 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 + * Stops a specified packet capture session. * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13843,43 +17831,20 @@ 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>; + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: 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 + * Stops a specified packet capture session. * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. + * @param {string} packetCaptureName The name of the packet capture session. * * @param {object} [options] Optional Parameters. * @@ -13893,7 +17858,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {ConnectivityInformation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13901,50 +17866,26 @@ 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. + * {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. */ - 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; + 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; /** - * 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. + * Query the status of a running packet capture session. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} resourceGroupName The name of the resource group. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -13953,43 +17894,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. */ - beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGetStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: 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. + * Query the status of a running packet capture session. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} resourceGroupName The name of the resource group. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} packetCaptureName The name given to the packet capture + * session. * * @param {object} [options] Optional Parameters. * @@ -14003,7 +17922,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AzureReachabilityReport} - The deserialized result object. + * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14011,39 +17930,69 @@ 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 + * {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. */ - 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; + 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 { /** - * Lists all available internet service providers for a specified Azure region. + * Create or update a connection monitor. * - * @param {string} resourceGroupName The name of the network watcher 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} networkWatcherName The name of the Network Watcher resource. * - * @param {object} parameters Parameters that scope the list of available - * providers. + * @param {string} connectionMonitorName The name of the connection monitor. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} [parameters.location] Connection monitor location. * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @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. * @@ -14052,32 +18001,53 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available internet service providers for a specified Azure region. + * Create or update a connection monitor. * - * @param {string} resourceGroupName The name of the network watcher 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} networkWatcherName The name of the Network Watcher resource. * - * @param {object} parameters Parameters that scope the list of available - * providers. + * @param {string} connectionMonitorName The name of the connection monitor. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} [parameters.location] Connection monitor location. * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @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. * @@ -14091,7 +18061,7 @@ export interface NetworkWatchers { * * {Promise} A promise is returned. * - * @resolve {AvailableProvidersList} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14099,68 +18069,28 @@ 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 + * {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. */ - 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 { + 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; /** - * 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. + * Gets a connection monitor by name. * - * @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} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @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} networkWatcherName The name of the Network Watcher resource. * - * @param {array} [parameters.filters] + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14169,52 +18099,21 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, 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. + * Gets a connection monitor by name. * - * @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} resourceGroupName The name of the resource group containing + * Network Watcher. * - * @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} networkWatcherName The name of the Network Watcher resource. * - * @param {array} [parameters.filters] + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14228,7 +18127,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14236,26 +18135,28 @@ 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. + * {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. */ - 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; + 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 a packet capture session by name. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14264,20 +18165,21 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a packet capture session by name. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14291,7 +18193,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14299,26 +18201,26 @@ 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. + * {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, 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; + 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; /** - * Deletes the specified packet capture session. + * 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. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14331,16 +18233,17 @@ export interface PacketCaptures { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified packet capture session. + * 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. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14368,19 +18271,20 @@ export interface PacketCaptures { * * {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; + 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; /** - * Stops a specified packet capture session. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14393,16 +18297,17 @@ export interface PacketCaptures { * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops a specified packet capture session. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14430,20 +18335,21 @@ export interface PacketCaptures { * * {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; + 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 the status of a running packet capture session. + * 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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {string} connectionMonitorName The name given to the connection + * monitor. * * @param {object} [options] Optional Parameters. * @@ -14452,21 +18358,22 @@ 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>; + queryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query the status of a running packet capture session. + * 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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {string} connectionMonitorName The name given to the connection + * monitor. * * @param {object} [options] Optional Parameters. * @@ -14480,7 +18387,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. + * @resolve {ConnectionMonitorQueryResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14488,23 +18395,24 @@ 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 + * {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. */ - 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(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 packet capture sessions within the specified resource group. + * Lists all connection monitors for the specified Network Watcher. * - * @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. * @@ -14515,16 +18423,17 @@ 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>; + listWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all packet capture sessions within the specified resource group. + * Lists all connection monitors for the specified Network Watcher. * - * @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. * @@ -14540,7 +18449,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureListResult} - The deserialized result object. + * @resolve {ConnectionMonitorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14548,59 +18457,60 @@ 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 + * {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; + 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. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * - * @param {object} parameters Parameters that define the create packet capture - * operation. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {string} [parameters.location] Connection monitor location. * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {object} parameters.source * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. * - * @param {object} parameters.storageLocation + * @param {number} [parameters.source.port] The source port used by connection + * monitor. * - * @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.destination * - * @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.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. * - * @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.destination.address] Address of the connection + * monitor destination (IP or domain name). * - * @param {array} [parameters.filters] + * @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. * @@ -14609,52 +18519,53 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create and start a packet capture on the specified VM. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * - * @param {object} parameters Parameters that define the create packet capture - * operation. + * @param {object} parameters Parameters that define the operation to create a + * connection monitor. * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. + * @param {string} [parameters.location] Connection monitor location. * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. + * @param {object} [parameters.tags] Connection monitor tags. * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. + * @param {object} parameters.source * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. + * @param {string} parameters.source.resourceId The ID of the resource used as + * the source by connection monitor. * - * @param {object} parameters.storageLocation + * @param {number} [parameters.source.port] The source port used by connection + * monitor. * - * @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.destination * - * @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.destination.resourceId] The ID of the resource + * used as the destination by connection monitor. * - * @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.destination.address] Address of the connection + * monitor destination (IP or domain name). * - * @param {array} [parameters.filters] + * @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. * @@ -14668,7 +18579,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureResult} - The deserialized result object. + * @resolve {ConnectionMonitorResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14676,26 +18587,28 @@ 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. + * {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. */ - 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; + 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 packet capture session. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14708,16 +18621,17 @@ export interface PacketCaptures { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the specified packet capture session. + * 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} 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 {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14745,19 +18659,20 @@ export interface PacketCaptures { * * {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; + 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 a specified packet capture session. + * 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. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14770,16 +18685,17 @@ export interface PacketCaptures { * * @reject {Error|ServiceError} - The error object. */ - beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stops a specified packet capture session. + * 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. + * @param {string} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name of the packet capture session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14807,20 +18723,20 @@ export interface PacketCaptures { * * {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; + 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; /** - * Query the status of a running packet capture session. + * 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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14829,21 +18745,21 @@ 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>; + beginStartWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Query the status of a running packet capture session. + * 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} networkWatcherName The name of the Network Watcher resource. * - * @param {string} packetCaptureName The name given to the packet capture - * session. + * @param {string} connectionMonitorName The name of the connection monitor. * * @param {object} [options] Optional Parameters. * @@ -14857,7 +18773,7 @@ export interface PacketCaptures { * * {Promise} A promise is returned. * - * @resolve {PacketCaptureQueryStatusResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14865,17 +18781,83 @@ 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 + * {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. */ - 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; + 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; } /** @@ -15167,6 +19149,9 @@ export interface PublicIPAddresses { * 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. * @@ -15247,6 +19232,9 @@ export interface PublicIPAddresses { * 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. * @@ -15802,6 +19790,9 @@ export interface PublicIPAddresses { * 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. * @@ -15882,6 +19873,9 @@ export interface PublicIPAddresses { * 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. * @@ -17161,8 +21155,6 @@ export interface RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17203,8 +21195,6 @@ export interface RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17258,8 +21248,6 @@ export interface RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17294,8 +21282,6 @@ export interface RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17477,8 +21463,6 @@ export interface RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17519,8 +21503,6 @@ export interface RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17574,8 +21556,6 @@ export interface RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -17610,8 +21590,6 @@ export interface RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -19407,10 +23385,16 @@ export interface VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 a Virtual Network. + * @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. @@ -19469,10 +23453,16 @@ export interface VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. @@ -19909,10 +23899,16 @@ export interface VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 a Virtual Network. + * @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. @@ -19971,10 +23967,16 @@ export interface VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. @@ -21740,6 +25742,9 @@ export interface VirtualNetworkGateways { * @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. @@ -21855,6 +25860,9 @@ export interface VirtualNetworkGateways { * @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. @@ -22825,6 +26833,208 @@ export interface VirtualNetworkGateways { 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. * @@ -22978,6 +27188,9 @@ export interface VirtualNetworkGateways { * @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. @@ -23093,6 +27306,9 @@ export interface VirtualNetworkGateways { * @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. @@ -23824,6 +28040,208 @@ export interface VirtualNetworkGateways { 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. * @@ -24027,6 +28445,10 @@ export interface VirtualNetworkGatewayConnections { * [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 @@ -24215,6 +28637,10 @@ export interface VirtualNetworkGatewayConnections { * [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 @@ -24903,6 +29329,10 @@ export interface VirtualNetworkGatewayConnections { * [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 @@ -25091,6 +29521,10 @@ export interface VirtualNetworkGatewayConnections { * [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 diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js index afb42b96eb..b71044c90d 100644 --- a/lib/services/networkManagement2/lib/operations/index.js +++ b/lib/services/networkManagement2/lib/operations/index.js @@ -16,11 +16,15 @@ 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'); @@ -36,6 +40,7 @@ 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'); diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js index 0f637a0bc9..7ff40ef853 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js index 04c9e8207c..b71f1418fa 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js index d1b14869e6..ae60d4849a 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js index 3f9ecf40be..cd605042fa 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js index c06ce9e4c4..61a9053ab2 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js index 292c4fd182..5adef86148 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancers.js @@ -115,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -610,7 +610,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -748,7 +748,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -806,7 +806,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -929,7 +929,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1004,7 +1004,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1033,7 +1033,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1050,7 +1050,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1110,7 +1110,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js index 77f186dd3c..f9b250d3f2 100644 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js @@ -164,7 +164,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -460,7 +460,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -635,7 +635,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -745,7 +745,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -762,7 +762,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -818,7 +818,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -882,7 +882,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -956,7 +956,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js index c77c3287b8..1fdc6b0504 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -196,7 +196,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js index 2660784c76..b24a894f20 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js index 53f453a6f0..5187331ae1 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaces.js @@ -115,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -513,7 +513,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -647,7 +647,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1745,7 +1745,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1803,7 +1803,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1962,7 +1962,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2037,7 +2037,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2066,7 +2066,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -2083,7 +2083,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -2144,7 +2144,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2305,7 +2305,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2449,7 +2449,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js index 2eefeffa02..cae736c890 100644 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js @@ -117,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -451,7 +451,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -585,7 +585,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -724,7 +724,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -782,7 +782,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -876,7 +876,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -951,7 +951,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -980,7 +980,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -997,7 +997,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1059,7 +1059,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index beeea7ca6f..e97208f157 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -61,7 +61,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -238,7 +238,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -449,7 +449,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -608,7 +608,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,7 +744,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -893,7 +893,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1694,6 +1694,23 @@ function _getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, op * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1996,7 +2013,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2154,7 +2171,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2345,7 +2362,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2528,7 +2545,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2717,7 +2734,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2900,7 +2917,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3097,7 +3114,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3281,7 +3298,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3455,6 +3472,23 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3484,7 +3518,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3687,7 +3721,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3879,7 +3913,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5538,6 +5572,23 @@ class NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5595,6 +5646,23 @@ class NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6806,6 +6874,23 @@ class NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6863,6 +6948,23 @@ class NetworkWatchers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/networkManagement2/lib/operations/operations.js b/lib/services/networkManagement2/lib/operations/operations.js index 40367942fc..63798f7219 100644 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ b/lib/services/networkManagement2/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index e2f6d0ddd7..3a0f8d1b02 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -163,7 +163,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -523,7 +523,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -700,7 +700,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -865,7 +865,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -927,7 +927,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -996,7 +996,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1130,7 +1130,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index 92c013925a..4c68681afe 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -115,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -272,6 +272,9 @@ function _get(resourceGroupName, publicIpAddressName, options, callback) { * 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. * @@ -482,7 +485,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -616,7 +619,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1241,7 +1244,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1299,7 +1302,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1374,6 +1377,9 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal * 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. * @@ -1427,7 +1433,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1502,7 +1508,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1531,7 +1537,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1548,7 +1554,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1609,7 +1615,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2491,6 +2497,9 @@ class PublicIPAddresses { * 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. * @@ -2583,6 +2592,9 @@ class PublicIPAddresses { * 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. * @@ -3342,6 +3354,9 @@ class PublicIPAddresses { * 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. * @@ -3434,6 +3449,9 @@ class PublicIPAddresses { * 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. * diff --git a/lib/services/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js index 880fefc62f..7b86de829c 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ b/lib/services/networkManagement2/lib/operations/routeFilterRules.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -254,8 +254,6 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -348,8 +346,6 @@ function _createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilt * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -458,7 +454,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -602,7 +598,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -664,7 +660,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -722,8 +718,6 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -758,7 +752,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout { routeFilterRuleParameters = {}; } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -923,8 +917,6 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -959,7 +951,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR { routeFilterRuleParameters = {}; } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1439,8 +1431,6 @@ class RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1493,8 +1483,6 @@ class RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1563,8 +1551,6 @@ class RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1611,8 +1597,6 @@ class RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1863,8 +1847,6 @@ class RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1917,8 +1899,6 @@ class RouteFilterRules { * * @param {string} [routeFilterRuleParameters.location] Resource location. * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -1987,8 +1967,6 @@ class RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. @@ -2035,8 +2013,6 @@ class RouteFilterRules { * @param {array} routeFilterRuleParameters.communities The collection for bgp * community values to filter on. e.g. ['12076:5010','12076:5020'] * - * @param {object} [routeFilterRuleParameters.tags] Resource tags. - * * @param {string} [routeFilterRuleParameters.id] Resource ID. * * @param {object} [options] Optional Parameters. diff --git a/lib/services/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js index 091ea9bf51..7cfe19234f 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ b/lib/services/networkManagement2/lib/operations/routeFilters.js @@ -116,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -447,7 +447,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -582,7 +582,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -857,7 +857,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1047,7 +1047,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js index 85b75bf87e..87a83020b2 100644 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ b/lib/services/networkManagement2/lib/operations/routeTables.js @@ -115,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -444,7 +444,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -579,7 +579,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -713,7 +713,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -771,7 +771,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -861,7 +861,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1042,7 +1042,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js index 0642dfa622..0c305dfacb 100644 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ b/lib/services/networkManagement2/lib/operations/routes.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,7 +371,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -515,7 +515,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -577,7 +577,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -675,7 +675,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js index 33ee058884..618bd59702 100644 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ b/lib/services/networkManagement2/lib/operations/securityRules.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -422,7 +422,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -567,7 +567,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -629,7 +629,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index d733d7cb00..e8dbbc4c73 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -119,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -425,7 +425,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -569,7 +569,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -631,7 +631,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js index 2302f2532e..4bcc7c29c5 100644 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ b/lib/services/networkManagement2/lib/operations/usages.js @@ -47,7 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js index 1c5c05c1e4..571577bf39 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js @@ -93,6 +93,10 @@ const WebResource = msRest.WebResource; * [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 @@ -298,7 +302,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -682,7 +686,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -825,7 +829,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1097,6 +1101,10 @@ function _resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, * [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 @@ -1223,7 +1231,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1400,7 +1408,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1533,7 +1541,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1704,7 +1712,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1779,7 +1787,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1808,7 +1816,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1825,7 +1833,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1893,7 +1901,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2249,6 +2257,10 @@ class VirtualNetworkGatewayConnections { * [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 @@ -2449,6 +2461,10 @@ class VirtualNetworkGatewayConnections { * [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 @@ -3341,6 +3357,10 @@ class VirtualNetworkGatewayConnections { * [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 @@ -3541,6 +3561,10 @@ class VirtualNetworkGatewayConnections { * [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 diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index d02073f9ca..c70e53732a 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js @@ -86,6 +86,9 @@ const WebResource = msRest.WebResource; * @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. @@ -223,7 +226,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -513,7 +516,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -654,7 +657,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1259,7 +1262,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1537,6 +1540,205 @@ function _getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer }); } + +/** + * 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. * @@ -1583,7 +1785,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1785,6 +1987,9 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC * @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. @@ -1844,7 +2049,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2021,7 +2226,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2079,7 +2284,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2153,7 +2358,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2319,7 +2524,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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2383,7 +2588,7 @@ function _beginReset(resourceGroupName, virtualNetworkGatewayName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2489,7 +2694,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2676,7 +2881,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2844,7 +3049,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2999,7 +3204,7 @@ function _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, op throw new Error('callback cannot be null.'); } let peer = (options && options.peer !== undefined) ? options.peer : undefined; - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3151,7 +3356,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3299,7 +3504,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3412,10 +3617,50 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, } /** - * Gets all virtual network gateways by resource group. + * 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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3429,14 +3674,14 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, * {Error} 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 + * 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 _listNext(nextPageLink, options, callback) { +function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3446,10 +3691,20 @@ function _listNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.'); @@ -3459,12 +3714,20 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3482,14 +3745,28 @@ function _listNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3524,7 +3801,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayListResult']().mapper(); + let resultMapper = new client.models['VpnClientIPsecParameters']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3540,10 +3817,13 @@ function _listNext(nextPageLink, options, callback) { } /** - * Gets all the connections in a virtual network gateway. + * 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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -3557,14 +3837,14 @@ function _listNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * for more information. + * 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 _listConnectionsNext(nextPageLink, options, callback) { +function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3574,10 +3854,17 @@ function _listConnectionsNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.'); @@ -3587,12 +3874,20 @@ function _listConnectionsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3652,7 +3947,7 @@ function _listConnectionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayListConnectionsResult']().mapper(); + let resultMapper = new client.models['VpnClientIPsecParameters']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3667,12 +3962,268 @@ function _listConnectionsNext(nextPageLink, options, callback) { }); } -/** Class representing a VirtualNetworkGateways. */ -class VirtualNetworkGateways { - /** - * Create a VirtualNetworkGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ +/** + * 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; @@ -3689,6 +4240,8 @@ class VirtualNetworkGateways { this._supportedVpnDevices = _supportedVpnDevices; this._getLearnedRoutes = _getLearnedRoutes; this._getAdvertisedRoutes = _getAdvertisedRoutes; + this._setVpnclientIpsecParameters = _setVpnclientIpsecParameters; + this._getVpnclientIpsecParameters = _getVpnclientIpsecParameters; this._vpnDeviceConfigurationScript = _vpnDeviceConfigurationScript; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; @@ -3700,6 +4253,8 @@ class VirtualNetworkGateways { this._beginGetBgpPeerStatus = _beginGetBgpPeerStatus; this._beginGetLearnedRoutes = _beginGetLearnedRoutes; this._beginGetAdvertisedRoutes = _beginGetAdvertisedRoutes; + this._beginSetVpnclientIpsecParameters = _beginSetVpnclientIpsecParameters; + this._beginGetVpnclientIpsecParameters = _beginGetVpnclientIpsecParameters; this._listNext = _listNext; this._listConnectionsNext = _listConnectionsNext; } @@ -3775,6 +4330,9 @@ class VirtualNetworkGateways { * @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. @@ -3902,6 +4460,9 @@ class VirtualNetworkGateways { * @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. @@ -4954,25 +5515,206 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + 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._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); } } /** - * Gets a xml format representation for supported vpn devices. + * 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 @@ -4980,15 +5722,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - supportedVpnDevicesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4999,13 +5741,16 @@ class VirtualNetworkGateways { } /** - * Gets a xml format representation for supported vpn devices. + * 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 @@ -5018,7 +5763,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {GatewayRouteListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5026,13 +5771,15 @@ class VirtualNetworkGateways { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link 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. */ - supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { + getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5041,26 +5788,63 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); } } /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * 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 @@ -5068,15 +5852,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5087,14 +5871,51 @@ class VirtualNetworkGateways { } /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * 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 @@ -5107,7 +5928,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VpnClientIPsecParameters} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5116,14 +5937,14 @@ class VirtualNetworkGateways { * {Error} 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 + * 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. */ - getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { + setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5132,27 +5953,25 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); } } /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * 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 name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -5161,15 +5980,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { + getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5180,15 +5999,13 @@ class VirtualNetworkGateways { } /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * 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 name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -5202,7 +6019,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VpnClientIPsecParameters} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5211,14 +6028,14 @@ class VirtualNetworkGateways { * {Error} 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 + * 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. */ - getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback) { + getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5227,14 +6044,14 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); + return self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); } } @@ -5418,6 +6235,9 @@ class VirtualNetworkGateways { * @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. @@ -5545,6 +6365,9 @@ class VirtualNetworkGateways { * @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. @@ -6534,6 +7357,262 @@ class VirtualNetworkGateways { } } + /** + * 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. * diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js index 72e4d63ac7..aef2006b54 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -401,7 +401,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -546,7 +546,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -608,7 +608,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -733,7 +733,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js index 8d653362d9..8815559ff7 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworks.js @@ -115,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -265,10 +265,16 @@ function _get(resourceGroupName, virtualNetworkName, options, callback) { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 a Virtual Network. + * @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. @@ -464,7 +470,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -598,7 +604,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -741,7 +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 = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { @@ -891,7 +897,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1033,7 +1039,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1091,7 +1097,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1159,10 +1165,16 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. @@ -1201,7 +1213,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1383,7 +1395,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-10-01'; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2126,10 +2138,16 @@ class VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. @@ -2200,10 +2218,16 @@ class VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 a Virtual Network. + * @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. @@ -2817,10 +2841,16 @@ class VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. @@ -2891,10 +2921,16 @@ class VirtualNetworks { * 'Failed'. * * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in a Virtual Network. + * 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 {boolean} [parameters.enableVmProtection] Indicates if Vm protection - * is enabled for all the subnets in a 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. diff --git a/lib/services/networkManagement2/package.json b/lib/services/networkManagement2/package.json index 18c19de6ec..347bc2ed7b 100644 --- a/lib/services/networkManagement2/package.json +++ b/lib/services/networkManagement2/package.json @@ -1,37 +1,22 @@ { "name": "azure-arm-network", "author": "Microsoft Corporation", - "contributors": [ - "Siegemund, Frank ", - "Rajendran, Deepak ", - "Choubey, Ankur " - ], - "version": "5.1.0", - "description": "Microsoft Azure Network Resource Provider Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/networkManagementClient.js", - "types": "./lib/networkManagementClient.d.ts", - "license": "MIT", + "description": "NetworkManagementClient Library with typescript type definitions for node", + "version": "5.2.0", "dependencies": { - "ms-rest" : "^2.2.2", - "ms-rest-azure" : "^2.3.3" + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "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": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" } } From 44fba55541feefb443643161689e359bfad9a05b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 6 Apr 2018 13:33:32 -0700 Subject: [PATCH 03/21] Generated from be105bf5be90b400591243fe49226921e5dadcbd (#2684) Copy App Gateway Examples from 2018-01-01 to 2018-02-01 --- lib/services/networkManagement2/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/networkManagement2/package.json b/lib/services/networkManagement2/package.json index 347bc2ed7b..ef60cb7ab2 100644 --- a/lib/services/networkManagement2/package.json +++ b/lib/services/networkManagement2/package.json @@ -4,7 +4,7 @@ "description": "NetworkManagementClient Library with typescript type definitions for node", "version": "5.2.0", "dependencies": { - "ms-rest": "^2.3.3", + "ms-rest": "^2.3.2", "ms-rest-azure": "^2.5.5" }, "keywords": [ "node", "azure" ], From 6376f15db8b13b6bc00cdbf93a10589b7f9735f3 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 10 Apr 2018 11:01:36 -0700 Subject: [PATCH 04/21] [AutoPR network/resource-manager] Add Local and Virtual Gateway Examples (#2701) * Generated from a9c23699751feeec69e262eca9d20c7b3954b1bc Add Local and Virtual Gateway Examples * Generated from 52569aaeeb6240d2e4597da6afc5faa2ce0c92df Added missing lines from 2018-02-01 to virtualNetworkGateway From 4ea799f9170c23c2084c2c8a120684d52f236fed Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 25 Apr 2018 14:51:10 -0700 Subject: [PATCH 05/21] [AutoPR network/resource-manager] Network Watcher: Suppressing a validation message (#2785) * Generated from 020667ced23298f24df9b41844504340faf7b113 Network Watcher: Suppressing a validation message * Generated from 857a54b5f417a5d53c2715d3d852e99e159d4fec Network watcher: Fixed property name in ConnectivityCheckRequest: HTTPConfiguration -> httpConfiguration * Generated from 51b3f3e34c0cc3a9afa0477cba19f434ab443124 Fixed message in warning supression --- .../lib/models/expressRouteCrossConnection.js | 3 - .../expressRouteCrossConnectionPeering.js | 1 - .../lib/models/httpConfiguration.js | 85 +++++++++++++++++++ .../networkManagement2/lib/models/index.d.ts | 8 +- .../expressRouteCrossConnectionPeerings.js | 18 ++++ .../expressRouteCrossConnections.js | 60 +++++++++++++ .../lib/operations/index.d.ts | 52 ++++++++++++ 7 files changed, 219 insertions(+), 8 deletions(-) create mode 100644 lib/services/networkManagement2/lib/models/httpConfiguration.js 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/httpConfiguration.js b/lib/services/networkManagement2/lib/models/httpConfiguration.js new file mode 100644 index 0000000000..9d79da42bf --- /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/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index e620b9e1f6..62a17e6f38 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -3164,7 +3164,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 +3203,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; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js index 335d82ab08..03589e9500 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -412,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. * @@ -722,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. * @@ -1422,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. * @@ -1554,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. * @@ -1800,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. * @@ -1932,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 3529e8b314..65dbfa1607 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -442,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'. @@ -881,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'. @@ -2238,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'. @@ -2291,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'. @@ -2762,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'. @@ -2815,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/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index ebd9602206..8916b437d4 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -6781,6 +6781,16 @@ export interface 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'. @@ -6822,6 +6832,16 @@ export interface 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'. @@ -7170,6 +7190,16 @@ export interface 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'. @@ -7211,6 +7241,16 @@ export interface 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'. @@ -7900,6 +7940,9 @@ export interface 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. * @@ -8020,6 +8063,9 @@ export interface 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. * @@ -8224,6 +8270,9 @@ export interface 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. * @@ -8344,6 +8393,9 @@ export interface 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. * From 881d53a3cdea46276e29e7270447db580f6f1aef Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 16 May 2018 17:33:28 -0700 Subject: [PATCH 06/21] Generated from 30ecc6996595e8e8fea4215fb88141aa787e4ebd (#2864) Merge branch 'master' into Network-2018-05-01 # Conflicts: # specification/network/resource-manager/readme.md --- ...icationGatewayAuthenticationCertificate.js | 4 +- .../applicationGatewayBackendAddressPool.js | 4 +- ...icationGatewayBackendHealthHttpSettings.js | 13 +- .../applicationGatewayBackendHealthPool.js | 4 +- .../applicationGatewayBackendHttpSettings.js | 11 +- ...plicationGatewayFrontendIPConfiguration.js | 4 +- .../models/applicationGatewayFrontendPort.js | 4 +- .../models/applicationGatewayHttpListener.js | 8 +- .../applicationGatewayIPConfiguration.js | 4 +- .../lib/models/applicationGatewayPathRule.js | 4 +- .../lib/models/applicationGatewayProbe.js | 8 +- ...applicationGatewayRedirectConfiguration.js | 4 +- .../applicationGatewayRequestRoutingRule.js | 8 +- .../applicationGatewaySslCertificate.js | 4 +- .../applicationGatewaySslPredefinedPolicy.js | 2 +- .../models/applicationGatewayUrlPathMap.js | 4 +- .../lib/models/ddosProtectionPlan.js | 10 +- .../lib/models/expressRouteCircuitArpTable.js | 4 +- .../models/expressRouteCircuitRoutesTable.js | 12 +- .../expressRouteCircuitRoutesTableSummary.js | 2 +- .../lib/models/flowLogInformation.js | 28 +- .../lib/models/flowLogStatusParameters.js | 5 +- .../networkManagement2/lib/models/index.d.ts | 206 ++- .../networkManagement2/lib/models/index.js | 2 + ...trafficAnalyticsConfigurationProperties.js | 76 ++ .../lib/models/trafficAnalyticsProperties.js | 65 + .../lib/models/virtualNetworkGateway.js | 6 +- .../models/virtualNetworkGatewayConnection.js | 12 +- .../lib/models/virtualNetworkGatewaySku.js | 6 +- .../lib/networkManagementClient.js | 2 +- .../lib/operations/applicationGateways.js | 26 +- .../operations/applicationSecurityGroups.js | 10 +- .../operations/availableEndpointServices.js | 2 +- .../lib/operations/bgpServiceCommunities.js | 2 +- .../lib/operations/connectionMonitors.js | 14 +- .../lib/operations/ddosProtectionPlans.js | 22 +- .../lib/operations/defaultSecurityRules.js | 4 +- .../expressRouteCircuitAuthorizations.js | 8 +- .../expressRouteCircuitConnections.js | 6 +- .../operations/expressRouteCircuitPeerings.js | 8 +- .../lib/operations/expressRouteCircuits.js | 22 +- .../expressRouteCrossConnectionPeerings.js | 8 +- .../expressRouteCrossConnections.js | 16 +- .../expressRouteServiceProviders.js | 2 +- .../lib/operations/inboundNatRules.js | 8 +- .../lib/operations/index.d.ts | 592 ++------ .../loadBalancerBackendAddressPools.js | 4 +- .../loadBalancerFrontendIPConfigurations.js | 4 +- .../loadBalancerLoadBalancingRules.js | 4 +- .../loadBalancerNetworkInterfaces.js | 2 +- .../lib/operations/loadBalancerProbes.js | 4 +- .../lib/operations/loadBalancers.js | 12 +- .../lib/operations/localNetworkGateways.js | 10 +- .../networkInterfaceIPConfigurations.js | 4 +- .../networkInterfaceLoadBalancers.js | 2 +- .../lib/operations/networkInterfaces.js | 16 +- .../lib/operations/networkSecurityGroups.js | 12 +- .../lib/operations/networkWatchers.js | 232 +++- .../lib/operations/operations.js | 2 +- .../lib/operations/packetCaptures.js | 12 +- .../lib/operations/publicIPAddresses.js | 12 +- .../lib/operations/routeFilterRules.js | 10 +- .../lib/operations/routeFilters.js | 12 +- .../lib/operations/routeTables.js | 12 +- .../lib/operations/routes.js | 8 +- .../lib/operations/securityRules.js | 8 +- .../lib/operations/subnets.js | 8 +- .../lib/operations/usages.js | 2 +- .../virtualNetworkGatewayConnections.js | 52 +- .../lib/operations/virtualNetworkGateways.js | 1189 +---------------- .../lib/operations/virtualNetworkPeerings.js | 8 +- .../lib/operations/virtualNetworks.js | 16 +- lib/services/networkManagement2/package.json | 7 +- 73 files changed, 996 insertions(+), 1944 deletions(-) create mode 100644 lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js create mode 100644 lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js 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/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/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/applicationGatewaySslPredefinedPolicy.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js index 8c522f4c52..7e979bed83 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 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/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/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/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/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index 62a17e6f38..7ac2dcc14a 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -1267,8 +1267,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 +1305,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 +1338,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 +1605,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 +1643,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 +1670,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. @@ -1753,8 +1755,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 +1779,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 +1808,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 +1840,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 +1866,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 +1892,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 +1902,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 +1939,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 +1978,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 +2005,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 +2038,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 +2053,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 +2093,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 +2133,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. @@ -2389,7 +2391,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 +2434,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 +2451,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 +2902,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 +2934,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 +2969,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 @@ -4502,23 +4515,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 +4581,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 +5637,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 +5866,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 +6066,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 +6141,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 diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index 4f242870be..38bb14561f 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -141,6 +141,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'); 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/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/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index 96ad44890a..cdb1b643dd 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -61,7 +61,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js index c05e4b5530..6502163d2c 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -535,7 +535,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -671,7 +671,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1013,7 +1013,7 @@ function _listAvailableWafRuleSets(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1145,7 +1145,7 @@ function _listAvailableSslOptions(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1278,7 +1278,7 @@ function _listAvailableSslPredefinedPolicies(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1412,7 +1412,7 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1550,7 +1550,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1796,7 +1796,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1978,7 +1978,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2262,7 +2262,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2394,7 +2394,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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js index 7c8972e9d1..d2fb1e4dc9 100644 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js @@ -115,7 +115,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -344,7 +344,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -478,7 +478,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -617,7 +617,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -754,7 +754,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js index d406ad216c..b3f2c79a58 100644 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js @@ -48,7 +48,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js index 301e2a5673..4c81d1f28d 100644 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js index 6cb83da8c6..e68f66d800 100644 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -167,7 +167,7 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -597,7 +597,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -776,7 +776,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -959,7 +959,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1091,7 +1091,7 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1223,7 +1223,7 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1358,7 +1358,7 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js index 907ea57fc1..03940c23c9 100644 --- a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js +++ b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -231,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. @@ -339,7 +337,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -473,7 +471,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -611,7 +609,7 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -712,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. @@ -746,7 +742,7 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1344,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. @@ -1385,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. @@ -1695,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. @@ -1736,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 b3c7d514ec..0821fead98 100644 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js index f8f6c392ae..06f3815398 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -367,7 +367,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -512,7 +512,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -665,7 +665,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js index 910077bc4c..5f68ec4d4c 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js @@ -125,7 +125,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -395,7 +395,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -565,7 +565,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 772e968fe7..87ceb944c9 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js @@ -117,7 +117,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -620,7 +620,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -883,7 +883,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index 96abaea1ec..ac5a1e53d1 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -728,7 +728,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -874,7 +874,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1020,7 +1020,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1156,7 +1156,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1290,7 +1290,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1474,7 +1474,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1656,7 +1656,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1822,7 +1822,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1979,7 +1979,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js index 03589e9500..cd8a387ae7 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -264,7 +264,7 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -595,7 +595,7 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,7 +829,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js index 65dbfa1607..afedf9ac14 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -180,7 +180,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -322,7 +322,7 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -947,7 +947,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1113,7 +1113,7 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1280,7 +1280,7 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1439,7 +1439,7 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1597,7 +1597,7 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js index 5ce17fe6e4..5d8cfafe9d 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js index bc908254e8..45aa917bf2 100644 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ b/lib/services/networkManagement2/lib/operations/inboundNatRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -263,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -540,7 +540,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -715,7 +715,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 8916b437d4..9f8207ca82 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -2508,8 +2508,6 @@ export interface 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. @@ -2537,8 +2535,6 @@ export interface 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. @@ -2751,8 +2747,6 @@ export interface 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. @@ -2780,8 +2774,6 @@ export interface 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. @@ -15711,7 +15703,8 @@ export interface 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. @@ -15722,7 +15715,7 @@ export interface 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. @@ -15737,6 +15730,27 @@ export interface 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 @@ -15751,7 +15765,8 @@ export interface NetworkWatchers { setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. @@ -15762,7 +15777,7 @@ export interface 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. @@ -15777,6 +15792,27 @@ export interface 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 @@ -15810,7 +15846,8 @@ export interface 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. @@ -15818,10 +15855,10 @@ export interface 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. * @@ -15837,7 +15874,8 @@ export interface NetworkWatchers { getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. @@ -15845,10 +15883,10 @@ export interface 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. * @@ -16716,7 +16754,8 @@ export interface 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. @@ -16727,7 +16766,7 @@ export interface 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. @@ -16742,6 +16781,27 @@ export interface 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 @@ -16756,7 +16816,8 @@ export interface NetworkWatchers { beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. @@ -16767,7 +16828,7 @@ export interface 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. @@ -16782,6 +16843,27 @@ export interface 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 @@ -16815,7 +16897,8 @@ export interface 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. @@ -16823,10 +16906,10 @@ export interface 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. * @@ -16842,7 +16925,8 @@ export interface NetworkWatchers { beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. @@ -16850,10 +16934,10 @@ export interface 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. * @@ -25764,11 +25848,13 @@ export interface 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. * @@ -25882,11 +25968,13 @@ export interface 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. * @@ -26885,208 +26973,6 @@ export interface VirtualNetworkGateways { 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. * @@ -27210,11 +27096,13 @@ export interface 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. * @@ -27328,11 +27216,13 @@ export interface 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. * @@ -28092,208 +27982,6 @@ export interface VirtualNetworkGateways { 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. * @@ -28467,11 +28155,13 @@ export interface 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. @@ -28659,11 +28349,13 @@ export interface 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. @@ -29351,11 +29043,13 @@ export interface 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. @@ -29543,11 +29237,13 @@ export interface 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. diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js index 7ff40ef853..c09b76d1bd 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js index b71f1418fa..6a925488cc 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js index ae60d4849a..e2fb9d424b 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js index cd605042fa..63604ebc3b 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js index 61a9053ab2..3d6b7f3605 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js index 5adef86148..7e2ce1ba0f 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancers.js @@ -115,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -610,7 +610,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -748,7 +748,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -929,7 +929,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1110,7 +1110,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js index f9b250d3f2..b6568c8dc0 100644 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js @@ -164,7 +164,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -460,7 +460,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -635,7 +635,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,7 +818,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -956,7 +956,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js index 1fdc6b0504..ea292f9aff 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -196,7 +196,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js index b24a894f20..9aa60a705e 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js index 5187331ae1..bb4c7eb860 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaces.js @@ -115,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -513,7 +513,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -647,7 +647,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1745,7 +1745,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1962,7 +1962,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2144,7 +2144,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2305,7 +2305,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2449,7 +2449,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js index cae736c890..1213666a37 100644 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js @@ -117,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -451,7 +451,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -585,7 +585,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -724,7 +724,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -876,7 +876,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1059,7 +1059,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index e97208f157..786d002072 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -61,7 +61,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -238,7 +238,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -449,7 +449,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -608,7 +608,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,7 +744,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -893,7 +893,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1480,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. @@ -1491,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. @@ -1506,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 @@ -1578,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. @@ -1586,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. * @@ -2013,7 +2036,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2171,7 +2194,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2362,7 +2385,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2545,7 +2568,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2734,7 +2757,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2917,7 +2940,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3060,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. @@ -3071,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. @@ -3086,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 @@ -3114,7 +3159,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3257,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. @@ -3265,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. * @@ -3298,7 +3344,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3518,7 +3564,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3721,7 +3767,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3913,7 +3959,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5315,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. @@ -5326,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. @@ -5341,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 @@ -5367,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. @@ -5378,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. @@ -5393,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 @@ -5441,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. @@ -5449,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. * @@ -5480,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. @@ -5488,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. * @@ -6617,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. @@ -6628,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. @@ -6643,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 @@ -6669,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. @@ -6680,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. @@ -6695,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 @@ -6743,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. @@ -6751,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. * @@ -6782,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. @@ -6790,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 63798f7219..71d9226d24 100644 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ b/lib/services/networkManagement2/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index 3a0f8d1b02..efc84e50b9 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -163,7 +163,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -523,7 +523,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -700,7 +700,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -865,7 +865,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -996,7 +996,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1130,7 +1130,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index 4c68681afe..92c4b9703e 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -115,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -485,7 +485,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -619,7 +619,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1244,7 +1244,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1433,7 +1433,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1615,7 +1615,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js index 7b86de829c..56dea1ce10 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ b/lib/services/networkManagement2/lib/operations/routeFilterRules.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -454,7 +454,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -598,7 +598,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -752,7 +752,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout { routeFilterRuleParameters = {}; } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -951,7 +951,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR { routeFilterRuleParameters = {}; } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js index 7cfe19234f..4ddefd9923 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ b/lib/services/networkManagement2/lib/operations/routeFilters.js @@ -116,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -447,7 +447,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -582,7 +582,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -857,7 +857,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1047,7 +1047,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js index 87a83020b2..2807fd7cd7 100644 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ b/lib/services/networkManagement2/lib/operations/routeTables.js @@ -115,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -444,7 +444,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -579,7 +579,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -713,7 +713,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -861,7 +861,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1042,7 +1042,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js index 0c305dfacb..022a822131 100644 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ b/lib/services/networkManagement2/lib/operations/routes.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,7 +371,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -515,7 +515,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -675,7 +675,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js index 618bd59702..1dabbcdccc 100644 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ b/lib/services/networkManagement2/lib/operations/securityRules.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -422,7 +422,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -567,7 +567,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index e8dbbc4c73..f4fa202864 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -119,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -425,7 +425,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -569,7 +569,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js index 4bcc7c29c5..3e4ab03e11 100644 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ b/lib/services/networkManagement2/lib/operations/usages.js @@ -47,7 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js index 571577bf39..bb6810bdbc 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,7 +304,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -686,7 +688,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,7 +831,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1071,11 +1073,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. @@ -1231,7 +1235,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1408,7 +1412,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1541,7 +1545,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1712,7 +1716,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1901,7 +1905,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2227,11 +2231,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. @@ -2431,11 +2437,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. @@ -3327,11 +3335,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. @@ -3531,11 +3541,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. diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index c70e53732a..06357bbcfb 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,7 +228,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -516,7 +518,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -657,7 +659,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1262,7 +1264,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1540,205 +1542,6 @@ function _getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer }); } - -/** - * 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. * @@ -1785,7 +1588,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1957,11 +1760,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. * @@ -2049,7 +1854,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2226,7 +2031,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2358,7 +2163,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2524,7 +2329,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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2694,7 +2499,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2881,7 +2686,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3049,7 +2854,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3204,7 +3009,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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3356,7 +3161,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3504,7 +3309,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3617,50 +3422,10 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, } /** - * 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' + * Gets all virtual network gateways by resource group. * - * @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. * @@ -3674,14 +3439,14 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, * {Error} 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 + * 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 _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3691,20 +3456,10 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3714,20 +3469,12 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate } // 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3745,28 +3492,14 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3801,7 +3534,7 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnClientIPsecParameters']().mapper(); + let resultMapper = new client.models['VirtualNetworkGatewayListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3817,13 +3550,10 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate } /** - * 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. + * Gets all the connections in a virtual network gateway. * - * @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. * @@ -3837,14 +3567,14 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate * {Error} 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. + * 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 _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, callback) { +function _listConnectionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3854,17 +3584,10 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!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 (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3874,20 +3597,12 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate } // 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3947,263 +3662,7 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate 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(); + let resultMapper = new client.models['VirtualNetworkGatewayListConnectionsResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -4240,8 +3699,6 @@ class VirtualNetworkGateways { this._supportedVpnDevices = _supportedVpnDevices; this._getLearnedRoutes = _getLearnedRoutes; this._getAdvertisedRoutes = _getAdvertisedRoutes; - this._setVpnclientIpsecParameters = _setVpnclientIpsecParameters; - this._getVpnclientIpsecParameters = _getVpnclientIpsecParameters; this._vpnDeviceConfigurationScript = _vpnDeviceConfigurationScript; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; @@ -4253,8 +3710,6 @@ class VirtualNetworkGateways { this._beginGetBgpPeerStatus = _beginGetBgpPeerStatus; this._beginGetLearnedRoutes = _beginGetLearnedRoutes; this._beginGetAdvertisedRoutes = _beginGetAdvertisedRoutes; - this._beginSetVpnclientIpsecParameters = _beginSetVpnclientIpsecParameters; - this._beginGetVpnclientIpsecParameters = _beginGetVpnclientIpsecParameters; this._listNext = _listNext; this._listConnectionsNext = _listConnectionsNext; } @@ -4300,11 +3755,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. * @@ -4430,11 +3887,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. * @@ -5800,273 +5259,17 @@ class VirtualNetworkGateways { } /** - * 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. + * Gets a xml format representation for vpn device configuration script. * * @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 {string} virtualNetworkGatewayConnectionName The name of the virtual + * network gateway connection for which the configuration script is generated. * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. + * @param {object} parameters Parameters supplied to the generate vpn device + * script operation. * - * @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.vendor] The vendor for the vpn device. * * @param {string} [parameters.deviceFamily] The device family for the vpn * device. @@ -6205,11 +5408,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. * @@ -6335,11 +5540,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. * @@ -7357,262 +6564,6 @@ class VirtualNetworkGateways { } } - /** - * 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. * diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js index aef2006b54..b508f6abd4 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -401,7 +401,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -546,7 +546,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -733,7 +733,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js index 8815559ff7..fa3c183838 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworks.js @@ -115,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -470,7 +470,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -604,7 +604,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -747,7 +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-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { @@ -897,7 +897,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1039,7 +1039,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1213,7 +1213,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1395,7 +1395,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01'; + let apiVersion = '2018-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/package.json b/lib/services/networkManagement2/package.json index ef60cb7ab2..8da21fccdf 100644 --- a/lib/services/networkManagement2/package.json +++ b/lib/services/networkManagement2/package.json @@ -4,10 +4,13 @@ "description": "NetworkManagementClient Library with typescript type definitions for node", "version": "5.2.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", From 20e0028ea6306ff94f28730acbaa13655019c217 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 29 May 2018 16:52:52 -0700 Subject: [PATCH 07/21] Generated from 5e5dc68d9c5c1e93dd3c453cc10c3f43d16730b0 (#2922) Merge branch 'master' into Network-fix-april # Conflicts: # specification/network/resource-manager/readme.md --- .../lib/networkManagementClient.js | 2 +- .../lib/operations/applicationGateways.js | 26 +++++++------- .../operations/applicationSecurityGroups.js | 10 +++--- .../operations/availableEndpointServices.js | 2 +- .../lib/operations/bgpServiceCommunities.js | 2 +- .../lib/operations/connectionMonitors.js | 14 ++++---- .../lib/operations/ddosProtectionPlans.js | 10 +++--- .../lib/operations/defaultSecurityRules.js | 4 +-- .../expressRouteCircuitAuthorizations.js | 8 ++--- .../expressRouteCircuitConnections.js | 6 ++-- .../operations/expressRouteCircuitPeerings.js | 8 ++--- .../lib/operations/expressRouteCircuits.js | 22 ++++++------ .../expressRouteCrossConnectionPeerings.js | 8 ++--- .../expressRouteCrossConnections.js | 16 ++++----- .../expressRouteServiceProviders.js | 2 +- .../lib/operations/inboundNatRules.js | 8 ++--- .../loadBalancerBackendAddressPools.js | 4 +-- .../loadBalancerFrontendIPConfigurations.js | 4 +-- .../loadBalancerLoadBalancingRules.js | 4 +-- .../loadBalancerNetworkInterfaces.js | 2 +- .../lib/operations/loadBalancerProbes.js | 4 +-- .../lib/operations/loadBalancers.js | 12 +++---- .../lib/operations/localNetworkGateways.js | 10 +++--- .../networkInterfaceIPConfigurations.js | 4 +-- .../networkInterfaceLoadBalancers.js | 2 +- .../lib/operations/networkInterfaces.js | 16 ++++----- .../lib/operations/networkSecurityGroups.js | 12 +++---- .../lib/operations/networkWatchers.js | 34 +++++++++---------- .../lib/operations/operations.js | 2 +- .../lib/operations/packetCaptures.js | 12 +++---- .../lib/operations/publicIPAddresses.js | 12 +++---- .../lib/operations/routeFilterRules.js | 10 +++--- .../lib/operations/routeFilters.js | 12 +++---- .../lib/operations/routeTables.js | 12 +++---- .../lib/operations/routes.js | 8 ++--- .../lib/operations/securityRules.js | 8 ++--- .../lib/operations/subnets.js | 8 ++--- .../lib/operations/usages.js | 2 +- .../virtualNetworkGatewayConnections.js | 16 ++++----- .../lib/operations/virtualNetworkGateways.js | 30 ++++++++-------- .../lib/operations/virtualNetworkPeerings.js | 8 ++--- .../lib/operations/virtualNetworks.js | 16 ++++----- 42 files changed, 206 insertions(+), 206 deletions(-) diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index cdb1b643dd..6fc0cef11a 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -61,7 +61,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js index 6502163d2c..50e8095f35 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -535,7 +535,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -671,7 +671,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1013,7 +1013,7 @@ function _listAvailableWafRuleSets(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1145,7 +1145,7 @@ function _listAvailableSslOptions(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1278,7 +1278,7 @@ function _listAvailableSslPredefinedPolicies(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1412,7 +1412,7 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1550,7 +1550,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1796,7 +1796,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1978,7 +1978,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2262,7 +2262,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2394,7 +2394,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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js index d2fb1e4dc9..74d9da00ca 100644 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js @@ -115,7 +115,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -344,7 +344,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -478,7 +478,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -617,7 +617,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -754,7 +754,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js index b3f2c79a58..30b788f769 100644 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js @@ -48,7 +48,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js index 4c81d1f28d..327e55e51e 100644 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js index e68f66d800..8b73ae907b 100644 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -167,7 +167,7 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -597,7 +597,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -776,7 +776,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -959,7 +959,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1091,7 +1091,7 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1223,7 +1223,7 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1358,7 +1358,7 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js index 03940c23c9..9240cf8d13 100644 --- a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js +++ b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -337,7 +337,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -471,7 +471,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -609,7 +609,7 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -742,7 +742,7 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js index 0821fead98..c01fcee530 100644 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js index 06f3815398..a0ab216328 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -367,7 +367,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -512,7 +512,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -665,7 +665,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js index 5f68ec4d4c..df47f5d1f9 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js @@ -125,7 +125,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -395,7 +395,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -565,7 +565,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 87ceb944c9..64f54dfd86 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js @@ -117,7 +117,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -620,7 +620,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -883,7 +883,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index ac5a1e53d1..cf441bebfb 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -728,7 +728,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -874,7 +874,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1020,7 +1020,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1156,7 +1156,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1290,7 +1290,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1474,7 +1474,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1656,7 +1656,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1822,7 +1822,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1979,7 +1979,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js index cd8a387ae7..ce0cca7eb5 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -264,7 +264,7 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -595,7 +595,7 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,7 +829,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js index afedf9ac14..de518e65a7 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -180,7 +180,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -322,7 +322,7 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -947,7 +947,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1113,7 +1113,7 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1280,7 +1280,7 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1439,7 +1439,7 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1597,7 +1597,7 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js index 5d8cfafe9d..b7c03e9544 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js index 45aa917bf2..9c477eb7f5 100644 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ b/lib/services/networkManagement2/lib/operations/inboundNatRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -263,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -540,7 +540,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -715,7 +715,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js index c09b76d1bd..726fbabf70 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js index 6a925488cc..2b796513de 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js index e2fb9d424b..78f71280ae 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js index 63604ebc3b..ba4d1a4a31 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js index 3d6b7f3605..001fde0a3d 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js index 7e2ce1ba0f..10a84cfc1e 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancers.js @@ -115,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -610,7 +610,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -748,7 +748,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -929,7 +929,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1110,7 +1110,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js index b6568c8dc0..e49de422c3 100644 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js @@ -164,7 +164,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -460,7 +460,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -635,7 +635,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,7 +818,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -956,7 +956,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js index ea292f9aff..827c62f06a 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -196,7 +196,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js index 9aa60a705e..7e97efb188 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js index bb4c7eb860..dc3ab2af2a 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaces.js @@ -115,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -513,7 +513,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -647,7 +647,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1745,7 +1745,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1962,7 +1962,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2144,7 +2144,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2305,7 +2305,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2449,7 +2449,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js index 1213666a37..3b6fe3fcf2 100644 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js @@ -117,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -451,7 +451,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -585,7 +585,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -724,7 +724,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -876,7 +876,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1059,7 +1059,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index 786d002072..21e34ddba2 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -61,7 +61,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -238,7 +238,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -449,7 +449,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -608,7 +608,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,7 +744,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -893,7 +893,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2036,7 +2036,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2194,7 +2194,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2385,7 +2385,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2568,7 +2568,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2757,7 +2757,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2940,7 +2940,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3159,7 +3159,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3344,7 +3344,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3564,7 +3564,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3767,7 +3767,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3959,7 +3959,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/operations.js b/lib/services/networkManagement2/lib/operations/operations.js index 71d9226d24..2d6438e17a 100644 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ b/lib/services/networkManagement2/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index efc84e50b9..bb8473afaf 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -163,7 +163,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -523,7 +523,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -700,7 +700,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -865,7 +865,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -996,7 +996,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1130,7 +1130,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index 92c4b9703e..a65cd73eee 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -115,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -485,7 +485,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -619,7 +619,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1244,7 +1244,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1433,7 +1433,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1615,7 +1615,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js index 56dea1ce10..60f8ee2472 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ b/lib/services/networkManagement2/lib/operations/routeFilterRules.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -454,7 +454,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -598,7 +598,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -752,7 +752,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout { routeFilterRuleParameters = {}; } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -951,7 +951,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR { routeFilterRuleParameters = {}; } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js index 4ddefd9923..fca76f9c45 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ b/lib/services/networkManagement2/lib/operations/routeFilters.js @@ -116,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -447,7 +447,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -582,7 +582,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -857,7 +857,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1047,7 +1047,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js index 2807fd7cd7..42f75b6be5 100644 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ b/lib/services/networkManagement2/lib/operations/routeTables.js @@ -115,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -444,7 +444,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -579,7 +579,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -713,7 +713,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -861,7 +861,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1042,7 +1042,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js index 022a822131..7b81ef051f 100644 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ b/lib/services/networkManagement2/lib/operations/routes.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,7 +371,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -515,7 +515,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -675,7 +675,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js index 1dabbcdccc..ad6147a832 100644 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ b/lib/services/networkManagement2/lib/operations/securityRules.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -422,7 +422,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -567,7 +567,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index f4fa202864..c0888989e5 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -119,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -425,7 +425,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -569,7 +569,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js index 3e4ab03e11..f3271bab85 100644 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ b/lib/services/networkManagement2/lib/operations/usages.js @@ -47,7 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js index bb6810bdbc..4cddf7e3ed 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js @@ -304,7 +304,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -688,7 +688,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -831,7 +831,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1235,7 +1235,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1412,7 +1412,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1545,7 +1545,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1716,7 +1716,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1905,7 +1905,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index 06357bbcfb..f7adc26f6e 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js @@ -228,7 +228,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -518,7 +518,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -659,7 +659,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1264,7 +1264,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1588,7 +1588,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1854,7 +1854,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2031,7 +2031,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2163,7 +2163,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2329,7 +2329,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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2499,7 +2499,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2686,7 +2686,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2854,7 +2854,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3009,7 +3009,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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3161,7 +3161,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3309,7 +3309,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js index b508f6abd4..4ddc9a81af 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -401,7 +401,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -546,7 +546,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -733,7 +733,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js index fa3c183838..0ce60b8f0b 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworks.js @@ -115,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -470,7 +470,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -604,7 +604,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -747,7 +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-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { @@ -897,7 +897,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1039,7 +1039,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1213,7 +1213,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1395,7 +1395,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-05-01'; + let apiVersion = '2018-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { From c24806b4c1bf275944430ea68bdc56b73dbb0ad1 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 30 May 2018 17:38:13 -0700 Subject: [PATCH 08/21] Generated from a5af2bc46e91b4b6f6aa25408c1814532fcfc041 (#2928) Reverted methods in vpn gateways. --- .../lib/operations/index.d.ts | 404 ++++++ .../lib/operations/virtualNetworkGateways.js | 1215 +++++++++++++++-- 2 files changed, 1542 insertions(+), 77 deletions(-) diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 9f8207ca82..ced731dfb1 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -26973,6 +26973,208 @@ export interface VirtualNetworkGateways { 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. * @@ -27982,6 +28184,208 @@ export interface VirtualNetworkGateways { 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. * diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index f7adc26f6e..33084465c0 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js @@ -1542,6 +1542,205 @@ function _getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer }); } + +/** + * 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. * @@ -3422,10 +3621,50 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, } /** - * Gets all virtual network gateways by resource group. + * 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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3439,14 +3678,14 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, * {Error} 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 + * 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 _listNext(nextPageLink, options, callback) { +function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3456,10 +3695,20 @@ function _listNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-04-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.'); @@ -3469,12 +3718,20 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3492,14 +3749,28 @@ function _listNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3534,7 +3805,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayListResult']().mapper(); + let resultMapper = new client.models['VpnClientIPsecParameters']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3550,10 +3821,13 @@ function _listNext(nextPageLink, options, callback) { } /** - * Gets all the connections in a virtual network gateway. + * 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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -3567,14 +3841,14 @@ function _listNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * for more information. + * 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 _listConnectionsNext(nextPageLink, options, callback) { +function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3584,10 +3858,17 @@ function _listConnectionsNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-04-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.'); @@ -3597,12 +3878,20 @@ function _listConnectionsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3662,7 +3951,7 @@ function _listConnectionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayListConnectionsResult']().mapper(); + let resultMapper = new client.models['VpnClientIPsecParameters']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3677,13 +3966,269 @@ function _listConnectionsNext(nextPageLink, options, callback) { }); } -/** Class representing a VirtualNetworkGateways. */ -class VirtualNetworkGateways { - /** - * Create a VirtualNetworkGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { +/** + * 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; @@ -3699,6 +4244,8 @@ class VirtualNetworkGateways { this._supportedVpnDevices = _supportedVpnDevices; this._getLearnedRoutes = _getLearnedRoutes; this._getAdvertisedRoutes = _getAdvertisedRoutes; + this._setVpnclientIpsecParameters = _setVpnclientIpsecParameters; + this._getVpnclientIpsecParameters = _getVpnclientIpsecParameters; this._vpnDeviceConfigurationScript = _vpnDeviceConfigurationScript; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; @@ -3710,6 +4257,8 @@ class VirtualNetworkGateways { this._beginGetBgpPeerStatus = _beginGetBgpPeerStatus; this._beginGetLearnedRoutes = _beginGetLearnedRoutes; this._beginGetAdvertisedRoutes = _beginGetAdvertisedRoutes; + this._beginSetVpnclientIpsecParameters = _beginSetVpnclientIpsecParameters; + this._beginGetVpnclientIpsecParameters = _beginGetVpnclientIpsecParameters; this._listNext = _listNext; this._listConnectionsNext = _listConnectionsNext; } @@ -4965,7 +5514,185 @@ class VirtualNetworkGateways { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { + 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') { @@ -4974,25 +5701,28 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); } } /** - * Gets a xml format representation for supported vpn devices. + * 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 @@ -5000,15 +5730,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - supportedVpnDevicesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5019,13 +5749,16 @@ class VirtualNetworkGateways { } /** - * Gets a xml format representation for supported vpn devices. + * 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 @@ -5038,7 +5771,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {GatewayRouteListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5046,13 +5779,15 @@ class VirtualNetworkGateways { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link 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. */ - supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { + getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5061,26 +5796,63 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); } } /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * 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 @@ -5088,15 +5860,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { + setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5107,14 +5879,51 @@ class VirtualNetworkGateways { } /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. + * 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 @@ -5127,7 +5936,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VpnClientIPsecParameters} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5136,14 +5945,14 @@ class VirtualNetworkGateways { * {Error} 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 + * 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. */ - getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { + setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5152,27 +5961,25 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { + self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); + return self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); } } /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * 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 name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -5181,15 +5988,15 @@ class VirtualNetworkGateways { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { + getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5200,15 +6007,13 @@ class VirtualNetworkGateways { } /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. + * 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 name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer + * @param {string} virtualNetworkGatewayName The virtual network gateway name. * * @param {object} [options] Optional Parameters. * @@ -5222,7 +6027,7 @@ class VirtualNetworkGateways { * * {Promise} A promise is returned * - * @resolve {GatewayRouteListResult} - The deserialized result object. + * @resolve {VpnClientIPsecParameters} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5231,14 +6036,14 @@ class VirtualNetworkGateways { * {Error} 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 + * 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. */ - getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback) { + getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5247,14 +6052,14 @@ class VirtualNetworkGateways { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { + self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); + return self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); } } @@ -6564,6 +7369,262 @@ class VirtualNetworkGateways { } } + /** + * 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. * From e9315a6b790cf64ea9fd75994327a3ef83e18cab Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Jun 2018 14:51:40 -0700 Subject: [PATCH 09/21] Generated from c129d5d0236058b60b71ac6eb485a85c93a41c66 (#2991) network: add https probe --- lib/services/networkManagement2/lib/models/index.d.ts | 8 ++++---- lib/services/networkManagement2/lib/models/probe.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index 7ac2dcc14a..ee5611f4a9 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -3515,10 +3515,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 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 From 3e1a02f08c8666ef91ff879be96a3e9742ae6847 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 21 Jun 2018 16:04:18 -0700 Subject: [PATCH 10/21] [AutoPR network/resource-manager] Release of Azure Networking Network-2018-06-01 (api-version 2018-04-01) (#3028) * Generated from e15c8600ed6dbd8440f2471838554034175c4c07 Integrated recent changes into 2018-04-01 * Generated from ca313b2e8484a0dca375caa8d71a581f6a0e4353 moved fixes in Vnet gateway to april branch * Generated from 05c228ff1cea5f29c0748791f907a63d3a347b4e reverted nic vm as readonly * Generated from f3195c8e637274e6bc1ffe14dc891c101c923c7f Adding VirtualWan Swagger (#3204) * Adding VirtualWan Swagger * Adding the CRUD Apis for VpnConnections * Updating VpnGateway examples * Fixing build errors * Addressing comments * Addressing comments and editing VpnConnection definition and corresponding examples * Addressing comments * Removing enableRateLimiting property * Addressing comments * Changing the version to 2018-04-01 version --- .../lib/models/applicationGateway.js | 43 +- .../applicationGatewayAutoscaleBounds.js | 63 + ...pplicationGatewayAutoscaleConfiguration.js | 59 + .../lib/models/applicationGatewaySku.js | 4 +- .../lib/models/connectionSharedKey.js | 13 +- .../lib/models/deviceProperties.js | 68 + .../models/getVpnSitesConfigurationRequest.js | 72 + .../lib/models/hubVirtualNetworkConnection.js | 141 + .../networkManagement2/lib/models/index.d.ts | 385 +- .../networkManagement2/lib/models/index.js | 18 + .../listHubVirtualNetworkConnectionsResult.js | 69 + .../lib/models/listVirtualHubsResult.js | 69 + .../lib/models/listVirtualWANsResult.js | 69 + .../lib/models/listVpnConnectionsResult.js | 70 + .../lib/models/listVpnGatewaysResult.js | 69 + .../lib/models/listVpnSitesResult.js | 69 + .../networkManagement2/lib/models/policies.js | 62 + .../lib/models/virtualHub.js | 148 + .../lib/models/virtualWAN.js | 155 + .../lib/models/vpnConnection.js | 199 + .../lib/models/vpnGateway.js | 166 + .../networkManagement2/lib/models/vpnSite.js | 178 + .../lib/models/vpnSiteId.js | 54 + .../lib/networkManagementClient.d.ts | 7 + .../lib/networkManagementClient.js | 7 + .../lib/operations/applicationGateways.js | 120 +- .../operations/expressRouteCircuitPeerings.js | 6 +- .../hubVirtualNetworkConnections.js | 720 +++ .../lib/operations/index.d.ts | 4252 ++++++++++++++++- .../lib/operations/index.js | 7 + .../lib/operations/virtualHubs.js | 2519 ++++++++++ .../virtualNetworkGatewayConnections.js | 40 +- .../lib/operations/virtualWANs.js | 2471 ++++++++++ .../lib/operations/vpnConnections.js | 1735 +++++++ .../lib/operations/vpnGateways.js | 2627 ++++++++++ .../lib/operations/vpnSites.js | 2687 +++++++++++ .../lib/operations/vpnSitesConfiguration.js | 473 ++ 37 files changed, 19847 insertions(+), 67 deletions(-) create mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleBounds.js create mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js create mode 100644 lib/services/networkManagement2/lib/models/deviceProperties.js create mode 100644 lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js create mode 100644 lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js create mode 100644 lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js create mode 100644 lib/services/networkManagement2/lib/models/listVirtualHubsResult.js create mode 100644 lib/services/networkManagement2/lib/models/listVirtualWANsResult.js create mode 100644 lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js create mode 100644 lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js create mode 100644 lib/services/networkManagement2/lib/models/listVpnSitesResult.js create mode 100644 lib/services/networkManagement2/lib/models/policies.js create mode 100644 lib/services/networkManagement2/lib/models/virtualHub.js create mode 100644 lib/services/networkManagement2/lib/models/virtualWAN.js create mode 100644 lib/services/networkManagement2/lib/models/vpnConnection.js create mode 100644 lib/services/networkManagement2/lib/models/vpnGateway.js create mode 100644 lib/services/networkManagement2/lib/models/vpnSite.js create mode 100644 lib/services/networkManagement2/lib/models/vpnSiteId.js create mode 100644 lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js create mode 100644 lib/services/networkManagement2/lib/operations/virtualHubs.js create mode 100644 lib/services/networkManagement2/lib/operations/virtualWANs.js create mode 100644 lib/services/networkManagement2/lib/operations/vpnConnections.js create mode 100644 lib/services/networkManagement2/lib/operations/vpnGateways.js create mode 100644 lib/services/networkManagement2/lib/operations/vpnSites.js create mode 100644 lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js 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/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/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/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/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/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/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 ee5611f4a9..219786f736 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -1703,9 +1703,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. */ @@ -2194,6 +2194,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. @@ -2203,9 +2234,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. @@ -2266,12 +2297,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; @@ -2291,9 +2332,12 @@ export interface ApplicationGateway extends Resource { redirectConfigurations?: ApplicationGatewayRedirectConfiguration[]; webApplicationFirewallConfiguration?: ApplicationGatewayWebApplicationFirewallConfiguration; enableHttp2?: boolean; + enableFips?: boolean; + autoscaleConfiguration?: ApplicationGatewayAutoscaleConfiguration; resourceGuid?: string; provisioningState?: string; etag?: string; + zones?: string[]; } /** @@ -6289,7 +6333,7 @@ export interface ConnectionResetSharedKey { * * @member {string} value The virtual network connection shared key value. */ -export interface ConnectionSharedKey { +export interface ConnectionSharedKey extends SubResource { value: string; } @@ -6432,6 +6476,252 @@ 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 @@ -6926,3 +7216,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 38bb14561f..a4f8ac0372 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -62,6 +62,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'); @@ -212,6 +214,16 @@ 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.ApplicationGatewayListResult = require('./applicationGatewayListResult'); exports.ApplicationGatewayAvailableSslPredefinedPolicies = require('./applicationGatewayAvailableSslPredefinedPolicies'); exports.ApplicationSecurityGroupListResult = require('./applicationSecurityGroupListResult'); @@ -253,3 +265,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/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/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/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/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 259f40a1a6..a1a1583de3 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -95,6 +95,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 6fc0cef11a..52ca27a6c6 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -259,6 +259,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 50e8095f35..fd8bece444 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -235,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. @@ -332,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. * @@ -342,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. @@ -1655,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. @@ -1752,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. * @@ -1762,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. @@ -3110,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. @@ -3207,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. * @@ -3217,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. @@ -3262,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. @@ -3359,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. * @@ -3369,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. @@ -4366,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. @@ -4463,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. * @@ -4473,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. @@ -4518,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. @@ -4615,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. * @@ -4625,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/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 64f54dfd86..4adf907ca0 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. * @@ -1264,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. * @@ -1298,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/hubVirtualNetworkConnections.js b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js new file mode 100644 index 0000000000..43c41ec915 --- /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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index ced731dfb1..8a666d33a0 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -152,10 +152,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. @@ -249,6 +249,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. * @@ -259,6 +272,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. @@ -292,10 +308,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. @@ -389,6 +405,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. * @@ -399,6 +428,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. @@ -1084,10 +1116,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 +1213,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 +1236,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. @@ -1224,10 +1272,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. @@ -1321,6 +1369,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. * @@ -1331,6 +1392,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. @@ -3648,7 +3712,7 @@ export interface 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. * @@ -3670,7 +3734,7 @@ export interface ExpressRouteCircuitPeerings { getWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. * @@ -29061,11 +29125,11 @@ 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>; + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a virtual network gateway connection tags. @@ -29092,7 +29156,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29100,17 +29164,17 @@ 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. + * {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. */ - 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; + 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; /** @@ -29131,6 +29195,8 @@ export interface 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 @@ -29162,6 +29228,8 @@ export interface 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 @@ -29887,11 +29955,11 @@ 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>; + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a virtual network gateway connection tags. @@ -29918,7 +29986,7 @@ export interface VirtualNetworkGatewayConnections { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkGatewayConnectionListEntity} - The deserialized result object. + * @resolve {VirtualNetworkGatewayConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29926,17 +29994,17 @@ 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. + * {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. */ - 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; + 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; /** @@ -29957,6 +30025,8 @@ export interface 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 @@ -29988,6 +30058,8 @@ export interface 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 @@ -30869,3 +30941,4127 @@ export interface LocalNetworkGateways { 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 { + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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} 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 {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|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. + * + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(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. + * + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + downloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDownloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + 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 + * VirtualHubs + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface VirtualHubs { + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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} 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|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} 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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} 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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 {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|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(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} 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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} nextPageLink The NextLink from 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 {ListVirtualHubsResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 {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|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} 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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} 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|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 {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|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} 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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} 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|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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|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. + * + * @param {object} [options.customHeaders] Headers that 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 the VpnGateways 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 {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. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(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} 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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. + */ + listByVpnGatewayWithHttpOperationResponse(gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + listByVpnGateway(gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByVpnGateway(gatewayName: string, callback: ServiceCallback): void; + listByVpnGateway(gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByVpnGatewayNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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..0cfcd760de 100644 --- a/lib/services/networkManagement2/lib/operations/index.js +++ b/lib/services/networkManagement2/lib/operations/index.js @@ -55,3 +55,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/virtualHubs.js b/lib/services/networkManagement2/lib/operations/virtualHubs.js new file mode 100644 index 0000000000..53ac965b0b --- /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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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 4cddf7e3ed..bc21a7e86f 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js @@ -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 @@ -1528,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. * @@ -1655,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) { @@ -1688,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 @@ -2814,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. */ @@ -2857,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. * @@ -2866,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. * @@ -2911,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 @@ -2954,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 @@ -3829,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. */ @@ -3872,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. * @@ -3881,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. * @@ -3926,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 @@ -3969,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/virtualWANs.js b/lib/services/networkManagement2/lib/operations/virtualWANs.js new file mode 100644 index 0000000000..20e55641f2 --- /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-04-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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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..4f414488b9 --- /dev/null +++ b/lib/services/networkManagement2/lib/operations/vpnConnections.js @@ -0,0 +1,1735 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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} 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(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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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} 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(gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByVpnGateway(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} 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(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(gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByVpnGateway(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..b0960ac27f --- /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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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..6de36ae479 --- /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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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..0569c61558 --- /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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === 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; From 7625def10a16afd7db95a3593a8ec6c917345f49 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 29 Jun 2018 16:09:47 -0700 Subject: [PATCH 11/21] Generated from fa0b9da8035f39eca2fbe30e244e090e2ade0de1 (#3095) Adding java tag for 2018-04 network --- .../lib/models/azureFirewall.js | 163 ++ .../models/azureFirewallApplicationRule.js | 109 + .../azureFirewallApplicationRuleCollection.js | 125 + .../azureFirewallApplicationRuleProtocol.js | 66 + .../models/azureFirewallIPConfiguration.js | 125 + .../lib/models/azureFirewallListResult.js | 67 + .../lib/models/azureFirewallNetworkRule.js | 121 + .../azureFirewallNetworkRuleCollection.js | 125 + .../lib/models/azureFirewallRCAction.js | 53 + .../networkManagement2/lib/models/index.d.ts | 240 +- .../networkManagement2/lib/models/index.js | 11 +- .../lib/networkManagementClient.d.ts | 1 + .../lib/networkManagementClient.js | 1 + .../lib/operations/azureFirewalls.js | 2042 +++++++++++++++++ .../lib/operations/index.d.ts | 614 +++++ .../lib/operations/index.js | 1 + 16 files changed, 3843 insertions(+), 21 deletions(-) create mode 100644 lib/services/networkManagement2/lib/models/azureFirewall.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallListResult.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js create mode 100644 lib/services/networkManagement2/lib/models/azureFirewallRCAction.js create mode 100644 lib/services/networkManagement2/lib/operations/azureFirewalls.js 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..0608539f82 --- /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: 'StringElementType', + 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/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index 219786f736..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. @@ -6723,6 +6911,18 @@ export interface VpnSiteId { } +/** + * @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 * Initializes a new instance of the ApplicationGatewayListResult class. diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index a4f8ac0372..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'); @@ -224,6 +232,7 @@ 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'); diff --git a/lib/services/networkManagement2/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts index a1a1583de3..cf9957940c 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ b/lib/services/networkManagement2/lib/networkManagementClient.d.ts @@ -54,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; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index 52ca27a6c6..93a10d0614 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -218,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); diff --git a/lib/services/networkManagement2/lib/operations/azureFirewalls.js b/lib/services/networkManagement2/lib/operations/azureFirewalls.js new file mode 100644 index 0000000000..b23b6542f2 --- /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-04-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-04-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-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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-04-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-04-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/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 8a666d33a0..39055974c6 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -12,6 +12,620 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * AzureFirewalls + * __NOTE__: An instance of this class is automatically created for an + * instance of the NetworkManagementClient. + */ +export interface AzureFirewalls { + + + /** + * 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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, 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 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|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 {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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 {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 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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; + + + /** + * 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|ServiceError} - The error object. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js index 0cfcd760de..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'); From f5d70145a3fcfaf0c6250420a833caa4f880e76f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 29 Jun 2018 16:36:04 -0700 Subject: [PATCH 12/21] Generated from db39b1d06805bc2180548e2e6d0931b43024b133 (#3089) Removed May folder because this API version is not published From 9d2f0b9fd02f9c8c4e32513d675e624465b54b94 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 2 Jul 2018 07:45:15 -0700 Subject: [PATCH 13/21] Generated from 61a2ac0f81cf773464f8710a2f13c029d0e537e6 (#3085) Suppress RequiredPropertiesMissingInResourceModel for AzureFirewall swagger From eae70aa325a7c3eb57045b8cf6d83a8477e36bc5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 3 Jul 2018 13:15:24 -0700 Subject: [PATCH 14/21] Generated from 142f57f91e02d24015ddc0acb7a77a90633c9996 (#3107) Fixed typos. Fixes issue 1770 in SDK --- .../lib/operations/index.d.ts | 12 ++++++---- .../lib/operations/vpnConnections.js | 24 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 39055974c6..1b50dafa65 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -35376,6 +35376,8 @@ export interface VpnConnections { /** * 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. @@ -35389,11 +35391,13 @@ export interface VpnConnections { * * @reject {Error|ServiceError} - The error object. */ - listByVpnGatewayWithHttpOperationResponse(gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByVpnGatewayWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * 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. @@ -35424,9 +35428,9 @@ export interface VpnConnections { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByVpnGateway(gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVpnGateway(gatewayName: string, callback: ServiceCallback): void; - listByVpnGateway(gatewayName: 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; /** diff --git a/lib/services/networkManagement2/lib/operations/vpnConnections.js b/lib/services/networkManagement2/lib/operations/vpnConnections.js index 4f414488b9..b3cfaf832f 100644 --- a/lib/services/networkManagement2/lib/operations/vpnConnections.js +++ b/lib/services/networkManagement2/lib/operations/vpnConnections.js @@ -346,6 +346,8 @@ function _deleteMethod(resourceGroupName, gatewayName, connectionName, options, /** * 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. @@ -367,7 +369,7 @@ function _deleteMethod(resourceGroupName, gatewayName, connectionName, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByVpnGateway(gatewayName, options, callback) { +function _listByVpnGateway(resourceGroupName, gatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -383,6 +385,9 @@ function _listByVpnGateway(gatewayName, options, callback) { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName === 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.'); } @@ -395,8 +400,9 @@ function _listByVpnGateway(gatewayName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections'; + 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)); @@ -1318,6 +1324,8 @@ class VpnConnections { /** * 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. @@ -1331,11 +1339,11 @@ class VpnConnections { * * @reject {Error} - The error object. */ - listByVpnGatewayWithHttpOperationResponse(gatewayName, options) { + listByVpnGatewayWithHttpOperationResponse(resourceGroupName, gatewayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByVpnGateway(gatewayName, options, (err, result, request, response) => { + self._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1348,6 +1356,8 @@ class VpnConnections { /** * 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. @@ -1378,7 +1388,7 @@ class VpnConnections { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByVpnGateway(gatewayName, options, optionalCallback) { + listByVpnGateway(resourceGroupName, gatewayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1387,14 +1397,14 @@ class VpnConnections { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByVpnGateway(gatewayName, options, (err, result, request, response) => { + self._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByVpnGateway(gatewayName, options, optionalCallback); + return self._listByVpnGateway(resourceGroupName, gatewayName, options, optionalCallback); } } From cf4e5bc3aed362961ea9e37aec98601e7160bc42 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 12:29:38 -0700 Subject: [PATCH 15/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3135) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth --- lib/services/networkManagement2/lib/models/index.d.ts | 4 ++-- lib/services/networkManagement2/lib/models/vpnConnection.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index dc2fde51e5..bc6428ee72 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -6823,7 +6823,7 @@ export interface VirtualHub extends Resource { * 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 {number} [connectionBandwidth] 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 @@ -6839,7 +6839,7 @@ export interface VpnConnection extends Resource { connectionStatus?: string; readonly ingressBytesTransferred?: number; readonly egressBytesTransferred?: number; - readonly connectionBandwidthInMbps?: number; + readonly connectionBandwidth?: number; sharedKey?: string; enableBgp?: boolean; ipsecPolicies?: IpsecPolicy[]; diff --git a/lib/services/networkManagement2/lib/models/vpnConnection.js b/lib/services/networkManagement2/lib/models/vpnConnection.js index 7b6eac00b2..95f9c48b6b 100644 --- a/lib/services/networkManagement2/lib/models/vpnConnection.js +++ b/lib/services/networkManagement2/lib/models/vpnConnection.js @@ -27,7 +27,7 @@ class VpnConnection extends models['Resource'] { * 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 {number} [connectionBandwidth] 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 @@ -138,10 +138,10 @@ class VpnConnection extends models['Resource'] { name: 'Number' } }, - connectionBandwidthInMbps: { + connectionBandwidth: { required: false, readOnly: true, - serializedName: 'properties.connectionBandwidthInMbps', + serializedName: 'properties.connectionBandwidth', type: { name: 'Number' } From 6a6d1da886fb867005c678b2ac63743961ef2bd4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 12:46:34 -0700 Subject: [PATCH 16/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3136) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth From f817f3313d9020055f959dec919d663f5f60260f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 13:03:08 -0700 Subject: [PATCH 17/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3137) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth From 50a5e87c78d21c862b4a2d4f18841a666e72f2c8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 13:19:50 -0700 Subject: [PATCH 18/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3140) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth From 2691f6b805f61789cabe55e5fec0a54fabbc642a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 13:36:13 -0700 Subject: [PATCH 19/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3141) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth From 667977bc8f416f7cfc3ce9af7ee7568cd8f6cc18 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 9 Jul 2018 13:54:42 -0700 Subject: [PATCH 20/21] Generated from 985356566cca2619f49ab0da4eb68c7a124d369f (#3142) Renaming ConnectionBandwidthInMbps to ConnectionBandwidth From 2ded98e8679e4ce73fcb5a9fd25aeef0d5de98d8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 25 Jul 2018 14:27:09 -0700 Subject: [PATCH 21/21] Generated from e7c9ce59ad6bc3b329f556526dc64547dfc34ede (#3236) Merge branch 'master' into az-Network-July-Release # Conflicts: # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/applicationGateway.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/applicationSecurityGroup.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/checkDnsAvailability.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/ddosProtectionPlan.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/endpointService.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayAvailableSslOptionsGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayAvailableWafRuleSetsGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayBackendHealthGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayStart.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayStop.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationGatewayUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationSecurityGroupCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationSecurityGroupDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationSecurityGroupGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationSecurityGroupList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ApplicationSecurityGroupListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/CheckDnsNameAvailability.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DdosProtectionPlanCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DdosProtectionPlanDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DdosProtectionPlanGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DdosProtectionPlanList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DdosProtectionPlanListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DefaultSecurityRuleGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/DefaultSecurityRuleList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/EndpointServicesList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCircuitConnectionCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCircuitConnectionDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCircuitConnectionGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCircuitUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionBgpPeeringCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionBgpPeeringDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionBgpPeeringGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionBgpPeeringList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionListByResourceGroup.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionUpdate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionsArpTable.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionsRouteTable.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ExpressRouteCrossConnectionsRouteTableSummary.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/InboundNatRuleCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/InboundNatRuleDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/InboundNatRuleGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/InboundNatRuleList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerBackendAddressPoolGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerBackendAddressPoolList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerCreateStandardSku.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerCreateWithInboundNatPool.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerCreateWithZones.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerFrontendIPConfigurationGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerFrontendIPConfigurationList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerLoadBalancingRuleGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerLoadBalancingRuleList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerNetworkInterfaceListSimple.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerNetworkInterfaceListVmss.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerProbeGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerProbeList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LoadBalancerUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LocalNetworkGatewayCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LocalNetworkGatewayDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LocalNetworkGatewayGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LocalNetworkGatewayList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/LocalNetworkGatewayUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceEffectiveNSGList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceEffectiveRouteTableList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceIPConfigurationGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceIPConfigurationList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceLoadBalancerList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkInterfaceUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupCreateWithRule.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupRuleCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupRuleDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupRuleGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupRuleList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkSecurityGroupUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherAvailableProvidersListGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherAzureReachabilityReportGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorQuery.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorStart.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectionMonitorStop.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherConnectivityCheck.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherFlowLogConfigure.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherFlowLogStatusQuery.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherIpFlowVerify.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherNextHopGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCaptureCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCaptureDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCaptureGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCaptureQueryStatus.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCaptureStop.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherPacketCapturesList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherSecurityGroupViewGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherTopologyGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherTroubleshootGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherTroubleshootResultQuery.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/NetworkWatcherUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/OperationList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressCreateCustomizedValues.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressCreateDefaults.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressCreateDns.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/PublicIpAddressUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterListByResourceGroup.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterRuleCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterRuleDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterRuleGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterRuleListByRouteFilter.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterRuleUpdate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteFilterUpdate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableCreateWithRoute.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableRouteCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableRouteDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableRouteGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableRouteList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/RouteTableUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/ServiceCommunityList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/SubnetCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/SubnetCreateServiceEndpoint.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/SubnetDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/SubnetGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/SubnetList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/UsageList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkCheckIPAddressAvailability.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkCreateServiceEndpoints.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkCreateSubnet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionGetSharedKey.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionResetSharedKey.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionSetSharedKey.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayConnectionsList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGenerateVpnClientPackage.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGenerateVpnProfile.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGetAdvertisedRoutes.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGetBGPPeerStatus.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayLearnedRoutes.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayReset.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewaySupportedVpnDevice.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayUpdate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewayVpnDeviceConfigurationScript.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGatewaysListConnections.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkListUsage.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkPeeringCreate.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkPeeringDelete.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkPeeringGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkPeeringList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VirtualNetworkUpdateTags.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssNetworkInterfaceGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssNetworkInterfaceIpConfigGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssNetworkInterfaceIpConfigList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssNetworkInterfaceList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssPublicIpGet.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssPublicIpListAll.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssVmNetworkInterfaceList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/examples/VmssVmPublicIpList.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/expressRouteCircuit.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/expressRouteCrossConnection.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/loadBalancer.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/network.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/networkInterface.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/networkSecurityGroup.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/networkWatcher.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/operation.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/publicIpAddress.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/routeFilter.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/routeTable.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/serviceCommunity.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/usage.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/virtualNetwork.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/virtualNetworkGateway.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/vmssNetworkInterface.json # specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/vmssPublicIpAddress.json # specification/network/resource-manager/readme.md --- .../networkManagement2/lib/models/index.d.ts | 4 +-- .../lib/models/vpnConnection.js | 6 ++-- .../lib/networkManagementClient.js | 2 +- .../lib/operations/applicationGateways.js | 26 +++++++------- .../operations/applicationSecurityGroups.js | 10 +++--- .../operations/availableEndpointServices.js | 2 +- .../lib/operations/azureFirewalls.js | 10 +++--- .../lib/operations/bgpServiceCommunities.js | 2 +- .../lib/operations/connectionMonitors.js | 14 ++++---- .../lib/operations/ddosProtectionPlans.js | 10 +++--- .../lib/operations/defaultSecurityRules.js | 4 +-- .../expressRouteCircuitAuthorizations.js | 8 ++--- .../expressRouteCircuitConnections.js | 6 ++-- .../operations/expressRouteCircuitPeerings.js | 8 ++--- .../lib/operations/expressRouteCircuits.js | 22 ++++++------ .../expressRouteCrossConnectionPeerings.js | 8 ++--- .../expressRouteCrossConnections.js | 16 ++++----- .../expressRouteServiceProviders.js | 2 +- .../hubVirtualNetworkConnections.js | 4 +-- .../lib/operations/inboundNatRules.js | 8 ++--- .../loadBalancerBackendAddressPools.js | 4 +-- .../loadBalancerFrontendIPConfigurations.js | 4 +-- .../loadBalancerLoadBalancingRules.js | 4 +-- .../loadBalancerNetworkInterfaces.js | 2 +- .../lib/operations/loadBalancerProbes.js | 4 +-- .../lib/operations/loadBalancers.js | 12 +++---- .../lib/operations/localNetworkGateways.js | 10 +++--- .../networkInterfaceIPConfigurations.js | 4 +-- .../networkInterfaceLoadBalancers.js | 2 +- .../lib/operations/networkInterfaces.js | 16 ++++----- .../lib/operations/networkSecurityGroups.js | 12 +++---- .../lib/operations/networkWatchers.js | 34 +++++++++---------- .../lib/operations/operations.js | 2 +- .../lib/operations/packetCaptures.js | 12 +++---- .../lib/operations/publicIPAddresses.js | 12 +++---- .../lib/operations/routeFilterRules.js | 10 +++--- .../lib/operations/routeFilters.js | 12 +++---- .../lib/operations/routeTables.js | 12 +++---- .../lib/operations/routes.js | 8 ++--- .../lib/operations/securityRules.js | 8 ++--- .../lib/operations/subnets.js | 8 ++--- .../lib/operations/usages.js | 2 +- .../lib/operations/virtualHubs.js | 12 +++---- .../virtualNetworkGatewayConnections.js | 16 ++++----- .../lib/operations/virtualNetworkGateways.js | 34 +++++++++---------- .../lib/operations/virtualNetworkPeerings.js | 8 ++--- .../lib/operations/virtualNetworks.js | 16 ++++----- .../lib/operations/virtualWANs.js | 12 +++---- .../lib/operations/vpnConnections.js | 8 ++--- .../lib/operations/vpnGateways.js | 12 +++---- .../lib/operations/vpnSites.js | 12 +++---- .../lib/operations/vpnSitesConfiguration.js | 2 +- 52 files changed, 249 insertions(+), 249 deletions(-) diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index bc6428ee72..dc2fde51e5 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -6823,7 +6823,7 @@ export interface VirtualHub extends Resource { * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' * @member {number} [ingressBytesTransferred] Ingress bytes transferred. * @member {number} [egressBytesTransferred] Egress bytes transferred. - * @member {number} [connectionBandwidth] Expected bandwidth in MBPS. + * @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 @@ -6839,7 +6839,7 @@ export interface VpnConnection extends Resource { connectionStatus?: string; readonly ingressBytesTransferred?: number; readonly egressBytesTransferred?: number; - readonly connectionBandwidth?: number; + readonly connectionBandwidthInMbps?: number; sharedKey?: string; enableBgp?: boolean; ipsecPolicies?: IpsecPolicy[]; diff --git a/lib/services/networkManagement2/lib/models/vpnConnection.js b/lib/services/networkManagement2/lib/models/vpnConnection.js index 95f9c48b6b..7b6eac00b2 100644 --- a/lib/services/networkManagement2/lib/models/vpnConnection.js +++ b/lib/services/networkManagement2/lib/models/vpnConnection.js @@ -27,7 +27,7 @@ class VpnConnection extends models['Resource'] { * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' * @member {number} [ingressBytesTransferred] Ingress bytes transferred. * @member {number} [egressBytesTransferred] Egress bytes transferred. - * @member {number} [connectionBandwidth] Expected bandwidth in MBPS. + * @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 @@ -138,10 +138,10 @@ class VpnConnection extends models['Resource'] { name: 'Number' } }, - connectionBandwidth: { + connectionBandwidthInMbps: { required: false, readOnly: true, - serializedName: 'properties.connectionBandwidth', + serializedName: 'properties.connectionBandwidthInMbps', type: { name: 'Number' } diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js index 93a10d0614..ca18387784 100644 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ b/lib/services/networkManagement2/lib/networkManagementClient.js @@ -61,7 +61,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js index fd8bece444..278254c9c6 100644 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ b/lib/services/networkManagement2/lib/operations/applicationGateways.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -551,7 +551,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -687,7 +687,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1029,7 +1029,7 @@ function _listAvailableWafRuleSets(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1161,7 +1161,7 @@ function _listAvailableSslOptions(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1294,7 +1294,7 @@ function _listAvailableSslPredefinedPolicies(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1428,7 +1428,7 @@ function _getSslPredefinedPolicy(predefinedPolicyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1566,7 +1566,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1828,7 +1828,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2010,7 +2010,7 @@ function _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2169,7 +2169,7 @@ function _beginStart(resourceGroupName, applicationGatewayName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2294,7 +2294,7 @@ function _beginStop(resourceGroupName, applicationGatewayName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2426,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js index 74d9da00ca..77b7f72550 100644 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js @@ -115,7 +115,7 @@ function _get(resourceGroupName, applicationSecurityGroupName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -344,7 +344,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -478,7 +478,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -617,7 +617,7 @@ function _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -754,7 +754,7 @@ function _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js index 30b788f769..5e0f85f9a8 100644 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js @@ -48,7 +48,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/azureFirewalls.js b/lib/services/networkManagement2/lib/operations/azureFirewalls.js index b23b6542f2..792f6a1462 100644 --- a/lib/services/networkManagement2/lib/operations/azureFirewalls.js +++ b/lib/services/networkManagement2/lib/operations/azureFirewalls.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, azureFirewallName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -354,7 +354,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -490,7 +490,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -624,7 +624,7 @@ function _beginDeleteMethod(resourceGroupName, azureFirewallName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -772,7 +772,7 @@ function _beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js index 327e55e51e..14fac9f202 100644 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js index 8b73ae907b..a8ea0a1960 100644 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -167,7 +167,7 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -597,7 +597,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -776,7 +776,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -959,7 +959,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1091,7 +1091,7 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1223,7 +1223,7 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1358,7 +1358,7 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js index 9240cf8d13..c8e8c1a02d 100644 --- a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js +++ b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, ddosProtectionPlanName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -337,7 +337,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -471,7 +471,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -609,7 +609,7 @@ function _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -742,7 +742,7 @@ function _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js index c01fcee530..76e555f2d8 100644 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js index a0ab216328..fa7d0adbad 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, circuitName, authorizationName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -367,7 +367,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -512,7 +512,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -665,7 +665,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js index df47f5d1f9..a4d083ae59 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js @@ -125,7 +125,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -395,7 +395,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -565,7 +565,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, conne if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js index 4adf907ca0..17e63f24c4 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js @@ -117,7 +117,7 @@ function _get(resourceGroupName, circuitName, peeringName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _list(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -620,7 +620,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -883,7 +883,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeri if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js index cf441bebfb..58ed25d34d 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js @@ -112,7 +112,7 @@ function _get(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -728,7 +728,7 @@ function _getStats(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -874,7 +874,7 @@ function _getPeeringStats(resourceGroupName, circuitName, peeringName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1020,7 +1020,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1156,7 +1156,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1290,7 +1290,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1474,7 +1474,7 @@ function _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1656,7 +1656,7 @@ function _beginUpdateTags(resourceGroupName, circuitName, parameters, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1822,7 +1822,7 @@ function _beginListArpTable(resourceGroupName, circuitName, peeringName, deviceP if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1979,7 +1979,7 @@ function _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2137,7 +2137,7 @@ function _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js index ce0cca7eb5..8dcd1902df 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -264,7 +264,7 @@ function _get(resourceGroupName, crossConnectionName, peeringName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -595,7 +595,7 @@ function _beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,7 +829,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js index de518e65a7..f979ebe167 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -180,7 +180,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -322,7 +322,7 @@ function _get(resourceGroupName, crossConnectionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -947,7 +947,7 @@ function _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1113,7 +1113,7 @@ function _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1280,7 +1280,7 @@ function _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1439,7 +1439,7 @@ function _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, pe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1597,7 +1597,7 @@ function _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js index b7c03e9544..77c53158cf 100644 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js index 43c41ec915..b5355410eb 100644 --- a/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js +++ b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js @@ -52,7 +52,7 @@ function _get(resourceGroupName, virtualHubName, connectionName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -201,7 +201,7 @@ function _list(resourceGroupName, virtualHubName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js index 9c477eb7f5..0c9bc6715e 100644 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ b/lib/services/networkManagement2/lib/operations/inboundNatRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -263,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -540,7 +540,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -715,7 +715,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRul if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js index 726fbabf70..119685121e 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, backendAddressPoolName, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js index 2b796513de..c514809cdc 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js @@ -51,7 +51,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -198,7 +198,7 @@ function _get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js index 78f71280ae..6610a194bd 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, loadBalancingRuleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js index ba4d1a4a31..75d413b24d 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js index 001fde0a3d..1791978c67 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, loadBalancerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -195,7 +195,7 @@ function _get(resourceGroupName, loadBalancerName, probeName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js index 10a84cfc1e..93a55f2af0 100644 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/loadBalancers.js @@ -115,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -476,7 +476,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -610,7 +610,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -748,7 +748,7 @@ function _beginDeleteMethod(resourceGroupName, loadBalancerName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -929,7 +929,7 @@ function _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1110,7 +1110,7 @@ function _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js index e49de422c3..f4d9a8536e 100644 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js @@ -164,7 +164,7 @@ function _get(resourceGroupName, localNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -460,7 +460,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -635,7 +635,7 @@ function _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parame if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,7 +818,7 @@ function _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -956,7 +956,7 @@ function _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js index 827c62f06a..1750d4d95c 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -196,7 +196,7 @@ function _get(resourceGroupName, networkInterfaceName, ipConfigurationName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js index 7e97efb188..040fabb791 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js @@ -50,7 +50,7 @@ function _list(resourceGroupName, networkInterfaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js index dc3ab2af2a..a298f16e6f 100644 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ b/lib/services/networkManagement2/lib/operations/networkInterfaces.js @@ -115,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -513,7 +513,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -647,7 +647,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1745,7 +1745,7 @@ function _beginDeleteMethod(resourceGroupName, networkInterfaceName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1962,7 +1962,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2144,7 +2144,7 @@ function _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2305,7 +2305,7 @@ function _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2449,7 +2449,7 @@ function _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInte if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js index 3b6fe3fcf2..c2bb3bf542 100644 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js @@ -117,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -451,7 +451,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -585,7 +585,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -724,7 +724,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -876,7 +876,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1059,7 +1059,7 @@ function _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index 21e34ddba2..c744d25aae 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -61,7 +61,7 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -238,7 +238,7 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -449,7 +449,7 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -608,7 +608,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,7 +744,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -893,7 +893,7 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2036,7 +2036,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2194,7 +2194,7 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2385,7 +2385,7 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2568,7 +2568,7 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2757,7 +2757,7 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2940,7 +2940,7 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3159,7 +3159,7 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3344,7 +3344,7 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3564,7 +3564,7 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3767,7 +3767,7 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3959,7 +3959,7 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/operations.js b/lib/services/networkManagement2/lib/operations/operations.js index 2d6438e17a..2cd6898159 100644 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ b/lib/services/networkManagement2/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index bb8473afaf..089c5b1985 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -163,7 +163,7 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -523,7 +523,7 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -700,7 +700,7 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -865,7 +865,7 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -996,7 +996,7 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1130,7 +1130,7 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js index a65cd73eee..22e4718f80 100644 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js @@ -115,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -485,7 +485,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -619,7 +619,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1244,7 +1244,7 @@ function _beginDeleteMethod(resourceGroupName, publicIpAddressName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1433,7 +1433,7 @@ function _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1615,7 +1615,7 @@ function _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js index 60f8ee2472..f3528b9f62 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ b/lib/services/networkManagement2/lib/operations/routeFilterRules.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeFilterName, ruleName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -454,7 +454,7 @@ function _listByRouteFilter(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -598,7 +598,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -752,7 +752,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, rout { routeFilterRuleParameters = {}; } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -951,7 +951,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterR { routeFilterRuleParameters = {}; } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js index fca76f9c45..504bcb10c1 100644 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ b/lib/services/networkManagement2/lib/operations/routeFilters.js @@ -116,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -447,7 +447,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -582,7 +582,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _beginDeleteMethod(resourceGroupName, routeFilterName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -857,7 +857,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterPar if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1047,7 +1047,7 @@ function _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js index 42f75b6be5..517f17c260 100644 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ b/lib/services/networkManagement2/lib/operations/routeTables.js @@ -115,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -444,7 +444,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -579,7 +579,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -713,7 +713,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -861,7 +861,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1042,7 +1042,7 @@ function _beginUpdateTags(resourceGroupName, routeTableName, parameters, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js index 7b81ef051f..4b6ef8a695 100644 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ b/lib/services/networkManagement2/lib/operations/routes.js @@ -116,7 +116,7 @@ function _get(resourceGroupName, routeTableName, routeName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,7 +371,7 @@ function _list(resourceGroupName, routeTableName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -515,7 +515,7 @@ function _beginDeleteMethod(resourceGroupName, routeTableName, routeName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -675,7 +675,7 @@ function _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, rout if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js index ad6147a832..7fd121a9bf 100644 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ b/lib/services/networkManagement2/lib/operations/securityRules.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, networkSecurityGroupName, securityRuleName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -422,7 +422,7 @@ function _list(resourceGroupName, networkSecurityGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -567,7 +567,7 @@ function _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securit if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, secur if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js index c0888989e5..624a0eeae2 100644 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ b/lib/services/networkManagement2/lib/operations/subnets.js @@ -119,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -425,7 +425,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -569,7 +569,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -774,7 +774,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js index f3271bab85..fddfb0b8e2 100644 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ b/lib/services/networkManagement2/lib/operations/usages.js @@ -47,7 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualHubs.js b/lib/services/networkManagement2/lib/operations/virtualHubs.js index 53ac965b0b..b4e5b81077 100644 --- a/lib/services/networkManagement2/lib/operations/virtualHubs.js +++ b/lib/services/networkManagement2/lib/operations/virtualHubs.js @@ -49,7 +49,7 @@ function _get(resourceGroupName, virtualHubName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -440,7 +440,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -576,7 +576,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -737,7 +737,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -920,7 +920,7 @@ function _beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameter if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1097,7 +1097,7 @@ function _beginDeleteMethod(resourceGroupName, virtualHubName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js index bc21a7e86f..44e00197cb 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js @@ -304,7 +304,7 @@ function _get(resourceGroupName, virtualNetworkGatewayConnectionName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -690,7 +690,7 @@ function _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -833,7 +833,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1237,7 +1237,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1414,7 +1414,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1547,7 +1547,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1720,7 +1720,7 @@ function _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1909,7 +1909,7 @@ function _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js index 33084465c0..f75d16fb1c 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js @@ -228,7 +228,7 @@ function _get(resourceGroupName, virtualNetworkGatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -518,7 +518,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -659,7 +659,7 @@ function _listConnections(resourceGroupName, virtualNetworkGatewayName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1264,7 +1264,7 @@ function _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1787,7 +1787,7 @@ function _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2053,7 +2053,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, para if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2230,7 +2230,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2362,7 +2362,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, paramete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2528,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2698,7 +2698,7 @@ function _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2885,7 +2885,7 @@ function _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3053,7 +3053,7 @@ function _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3208,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3360,7 +3360,7 @@ function _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3508,7 +3508,7 @@ function _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3695,7 +3695,7 @@ function _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3858,7 +3858,7 @@ function _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGate if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js index 4ddc9a81af..5e2bfeb81f 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js @@ -118,7 +118,7 @@ function _get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -401,7 +401,7 @@ function _list(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -546,7 +546,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetwor if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -733,7 +733,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetw if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js index 0ce60b8f0b..e2c13908cc 100644 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ b/lib/services/networkManagement2/lib/operations/virtualNetworks.js @@ -115,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -470,7 +470,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -604,7 +604,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -747,7 +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-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (ipAddress !== null && ipAddress !== undefined && typeof ipAddress.valueOf() !== 'string') { @@ -897,7 +897,7 @@ function _listUsage(resourceGroupName, virtualNetworkName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1039,7 +1039,7 @@ function _beginDeleteMethod(resourceGroupName, virtualNetworkName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1213,7 +1213,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1395,7 +1395,7 @@ function _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/virtualWANs.js b/lib/services/networkManagement2/lib/operations/virtualWANs.js index 20e55641f2..27a5a3b901 100644 --- a/lib/services/networkManagement2/lib/operations/virtualWANs.js +++ b/lib/services/networkManagement2/lib/operations/virtualWANs.js @@ -49,7 +49,7 @@ function _get(resourceGroupName, virtualWANName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -432,7 +432,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -568,7 +568,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -722,7 +722,7 @@ function _beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -904,7 +904,7 @@ function _beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1081,7 +1081,7 @@ function _beginDeleteMethod(resourceGroupName, virtualWANName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/vpnConnections.js b/lib/services/networkManagement2/lib/operations/vpnConnections.js index b3cfaf832f..a355bcbce9 100644 --- a/lib/services/networkManagement2/lib/operations/vpnConnections.js +++ b/lib/services/networkManagement2/lib/operations/vpnConnections.js @@ -51,7 +51,7 @@ function _get(resourceGroupName, gatewayName, connectionName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -379,7 +379,7 @@ function _listByVpnGateway(resourceGroupName, gatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -559,7 +559,7 @@ function _beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vp if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -742,7 +742,7 @@ function _beginDeleteMethod(resourceGroupName, gatewayName, connectionName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/vpnGateways.js b/lib/services/networkManagement2/lib/operations/vpnGateways.js index b0960ac27f..238e248b70 100644 --- a/lib/services/networkManagement2/lib/operations/vpnGateways.js +++ b/lib/services/networkManagement2/lib/operations/vpnGateways.js @@ -49,7 +49,7 @@ function _get(resourceGroupName, gatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -458,7 +458,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -594,7 +594,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -773,7 +773,7 @@ function _beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParamete if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -956,7 +956,7 @@ function _beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1133,7 +1133,7 @@ function _beginDeleteMethod(resourceGroupName, gatewayName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/vpnSites.js b/lib/services/networkManagement2/lib/operations/vpnSites.js index 6de36ae479..a9023614cd 100644 --- a/lib/services/networkManagement2/lib/operations/vpnSites.js +++ b/lib/services/networkManagement2/lib/operations/vpnSites.js @@ -49,7 +49,7 @@ function _get(resourceGroupName, vpnSiteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -468,7 +468,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -604,7 +604,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -793,7 +793,7 @@ function _beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -976,7 +976,7 @@ function _beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1153,7 +1153,7 @@ function _beginDeleteMethod(resourceGroupName, vpnSiteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js b/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js index 0569c61558..a008dbf71b 100644 --- a/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js +++ b/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js @@ -133,7 +133,7 @@ function _beginDownload(resourceGroupName, virtualWANName, request, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {