From 02f179e07fa35bffe6659d9afee6c94b3cc22922 Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Thu, 27 Oct 2016 10:41:14 -0700 Subject: [PATCH] Revert "Added new new param:TunnelConnectionStatus in output object:VirtualNetworkGatewayConnection and added new optional input param:gatewayVip in ResetGateway API." --- .../IVirtualNetworkGatewaysOperations.cs | 16 ++-- .../Models/TunnelConnectionHealth.cs | 73 ------------------- .../Models/VirtualNetworkGatewayConnection.cs | 9 +-- .../VirtualNetworkGatewaysOperations.cs | 34 +++++---- ...tualNetworkGatewaysOperationsExtensions.cs | 40 +++++----- .../Properties/AssemblyInfo.cs | 4 +- .../project.json | 2 +- .../Tests/GatewayOperationsTests.cs | 2 +- 8 files changed, 53 insertions(+), 127 deletions(-) delete mode 100644 src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index cfd7393676c4c..8fd727f065039 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -143,9 +143,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual - /// Network Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway + /// operation through Network resource provider. /// /// /// The headers that will be added to request. @@ -153,7 +153,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The Reset VirtualNetworkGateway operation resets the primary of /// the virtual network gateway in the specified resource group @@ -165,9 +165,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual - /// Network Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway + /// operation through Network resource provider. /// /// /// The headers that will be added to request. @@ -175,7 +175,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The Generatevpnclientpackage operation generates Vpn client /// package for P2S client of the virtual network gateway in the diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs deleted file mode 100644 index 5d6eedf00e900..0000000000000 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Network.Models -{ - using System; - using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; - - /// - /// VirtualNetworkGatewayConnection properties - /// - public partial class TunnelConnectionHealth - { - /// - /// Initializes a new instance of the TunnelConnectionHealth class. - /// - public TunnelConnectionHealth() { } - - /// - /// Initializes a new instance of the TunnelConnectionHealth class. - /// - public TunnelConnectionHealth(string tunnel = default(string), string connectionStatus = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), string lastConnectionEstablishedUtcTime = default(string)) - { - Tunnel = tunnel; - ConnectionStatus = connectionStatus; - IngressBytesTransferred = ingressBytesTransferred; - EgressBytesTransferred = egressBytesTransferred; - LastConnectionEstablishedUtcTime = lastConnectionEstablishedUtcTime; - } - - /// - /// Tunnel name. - /// - [JsonProperty(PropertyName = "tunnel")] - public string Tunnel { get; set; } - - /// - /// Virtual network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' - /// - [JsonProperty(PropertyName = "connectionStatus")] - public string ConnectionStatus { get; set; } - - /// - /// The Ingress Bytes Transferred in this connection - /// - [JsonProperty(PropertyName = "ingressBytesTransferred")] - public long? IngressBytesTransferred { get; set; } - - /// - /// The Egress Bytes Transferred in this connection - /// - [JsonProperty(PropertyName = "egressBytesTransferred")] - public long? EgressBytesTransferred { get; set; } - - /// - /// The time at which connection was established in Utc format. - /// - [JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] - public string LastConnectionEstablishedUtcTime { get; set; } - - } -} diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs index 6cf82e9cf118f..88ca08fc67549 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -32,7 +32,7 @@ public VirtualNetworkGatewayConnection() { } /// Initializes a new instance of the VirtualNetworkGatewayConnection /// class. /// - public VirtualNetworkGatewayConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway1 = default(VirtualNetworkGateway), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), string connectionType = default(string), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualNetworkGatewayConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway1 = default(VirtualNetworkGateway), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), string connectionType = default(string), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; @@ -43,7 +43,6 @@ public VirtualNetworkGatewayConnection() { } RoutingWeight = routingWeight; SharedKey = sharedKey; ConnectionStatus = connectionStatus; - TunnelConnectionStatus = tunnelConnectionStatus; EgressBytesTransferred = egressBytesTransferred; IngressBytesTransferred = ingressBytesTransferred; Peer = peer; @@ -101,12 +100,6 @@ public VirtualNetworkGatewayConnection() { } [JsonProperty(PropertyName = "properties.connectionStatus")] public string ConnectionStatus { get; set; } - /// - /// Collection of all tunnels' connection health status. - /// - [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public IList TunnelConnectionStatus { get; set; } - /// /// The Egress Bytes Transferred in this connection /// diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index 39ef436ac3523..7231cdda79870 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -839,9 +839,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// /// /// The headers that will be added to request. @@ -849,11 +849,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); + resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } @@ -868,9 +868,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// /// /// Headers that will be added to request. @@ -881,7 +881,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -891,6 +891,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (this.Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -908,7 +912,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("gatewayVip", gatewayVip); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } @@ -919,10 +923,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); List _queryParameters = new List(); - if (gatewayVip != null) - { - _queryParameters.Add(string.Format("gatewayVip={0}", Uri.EscapeDataString(gatewayVip))); - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); @@ -963,6 +963,12 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 78556d4e2c83a..c958d4c3dbeb7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -292,13 +292,13 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// - public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -315,16 +315,16 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// /// /// The cancellation token. /// - public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -344,13 +344,13 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// - public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -367,16 +367,16 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Vip parameter supplied to the Begin Active-Active Reset Virtual Network - /// Gateway operation through Network resource provider. + /// + /// Parameters supplied to the Begin Reset Virtual Network Gateway operation + /// through Network resource provider. /// /// /// The cancellation token. /// - public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs index 1aa9a2b17aa48..1aad776a5f255 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs @@ -19,8 +19,8 @@ [assembly: AssemblyTitle("Microsoft Azure Network Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure Network management functions for managing the Microsoft Azure Network service.")] -[assembly: AssemblyVersion("8.1.0.0")] -[assembly: AssemblyFileVersion("8.1.0.0")] +[assembly: AssemblyVersion("8.0.0.0")] +[assembly: AssemblyFileVersion("8.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json index bb4114624d1ce..c77a85acd69b7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json @@ -1,5 +1,5 @@ { - "version": "8.1.0-preview", + "version": "8.0.0-preview", "description": "Provides management capabilities for Network services.", "authors": [ "Microsoft" ], diff --git a/src/ResourceManagement/Network/Network.Tests/Tests/GatewayOperationsTests.cs b/src/ResourceManagement/Network/Network.Tests/Tests/GatewayOperationsTests.cs index 69351897ba8b6..b365f9711ec82 100644 --- a/src/ResourceManagement/Network/Network.Tests/Tests/GatewayOperationsTests.cs +++ b/src/ResourceManagement/Network/Network.Tests/Tests/GatewayOperationsTests.cs @@ -134,7 +134,7 @@ public void VirtualNetworkGatewayOperationsApisTest() Assert.Equal(VirtualNetworkGatewaySkuTier.Standard, getVirtualNetworkGatewayResponse.Sku.Tier); // 4A. ResetVirtualNetworkGateway API - var resetVirtualNetworkGatewayResponse = networkManagementClient.VirtualNetworkGateways.Reset(resourceGroupName, virtualNetworkGatewayName); + var resetVirtualNetworkGatewayResponse = networkManagementClient.VirtualNetworkGateways.Reset(resourceGroupName, virtualNetworkGatewayName, getVirtualNetworkGatewayResponse); //Assert.Equal("Succeeded", resetVirtualNetworkGatewayResponse.ProvisioningState); // 4B. GetVirtualNetworkgateway API after ResetVirtualNetworkGateway API was called