From 68d1283d3adf3ce47aac400ab06764e6fa85d717 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 May 2015 18:49:03 -0700 Subject: [PATCH 1/3] WORK:3387747 Added new Brooklyn Co-existance feature Powershell commandlets --- ...ands.ServiceManagement.Network.Test.csproj | 4 +- .../Commands.Network.Test/packages.config | 2 +- .../Commands.ServiceManagement.Network.csproj | 30 +- .../Gateway/GetAzureLocalNetworkGateway.cs | 44 +++ .../GetAzureVNetGatewayIPsecParameters.cs | 3 + .../Gateway/GetAzureVirtualNetworkGateway.cs | 44 +++ ...GetAzureVirtualNetworkGatewayConnection.cs | 53 +++ ...AzureVirtualNetworkGatewayDiagnosticsV2.cs | 38 ++ ...eVirtualNetworkGatewayIPsecParametersV2.cs | 47 +++ .../GetAzureVirtualNetworkGatewayKeyV2.cs | 46 +++ .../Model/GetLocalNetworkGatewayContext.cs | 31 ++ ...tVirtualNetworkGatewayConnectionContext.cs | 35 ++ .../Model/GetVirtualNetworkGatewayContext.cs | 52 +++ .../Model/LocalNetwrokGatewayContext.cs | 23 ++ .../Gateway/Model/ValidateGuid.cs | 38 ++ .../Gateway/NewAzureLocalNetworkGateway.cs | 38 ++ .../Gateway/NewAzureVirtualNetworkGateway.cs | 50 +++ ...NewAzureVirtualNetworkGatewayConnection.cs | 55 +++ .../Gateway/RemoveAzureLocalNetworkGateway.cs | 38 ++ .../RemoveAzureVirtualNetworkGateway.cs | 38 ++ ...oveAzureVirtualNetworkGatewayConnection.cs | 47 +++ .../ResetAzureVirtualNetworkGateway.cs | 37 ++ .../ResetAzureVirtualNetworkGatewayKeyV2.cs | 56 +++ .../ResizeAzureVirtualNetworkGateway.cs | 44 +++ ...eVirtualNetworkGatewayIPsecParametersV2.cs | 83 +++++ .../SetAzureVirtualNetworkGatewayKeyV2.cs | 54 +++ ...AzureVirtualNetworkGatewayDiagnosticsV2.cs | 46 +++ ...AzureVirtualNetworkGatewayDiagnosticsV2.cs | 34 ++ .../Gateway/UpdateAzureLocalNetworkGateway.cs | 45 +++ ...ateAzureVirtualNetworkGatewayConnection.cs | 62 ++++ .../Network/Commands.Network/NetworkClient.cs | 344 ++++++++++++++++++ .../Properties/Resources.Designer.cs | 13 +- .../Properties/Resources.resx | 3 + .../Network/Commands.Network/packages.config | 2 +- 34 files changed, 1572 insertions(+), 7 deletions(-) create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/Model/ValidateGuid.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureLocalNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs create mode 100644 src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs diff --git a/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj b/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj index 3c9c93090b67..ec327bdbbb21 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj +++ b/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj @@ -100,8 +100,8 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False diff --git a/src/ServiceManagement/Network/Commands.Network.Test/packages.config b/src/ServiceManagement/Network/Commands.Network.Test/packages.config index 67ee229ae0fa..fd55e6e6ab40 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/packages.config +++ b/src/ServiceManagement/Network/Commands.Network.Test/packages.config @@ -17,7 +17,7 @@ - + diff --git a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj index 91f6a0c0e737..13698be4ccc6 100644 --- a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj +++ b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj @@ -83,9 +83,9 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False @@ -147,6 +147,7 @@ + @@ -157,6 +158,13 @@ + + + + + + + @@ -168,6 +176,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs new file mode 100644 index 000000000000..b99930d01e7d --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs @@ -0,0 +1,44 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureLocalNetworkGateway"), OutputType(typeof(GetLocalNetworkGatewayContext))] + public class GetAzureLocalNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = false, HelpMessage = "Local network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + if (!string.IsNullOrEmpty(gatewayId)) + { + WriteObject(Client.GetLocalNetworkGateway(gatewayId)); + } + else + { + WriteObject(Client.ListLocalNetworkGateways()); + } + } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs index c54254a7138a..37a13390ad01 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs @@ -14,6 +14,7 @@ using System.Management.Automation; using Microsoft.WindowsAzure.Management.Network.Models; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { @@ -21,6 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway public class GetAzureVNetGatewayIPsecParameters : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")] + [ValidateGuid] [ValidateNotNullOrEmpty] public string VNetName { @@ -28,6 +30,7 @@ public string VNetName } [Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")] + [ValidateGuid] [ValidateNotNullOrEmpty] public string LocalNetworkSiteName { diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs new file mode 100644 index 000000000000..7b98c6882277 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs @@ -0,0 +1,44 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGateway"), OutputType(typeof(GetVirtualNetworkGatewayContext))] + public class GetAzureVirtualNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + if (!string.IsNullOrEmpty(gatewayId)) + { + WriteObject(Client.GetVirtualNetworkGateway(gatewayId)); + } + else + { + WriteObject(Client.ListVirtualNetworkGateways()); + } + } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs new file mode 100644 index 000000000000..31259605c4bf --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs @@ -0,0 +1,53 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(GetVirtualNetworkGatewayConnectionContext))] + public class GetAzureVirtualNetworkConnectionGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = false, HelpMessage = "Virtual network gateway Connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + if (!string.IsNullOrEmpty(gatewayId) && !string.IsNullOrEmpty(connectedentityId)) + { + WriteObject(Client.GetVirtualNetworkGatewayConnection(gatewayId, connectedentityId)); + } + else + { + WriteObject(Client.ListVirtualNetworkGatewayConnections()); + } + } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs new file mode 100644 index 000000000000..80ff5dec5973 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] + public class GetAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.GetDiagnosticsV2(gatewayId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs new file mode 100644 index 000000000000..444a40f4b2fe --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs @@ -0,0 +1,47 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.WindowsAzure.Management.Network.Models; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))] + public class GetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.GetIPsecParametersV2(gatewayId, connectedentityId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs new file mode 100644 index 000000000000..01b0b8cea302 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(SharedKeyContext))] + public class GetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.GetSharedKeyV2(gatewayId, connectedentityId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs new file mode 100644 index 000000000000..5a91e41d3166 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network +{ + using System; + using System.Collections.Generic; + using WindowsAzure.Commands.Utilities.Common; + + public class GetLocalNetworkGatewayContext : ManagementOperationContext + { + public string GatewayId { get; set; } + + public string GatewayName { get; set; } + + public string IpAddress { get; set; } + + public List AddressSpace { get; set; } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs new file mode 100644 index 000000000000..f68c8711db25 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs @@ -0,0 +1,35 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network +{ + using Microsoft.WindowsAzure.Management.Network.Models; + using System; + using WindowsAzure.Commands.Utilities.Common; + + public class GetVirtualNetworkGatewayConnectionContext : ManagementOperationContext + { + public string GatewayConnectionName { get; set; } + + public string VirtualNetworkGatewayId { get; set; } + + public string ConnectedEntityId { get; set; } + + public string GatewayConnectionType { get; set; } + + public int RoutingWeight { get; set; } + + public string SharedKey { get; set; } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs new file mode 100644 index 000000000000..3b03f647d9d0 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network +{ + using System; + using WindowsAzure.Commands.Utilities.Common; + + public class GetVirtualNetworkGatewayContext : ManagementOperationContext + { + public string GatewayId { get; set; } + + public string GatewayName { get; set; } + + public string LastEventData { get; set; } + + public string GatewayType { get; set; } + + public DateTime? LastEventTimeStamp { get; set; } + + public string LastEventMessage { get; set; } + + public int LastEventID { get; set; } + + public ProvisioningState State { get; set; } + + public string VIPAddress { get; set; } + + public string DefaultSite { get; set; } + + public string GatewaySKU { get; set; } + + public string Location { get; set; } + + public string VnetId { get; set; } + + public string SubnetId { get; set; } + + public string EnableBgp { get; set; } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs new file mode 100644 index 000000000000..ec333eb65d19 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs @@ -0,0 +1,23 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model +{ + using WindowsAzure.Commands.Utilities.Common; + + public class LocalNetwrokGatewayContext : ManagementOperationContext + { + public string LocalNetworkGatewayId { get; set; } + } +} \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/ValidateGuid.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/ValidateGuid.cs new file mode 100644 index 000000000000..785135c7de6e --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/ValidateGuid.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Properties; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model +{ + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public sealed class ValidateGuid : ValidateEnumeratedArgumentsAttribute + { + protected override void ValidateElement(object element) + { + string guid = (string)element; + + try + { + Guid validGuid = Guid.Parse(guid); + } + catch + { + throw new ArgumentException(String.Format(Resources.InvalidGuid, guid)); + } + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureLocalNetworkGateway.cs new file mode 100644 index 000000000000..bd4f3be6b7d8 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureLocalNetworkGateway.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.New, "AzureLocalNetworkGateway"), OutputType(typeof(LocalNetwrokGatewayContext))] + public class NewAzureLocalNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway name.")] + public string GatewayName { get; set; } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The Ip Address of local network gateway .")] + public string IpAddress { get; set; } + + [Parameter(Position = 2, Mandatory = true, HelpMessage = "The virtual network gateway AddressSpace.")] + public List AddressSpace { get; set; } + + public override void ExecuteCmdlet() + { + WriteObject(Client.CreateLocalNetworkGateway(GatewayName, IpAddress, AddressSpace)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGateway.cs new file mode 100644 index 000000000000..ca709e038de0 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGateway.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.New, "AzureVirtualNetworkGateway"), OutputType(typeof(ManagementOperationContext))] + public class NewAzureVirtualNetworkGatewayCommand : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network name.")] + public string VNetName { get; set; } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway name.")] + public string GatewayName { get; set; } + + [Parameter(Position = 2, Mandatory = false, HelpMessage = "The type of routing that the gateway will use:StaticRouting/DynamicRouting. This will default to StaticRouting if no value is provided.")] + public string GatewayType { get; set; } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The Gateway SKU for the new gateway:Default/HighPerformance/Standard. This will default to 'Default' SKU if no value is provided.")] + public string GatewaySKU { get; set; } + + [Parameter(Position = 4, Mandatory = false, HelpMessage = "Location for the virtual network gateway.")] + public string Location { get; set; } + + [Parameter(Position = 5, Mandatory = false, HelpMessage = "The virtual network Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string VnetId { get; set; } + + public override void ExecuteCmdlet() + { + WriteObject(Client.CreateVirtualNetworkGateway(VNetName, GatewayName, GatewayType, GatewaySKU, Location, VnetId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs new file mode 100644 index 000000000000..47365677783c --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs @@ -0,0 +1,55 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.New, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(ManagementOperationContext))] + public class NewAzureVirtualNetworkGatewayConnectionCommand : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Service Key / Local network gateway Id / Vnet Network Gateway Id")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedEntityId { get; set; } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connection name.")] + [ValidateNotNullOrEmpty] + public string gatewayConnectionName { get; set; } + + [Parameter(Position = 2, Mandatory = true, HelpMessage = "Gateway connection type: Ipsec/Dedicated/VpnClient/Vnet2Vnet")] + [ValidateNotNullOrEmpty] + public string gatewayConnectionType { get; set; } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The Routing Weight.")] + public int routingWeight { get; set; } + + [Parameter(Position = 4, Mandatory = false, HelpMessage = "Ipsec share key.")] + public string sharedKey { get; set; } + + [Parameter(Position = 5, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string virtualNetworkGatewayId { get; set; } + + public override void ExecuteCmdlet() + { + WriteObject(Client.CreateVirtualNetworkGatewayConnection(connectedEntityId, gatewayConnectionName, gatewayConnectionType, routingWeight, sharedKey, Guid.Parse(virtualNetworkGatewayId))); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs new file mode 100644 index 000000000000..e7806b39ba03 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Remove, "AzureLocalNetworkGateway"), OutputType(typeof(AzureOperationResponse))] + public class RemoveAzureLocalNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Local network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.DeleteLocalNetworkGateway(gatewayId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs new file mode 100644 index 000000000000..c070efe47d3a --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Remove, "AzureVirtualNetworkGateway"), OutputType(typeof(ManagementOperationContext))] + public class RemoveAzureVirtualNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.DeleteVirtualNetworkGateway(gatewayId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs new file mode 100644 index 000000000000..65ecd6985c2e --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs @@ -0,0 +1,47 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Remove, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(ManagementOperationContext))] + public class RemoveAzureVirtualNetworkGatewayConnection : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "Virtual network gateway connected EntityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedEntityId + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.DeleteVirtualNetworkGatewayConnection(gatewayId, connectedEntityId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs new file mode 100644 index 000000000000..977a66595b25 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs @@ -0,0 +1,37 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; + using System.Management.Automation; + using WindowsAzure.Management.Network.Models; + + [Cmdlet(VerbsCommon.Reset, "AzureVirtualNetworkGateway"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class ResetAzureVirtualNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.ResetVirtualNetworkGateway(gatewayId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs new file mode 100644 index 000000000000..4a36e0afd6d1 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs @@ -0,0 +1,56 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Management.Network.Models; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Reset, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class ResetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + [Parameter(Position = 2, Mandatory = true, HelpMessage = "The number of characters that the shared key will contain when reset.The virtual network gateway connected entityId.")] + [ValidateNotNullOrEmpty] + public int keyLength + { + get; + set; + } + + + public override void ExecuteCmdlet() + { + WriteObject(Client.ResetSharedKeyV2(gatewayId, connectedentityId, keyLength)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs new file mode 100644 index 000000000000..d8b479d34de7 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs @@ -0,0 +1,44 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Management.Network.Models; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Resize, "AzureVirtualNetworkGateway"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class ResizeAzureVirtualNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The SKU that the existing gateway will be resized to: Default/HighPerformance/Standard")] + [ValidateNotNullOrEmpty] + public string GatewaySKU + { + get; set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.ResizeVirtualNetworkGateway(gatewayId, GatewaySKU)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs new file mode 100644 index 000000000000..25fa408f9f5c --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs @@ -0,0 +1,83 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.WindowsAzure.Management.Network.Models; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Set, "AzureVirtualNetworkGatewayIPsecParameters"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class SetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + [Parameter(Position = 2, Mandatory = false, HelpMessage = "The type of encryption that will " + + "be used for the connection between the virtual network gateway and the local network. " + + "Valid values are RequireEncryption/NoEncryption/AES256/AES128/DES3.")] + public string EncryptionType + { + get; + set; + } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The PFS gruop that will be used " + + "for the connection between the virtual network gateway and the local network. Valid " + + "values are PFS1 and None.")] + public string PfsGroup + { + get; + set; + } + + [Parameter(Position = 4, Mandatory = false, HelpMessage = "The SA Data Size Kilobytes value " + + "is used to determine how many kilobytes of traffic can be sent before the SA for the" + + "connection will be renegotiated.")] + public int SADataSizeKilobytes + { + get; + set; + } + + [Parameter(Position = 5, Mandatory = false, HelpMessage = "The SA Lifetime Seconds value " + + "is used to determine how long (in seconds) this connection's SA will be valid before " + + "a new SA will be negotiated.")] + public int SALifetimeSeconds + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.SetIPsecParametersV2(gatewayId, connectedentityId, EncryptionType, PfsGroup, SADataSizeKilobytes, SALifetimeSeconds)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs new file mode 100644 index 000000000000..8e1f3d7fa161 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs @@ -0,0 +1,54 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Set, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(SharedKeyContext))] + public class SetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + [Parameter(Position = 2, Mandatory = true, HelpMessage = "The shared key that will be used on the Azure Gateway and the customer's VPN device.")] + [ValidateNotNullOrEmpty] + public string SharedKey + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.SetSharedKeyV2(gatewayId, connectedentityId, SharedKey)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs new file mode 100644 index 000000000000..6176b3073dd3 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.Common.Storage; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsLifecycle.Start, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] + public class StartAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId { get; set; } + + [Parameter(Position = 1, Mandatory = false, HelpMessage = "The duration of the capture in seconds (between 1 and 300)")] + [ValidateNotNullOrEmpty] + public int CaptureDurationInSeconds { get; set; } + + [Parameter(Position = 2, Mandatory = false, HelpMessage = "The container name provided by customer (optional)")] + [ValidateNotNullOrEmpty] + public string ContainerName { get; set; } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The object used to access the customer's storage account. This can be created using the Get-AzureStorageContext cmdlet.")] + public AzureStorageContext StorageContext { get; set; } + + public override void ExecuteCmdlet() + { + WriteObject(Client.StartDiagnosticsV2(gatewayId, CaptureDurationInSeconds, ContainerName, StorageContext)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs new file mode 100644 index 000000000000..af1367520255 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -0,0 +1,34 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsLifecycle.Stop, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] + public class StopAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId { get; set; } + + public override void ExecuteCmdlet() + { + WriteObject(Client.StopDiagnosticsV2(gatewayId)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs new file mode 100644 index 000000000000..c2a5d90dacb5 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure; +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Reset, "AzureLocalNetworkGateway"), OutputType(typeof(AzureOperationResponse))] + public class ResetAzureLocalNetworkGateway : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network gateway AddressSpace.")] + [ValidateNotNullOrEmpty] + public List addressSpace + { + get; set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.UpdateLocalNetworkGateway(gatewayId, addressSpace)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs new file mode 100644 index 000000000000..9055a2f6c5e3 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs @@ -0,0 +1,62 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model; +using Microsoft.WindowsAzure.Management.Network.Models; +using System.Management.Automation; + +namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway +{ + [Cmdlet(VerbsCommon.Reset, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class ResetAzureVirtualNetworkGatewayConnection : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string gatewayId + { + get; + set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] + [ValidateGuid] + [ValidateNotNullOrEmpty] + public string connectedentityId + { + get; + set; + } + + [Parameter(Position = 2, Mandatory = true, HelpMessage = "The Routing Weight.")] + [ValidateNotNullOrEmpty] + public int routingWeight + { + get; + set; + } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The Ipsec share key.")] + public string sharedKey + { + get; + set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.UpdateVirtualNetworkGatewayConnection(gatewayId, connectedentityId, routingWeight, sharedKey)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs index 1c0ddf7a9bc7..6c02b09b5e38 100644 --- a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs +++ b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs @@ -1022,5 +1022,349 @@ public string GetIPForwardingForNetworkInterface(string serviceName, string depl IPForwardingGetResponse ipForwardingGetResponse = client.IPForwarding.GetForNetworkInterface(serviceName, deploymentName, roleName, networkInterfaceName); return ipForwardingGetResponse.State; } + + public GetVirtualNetworkGatewayContext GetVirtualNetworkGateway(string gatewayId) + { + if (string.IsNullOrWhiteSpace(gatewayId)) + { + throw new ArgumentException("gatewayId cannot be null or whitespace.", "gatewayId"); + } + + VirtualNetworkGatewayGetResponse response = client.Gateways.GetVirtualNetworkGateway(gatewayId); + + GetVirtualNetworkGatewayContext gatewayContext = new GetVirtualNetworkGatewayContext() + { + GatewayId = response.GatewayId.ToString(), + GatewayName = response.GatewayName, + GatewayType = response.GatewayType, + LastEventData = (response.LastEvent != null) ? response.LastEvent.Data : null, + LastEventMessage = (response.LastEvent != null) ? response.LastEvent.Message : null, + LastEventID = GetEventId(response.LastEvent), + LastEventTimeStamp = (response.LastEvent != null) ? (DateTime?)response.LastEvent.Timestamp : null, + State = (ProvisioningState)Enum.Parse(typeof(ProvisioningState), response.State, true), + VIPAddress = response.VipAddress, + DefaultSite = (response.DefaultSite != null ? response.DefaultSite.Name : null), + GatewaySKU = response.GatewaySKU, + Location = response.Location, + VnetId = response.VnetId, + SubnetId = response.SubnetId, + EnableBgp = response.EnableBgp.ToString(), + }; + PopulateOperationContext(response.RequestId, gatewayContext); + + return gatewayContext; + } + + public GetVirtualNetworkGatewayConnectionContext GetVirtualNetworkGatewayConnection(string gatewayId, string connectedentityId) + { + if (string.IsNullOrWhiteSpace(gatewayId)) + { + throw new ArgumentException("gatewayId cannot be null or whitespace.", "gatewayId"); + } + if (string.IsNullOrWhiteSpace(connectedentityId)) + { + throw new ArgumentException("connectedentityId cannot be null or whitespace.", "connectedentityId"); + } + + GatewayConnectionGetResponse response = client.Gateways.GetGatewayConnection(gatewayId, connectedentityId); + + GetVirtualNetworkGatewayConnectionContext gatewayContext = new GetVirtualNetworkGatewayConnectionContext() + { + GatewayConnectionName = response.GatewayConnectionName.ToString(), + VirtualNetworkGatewayId = response.VirtualNetworkGatewayId.ToString(), + ConnectedEntityId = response.ConnectedEntityId, + GatewayConnectionType = response.GatewayConnectionType, + RoutingWeight = response.RoutingWeight, + SharedKey = response.SharedKey, + }; + PopulateOperationContext(response.RequestId, gatewayContext); + + return gatewayContext; + } + + public GetLocalNetworkGatewayContext GetLocalNetworkGateway(string gatewayId) + { + if (string.IsNullOrWhiteSpace(gatewayId)) + { + throw new ArgumentException("gatewayId cannot be null or whitespace.", "gatewayId"); + } + + LocalNetworkGatewayGetResponse response = client.Gateways.GetLocalNetworkGateway(gatewayId); + + GetLocalNetworkGatewayContext gatewayContext = new GetLocalNetworkGatewayContext() + { + GatewayId = response.Id.ToString(), + GatewayName = response.GatewayName, + IpAddress = response.IpAddress, + AddressSpace = response.AddressSpace.ToList(), + }; + PopulateOperationContext(response.RequestId, gatewayContext); + + return gatewayContext; + } + public IEnumerable ListVirtualNetworkGatewayConnections() + { + GatewayListGatewayConnectionsResponse response = client.Gateways.ListGatewayConnections(); + + IEnumerable connections = response.VirtualNetworkGatewayConnections.Select( + (GatewayListGatewayConnectionsResponse.VirtualNetworkGatewayConnection connection) => + { + return new GetVirtualNetworkGatewayConnectionContext() + { + GatewayConnectionName = connection.GatewayConnectionName, + VirtualNetworkGatewayId = connection.VirtualNetworkGatewayId.ToString(), + ConnectedEntityId = connection.ConnectedEntityId, + GatewayConnectionType = connection.GatewayConnectionType, + RoutingWeight = connection.RoutingWeight, + SharedKey = connection.SharedKey, + }; + }); + PopulateOperationContext(response.RequestId, connections); + + return connections; + } + + public IEnumerable ListVirtualNetworkGateways() + { + ListVirtualNetworkGatewaysResponse response = client.Gateways.ListVirtualNetworkGateways(); + + IEnumerable virtualNetworkGateways = response.VirtualNetworkGateways.Select( + (ListVirtualNetworkGatewaysResponse.VirtualNetworkGateway virtualNetworkGateway) => + { + return new GetVirtualNetworkGatewayContext() + { + GatewayId = virtualNetworkGateway.GatewayId.ToString(), + GatewayName = virtualNetworkGateway.GatewayName, + GatewayType = virtualNetworkGateway.GatewayType, + LastEventData = (virtualNetworkGateway.LastEvent != null) ? virtualNetworkGateway.LastEvent.Data : null, + LastEventMessage = (virtualNetworkGateway.LastEvent != null) ? virtualNetworkGateway.LastEvent.Message : null, + LastEventID = GetEventId(virtualNetworkGateway.LastEvent), + LastEventTimeStamp = (virtualNetworkGateway.LastEvent != null) ? (DateTime?)virtualNetworkGateway.LastEvent.Timestamp : null, + State = (ProvisioningState)Enum.Parse(typeof(ProvisioningState), virtualNetworkGateway.State, true), + VIPAddress = virtualNetworkGateway.VipAddress, + DefaultSite = (virtualNetworkGateway.DefaultSite != null ? virtualNetworkGateway.DefaultSite.Name : null), + GatewaySKU = virtualNetworkGateway.GatewaySKU, + Location = virtualNetworkGateway.Location, + VnetId = virtualNetworkGateway.VnetId, + SubnetId = virtualNetworkGateway.SubnetId, + EnableBgp = virtualNetworkGateway.EnableBgp.ToString(), + }; + }); + PopulateOperationContext(response.RequestId, virtualNetworkGateways); + + return virtualNetworkGateways; + } + + public IEnumerable ListLocalNetworkGateways() + { + ListLocalNetworkGatewaysResponse response = client.Gateways.ListLocalNetworkGateways(); + + IEnumerable localNetworkGateways = response.LocalNetworkGateways.Select( + (ListLocalNetworkGatewaysResponse.LocalNetworkGateway localNetworkGateway) => + { + return new GetLocalNetworkGatewayContext() + { + GatewayId = localNetworkGateway.Id.ToString(), + GatewayName = localNetworkGateway.GatewayName, + IpAddress = localNetworkGateway.IpAddress, + AddressSpace = localNetworkGateway.AddressSpace.ToList(), + }; + }); + PopulateOperationContext(response.RequestId, localNetworkGateways); + + return localNetworkGateways; + } + + public VirtualNetworkDiagnosticsContext GetDiagnosticsV2(string gatewayId) + { + GatewayDiagnosticsStatus diagnosticsStatus = client.Gateways.GetDiagnosticsV2(gatewayId); + + VirtualNetworkDiagnosticsContext diagnosticsContext = new VirtualNetworkDiagnosticsContext() + { + DiagnosticsUrl = diagnosticsStatus.DiagnosticsUrl, + State = diagnosticsStatus.State, + }; + PopulateOperationContext(diagnosticsStatus.RequestId, diagnosticsContext); + + return diagnosticsContext; + } + + public SharedKeyContext GetSharedKeyV2(string gatewayId, string connectedentityId) + { + GatewayGetSharedKeyResponse response = client.Gateways.GetSharedKeyV2(gatewayId, connectedentityId); + + SharedKeyContext sharedKeyContext = new SharedKeyContext() + { + Value = response.SharedKey + }; + PopulateOperationContext(response.RequestId, sharedKeyContext); + + return sharedKeyContext; + } + + public GatewayGetOperationStatusResponse CreateVirtualNetworkGateway(string vnetName, string gatewayName, string gatewayType, string gatewaySKU, string location, string vnetId) + { + VirtualNetworkGatewayCreateParameters parameters = new VirtualNetworkGatewayCreateParameters() + { + GatewayName = gatewayName, + GatewaySKU = gatewaySKU, + GatewayType = gatewayType, + Location = location, + VnetId = vnetId, + }; + + return client.Gateways.CreateVirtualNetworkGateway(vnetName, parameters); + } + + public GatewayGetOperationStatusResponse CreateVirtualNetworkGatewayConnection(string connectedEntityId, string gatewayConnectionName, string gatewayConnectionType, + int routingWeight, string sharedKey, Guid virtualNetworkGatewayId) + { + GatewayConnectionCreateParameters parameters = new GatewayConnectionCreateParameters() + { + ConnectedEntityId = connectedEntityId, + GatewayConnectionName = gatewayConnectionName, + GatewayConnectionType = gatewayConnectionType, + VirtualNetworkGatewayId = virtualNetworkGatewayId, + RoutingWeight = routingWeight, + SharedKey = sharedKey, + }; + + return client.Gateways.CreateGatewayConnection(parameters); + } + + public LocalNetworkGatewayCreateResponse CreateLocalNetworkGateway(string gatewayName, string ipAddress, List addressSpace) + { + LocalNetworkGatewayCreateParameters parameters = new LocalNetworkGatewayCreateParameters() + { + AddressSpace = addressSpace, + GatewayName = gatewayName, + IpAddress = ipAddress, + }; + + return client.Gateways.CreateLocalNetworkGateway(parameters); + } + + public GatewayGetOperationStatusResponse DeleteVirtualNetworkGateway(string gatewayId) + { + return client.Gateways.DeleteVirtualNetworkGateway(gatewayId); + } + + public GatewayGetOperationStatusResponse DeleteVirtualNetworkGatewayConnection(string gatewayId, string connectedentityId) + { + return client.Gateways.DeleteGatewayConnection(gatewayId, connectedentityId); + } + + public AzureOperationResponse DeleteLocalNetworkGateway(string gatewayId) + { + return client.Gateways.DeleteLocalNetworkGateway(gatewayId); + } + + public GatewayGetOperationStatusResponse ResetVirtualNetworkGateway(string gatewayId) + { + ResetGatewayParameters parameters = new ResetGatewayParameters(); + return client.Gateways.ResetVirtualNetworkGateway(gatewayId, parameters); + } + + public GatewayGetOperationStatusResponse SetSharedKeyV2(string gatewayId, string connectedentityId, string sharedKey) + { + GatewaySetSharedKeyParameters sharedKeyParameters = new GatewaySetSharedKeyParameters() + { + Value = sharedKey, + }; + + return client.Gateways.SetSharedKeyV2(gatewayId, connectedentityId, sharedKeyParameters); + } + + public GatewayGetOperationStatusResponse ResetSharedKeyV2(string gatewayId, string connectedentityId, int keyLength) + { + GatewayResetSharedKeyParameters parameters = new GatewayResetSharedKeyParameters() + { + KeyLength = keyLength, + }; + return client.Gateways.ResetSharedKeyV2(gatewayId, connectedentityId, parameters); + } + + public GatewayGetOperationStatusResponse ResizeVirtualNetworkGateway(string gatewayId, string gatewaySKU) + { + ResizeGatewayParameters parameters = new ResizeGatewayParameters() + { + GatewaySKU = gatewaySKU, + }; + return client.Gateways.ResizeVirtualNetworkGateway(gatewayId, parameters); + } + + public GatewayGetOperationStatusResponse UpdateVirtualNetworkGatewayConnection(string gatewayId, string connectedentityId, int routingWeight, string sharedKey) + { + UpdateGatewayConnectionParameters parameters = new UpdateGatewayConnectionParameters() + { + RoutingWeight = routingWeight, + SharedKey = sharedKey, + }; + return client.Gateways.UpdateGatewayConnection(gatewayId, connectedentityId, parameters); + } + + public AzureOperationResponse UpdateLocalNetworkGateway(string gatewayId, List addressSpace) + { + UpdateLocalNetworkGatewayParameters parameters = new UpdateLocalNetworkGatewayParameters() + { + AddressSpace = addressSpace, + }; + + return client.Gateways.UpdateLocalNetworkGateway(gatewayId, parameters); + } + + public GatewayGetOperationStatusResponse StartDiagnosticsV2(string gatewayId, int captureDurationInSeconds, string containerName, AzureStorageContext storageContext) + { + StorageCredentials credentials = storageContext.StorageAccount.Credentials; + string customerStorageKey = credentials.ExportBase64EncodedKey(); + string customerStorageName = credentials.AccountName; + return StartDiagnosticsV2(gatewayId, captureDurationInSeconds, containerName, customerStorageKey, customerStorageName); + } + public GatewayGetOperationStatusResponse StartDiagnosticsV2(string gatewayId, int captureDurationInSeconds, string containerName, string customerStorageKey, string customerStorageName) + { + StartGatewayPublicDiagnosticsParameters parameters = new StartGatewayPublicDiagnosticsParameters() + { + CaptureDurationInSeconds = captureDurationInSeconds.ToString(), + ContainerName = containerName, + CustomerStorageKey = customerStorageKey, + CustomerStorageName = customerStorageName, + Operation = UpdateGatewayPublicDiagnosticsOperation.StartDiagnostics, + }; + + return client.Gateways.StartDiagnosticsV2(gatewayId, parameters); + } + + public GatewayOperationResponse StopDiagnosticsV2(string gatewayId) + { + StopGatewayPublicDiagnosticsParameters parameters = new StopGatewayPublicDiagnosticsParameters() + { + Operation = UpdateGatewayPublicDiagnosticsOperation.StopDiagnostics, + }; + + return client.Gateways.StopDiagnosticsV2(gatewayId, parameters); + } + + public GatewayGetOperationStatusResponse SetIPsecParametersV2(string gatewayId, string connectedentityId, string encryptionType, string pfsGroup, int saDataSizeKilobytes, int saLifetimeSeconds) + { + GatewaySetIPsecParametersParameters parameters = new GatewaySetIPsecParametersParameters() + { + Parameters = new IPsecParameters() + { + EncryptionType = encryptionType, + PfsGroup = pfsGroup, + SADataSizeKilobytes = saDataSizeKilobytes, + SALifeTimeSeconds = saLifetimeSeconds, + }, + }; + + return client.Gateways.SetIPsecParametersV2(gatewayId, connectedentityId, parameters); + } + + public IPsecParameters GetIPsecParametersV2(string gatewayId, string connectedentityId) + { + return client.Gateways.GetIPsecParametersV2(gatewayId, connectedentityId).IPsecParameters; + } + + } } diff --git a/src/ServiceManagement/Network/Commands.Network/Properties/Resources.Designer.cs b/src/ServiceManagement/Network/Commands.Network/Properties/Resources.Designer.cs index 1c03656c78d2..5ff95676fe6d 100644 --- a/src/ServiceManagement/Network/Commands.Network/Properties/Resources.Designer.cs +++ b/src/ServiceManagement/Network/Commands.Network/Properties/Resources.Designer.cs @@ -45,7 +45,18 @@ internal Resources() { return resourceMan; } } - + + /// + /// Looks up a localized string similar to The value {0} is an invalid GUID.. + /// + internal static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. diff --git a/src/ServiceManagement/Network/Commands.Network/Properties/Resources.resx b/src/ServiceManagement/Network/Commands.Network/Properties/Resources.resx index 2c0cbf71eb1a..d71f1226fd99 100644 --- a/src/ServiceManagement/Network/Commands.Network/Properties/Resources.resx +++ b/src/ServiceManagement/Network/Commands.Network/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The value {0} is an invalid GUID. + Not able to find the cache service just now created diff --git a/src/ServiceManagement/Network/Commands.Network/packages.config b/src/ServiceManagement/Network/Commands.Network/packages.config index 775bc74e1354..8a0b2891becc 100644 --- a/src/ServiceManagement/Network/Commands.Network/packages.config +++ b/src/ServiceManagement/Network/Commands.Network/packages.config @@ -17,7 +17,7 @@ - + From d2d10fa4aacc2b657b3eec9f22b8e20195289602 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 May 2015 11:01:58 -0700 Subject: [PATCH 2/3] WORK:3387747 Code review comments incorporation --- .../Gateway/GetAzureLocalNetworkGateway.cs | 6 +++--- .../Gateway/GetAzureVirtualNetworkGateway.cs | 6 +++--- .../GetAzureVirtualNetworkGatewayConnection.cs | 8 ++++---- .../GetAzureVirtualNetworkGatewayDiagnosticsV2.cs | 4 ++-- ...tAzureVirtualNetworkGatewayIPsecParametersV2.cs | 6 +++--- .../Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs | 6 +++--- .../Gateway/Model/GetLocalNetworkGatewayContext.cs | 8 ++++---- .../GetVirtualNetworkGatewayConnectionContext.cs | 8 ++++---- .../Model/GetVirtualNetworkGatewayContext.cs | 6 +++--- .../Gateway/Model/LocalNetwrokGatewayContext.cs | 4 ++-- .../Model/VirtualNetworkDiagnosticsContext.cs | 6 +++--- .../Gateway/Model/VirtualNetworkGatewayContext.cs | 6 +++--- .../NewAzureVirtualNetworkGatewayConnection.cs | 14 +++++++------- .../Gateway/RemoveAzureLocalNetworkGateway.cs | 4 ++-- .../Gateway/RemoveAzureVirtualNetworkGateway.cs | 4 ++-- .../RemoveAzureVirtualNetworkGatewayConnection.cs | 6 +++--- .../Gateway/ResetAzureVirtualNetworkGateway.cs | 4 ++-- .../ResetAzureVirtualNetworkGatewayKeyV2.cs | 6 +++--- .../Gateway/ResizeAzureVirtualNetworkGateway.cs | 4 ++-- ...tAzureVirtualNetworkGatewayIPsecParametersV2.cs | 6 +++--- .../Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs | 6 +++--- ...StartAzureVirtualNetworkGatewayDiagnosticsV2.cs | 4 ++-- .../StopAzureVirtualNetworkGatewayDiagnosticsV2.cs | 4 ++-- .../Gateway/UpdateAzureLocalNetworkGateway.cs | 6 +++--- .../UpdateAzureVirtualNetworkGatewayConnection.cs | 10 +++++----- 25 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs index b99930d01e7d..b230436452b0 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureLocalNetworkGateway.cs @@ -23,7 +23,7 @@ public class GetAzureLocalNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = false, HelpMessage = "Local network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -31,9 +31,9 @@ public string gatewayId public override void ExecuteCmdlet() { - if (!string.IsNullOrEmpty(gatewayId)) + if (!string.IsNullOrEmpty(GatewayId)) { - WriteObject(Client.GetLocalNetworkGateway(gatewayId)); + WriteObject(Client.GetLocalNetworkGateway(GatewayId)); } else { diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs index 7b98c6882277..a62e7fb452f3 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGateway.cs @@ -23,7 +23,7 @@ public class GetAzureVirtualNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -31,9 +31,9 @@ public string gatewayId public override void ExecuteCmdlet() { - if (!string.IsNullOrEmpty(gatewayId)) + if (!string.IsNullOrEmpty(GatewayId)) { - WriteObject(Client.GetVirtualNetworkGateway(gatewayId)); + WriteObject(Client.GetVirtualNetworkGateway(GatewayId)); } else { diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs index 31259605c4bf..fd22fe276279 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayConnection.cs @@ -23,7 +23,7 @@ public class GetAzureVirtualNetworkConnectionGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = false, HelpMessage = "Virtual network gateway Connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -40,9 +40,9 @@ public string connectedentityId public override void ExecuteCmdlet() { - if (!string.IsNullOrEmpty(gatewayId) && !string.IsNullOrEmpty(connectedentityId)) + if (!string.IsNullOrEmpty(GatewayId) && !string.IsNullOrEmpty(ConnectedEntityId)) { - WriteObject(Client.GetVirtualNetworkGatewayConnection(gatewayId, connectedentityId)); + WriteObject(Client.GetVirtualNetworkGatewayConnection(GatewayId, ConnectedEntityId)); } else { diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs index 80ff5dec5973..32a57e190dbe 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -24,7 +24,7 @@ public class GetAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId public override void ExecuteCmdlet() { - WriteObject(Client.GetDiagnosticsV2(gatewayId)); + WriteObject(Client.GetDiagnosticsV2(GatewayId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs index 444a40f4b2fe..784e59a0119d 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs @@ -24,7 +24,7 @@ public class GetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -33,7 +33,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -41,7 +41,7 @@ public string connectedentityId public override void ExecuteCmdlet() { - WriteObject(Client.GetIPsecParametersV2(gatewayId, connectedentityId)); + WriteObject(Client.GetIPsecParametersV2(GatewayId, ConnectedEntityId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs index 01b0b8cea302..cbc7cf34b2c8 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs @@ -23,7 +23,7 @@ public class GetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -40,7 +40,7 @@ public string connectedentityId public override void ExecuteCmdlet() { - WriteObject(Client.GetSharedKeyV2(gatewayId, connectedentityId)); + WriteObject(Client.GetSharedKeyV2(GatewayId, ConnectedEntityId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs index 5a91e41d3166..80084128bb8d 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetLocalNetworkGatewayContext.cs @@ -12,12 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; +using System.Collections.Generic; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network { - using System; - using System.Collections.Generic; - using WindowsAzure.Commands.Utilities.Common; - public class GetLocalNetworkGatewayContext : ManagementOperationContext { public string GatewayId { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs index f68c8711db25..ffa54c0f15bd 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayConnectionContext.cs @@ -12,12 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.WindowsAzure.Management.Network.Models; +using System; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network { - using Microsoft.WindowsAzure.Management.Network.Models; - using System; - using WindowsAzure.Commands.Utilities.Common; - public class GetVirtualNetworkGatewayConnectionContext : ManagementOperationContext { public string GatewayConnectionName { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs index 3b03f647d9d0..b1502786dfac 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/GetVirtualNetworkGatewayContext.cs @@ -12,11 +12,11 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network { - using System; - using WindowsAzure.Commands.Utilities.Common; - public class GetVirtualNetworkGatewayContext : ManagementOperationContext { public string GatewayId { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs index ec333eb65d19..e9187979b36f 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/LocalNetwrokGatewayContext.cs @@ -12,10 +12,10 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model { - using WindowsAzure.Commands.Utilities.Common; - public class LocalNetwrokGatewayContext : ManagementOperationContext { public string LocalNetworkGatewayId { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkDiagnosticsContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkDiagnosticsContext.cs index 4ef6e212d490..b0626a1a7018 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkDiagnosticsContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkDiagnosticsContext.cs @@ -12,11 +12,11 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.WindowsAzure.Management.Network.Models; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model { - using WindowsAzure.Commands.Utilities.Common; - using WindowsAzure.Management.Network.Models; - public class VirtualNetworkDiagnosticsContext : ManagementOperationContext { public string DiagnosticsUrl { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs index 067314f3de7f..850d24e2a6e7 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs @@ -12,11 +12,11 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; + namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network { - using System; - using WindowsAzure.Commands.Utilities.Common; - public class VirtualNetworkGatewayContext : ManagementOperationContext { public string LastEventData { get; set; } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs index 47365677783c..1b0f1bde19d6 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVirtualNetworkGatewayConnection.cs @@ -26,30 +26,30 @@ public class NewAzureVirtualNetworkGatewayConnectionCommand : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Service Key / Local network gateway Id / Vnet Network Gateway Id")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedEntityId { get; set; } + public string ConnectedEntityId { get; set; } [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connection name.")] [ValidateNotNullOrEmpty] - public string gatewayConnectionName { get; set; } + public string GatewayConnectionName { get; set; } [Parameter(Position = 2, Mandatory = true, HelpMessage = "Gateway connection type: Ipsec/Dedicated/VpnClient/Vnet2Vnet")] [ValidateNotNullOrEmpty] - public string gatewayConnectionType { get; set; } + public string GatewayConnectionType { get; set; } [Parameter(Position = 3, Mandatory = false, HelpMessage = "The Routing Weight.")] - public int routingWeight { get; set; } + public int RoutingWeight { get; set; } [Parameter(Position = 4, Mandatory = false, HelpMessage = "Ipsec share key.")] - public string sharedKey { get; set; } + public string SharedKey { get; set; } [Parameter(Position = 5, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string virtualNetworkGatewayId { get; set; } + public string VirtualNetworkGatewayId { get; set; } public override void ExecuteCmdlet() { - WriteObject(Client.CreateVirtualNetworkGatewayConnection(connectedEntityId, gatewayConnectionName, gatewayConnectionType, routingWeight, sharedKey, Guid.Parse(virtualNetworkGatewayId))); + WriteObject(Client.CreateVirtualNetworkGatewayConnection(ConnectedEntityId, GatewayConnectionName, GatewayConnectionType, RoutingWeight, SharedKey, Guid.Parse(VirtualNetworkGatewayId))); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs index e7806b39ba03..7c59ee41174a 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureLocalNetworkGateway.cs @@ -24,7 +24,7 @@ public class RemoveAzureLocalNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Local network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId public override void ExecuteCmdlet() { - WriteObject(Client.DeleteLocalNetworkGateway(gatewayId)); + WriteObject(Client.DeleteLocalNetworkGateway(GatewayId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs index c070efe47d3a..8af865f91ad2 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGateway.cs @@ -24,7 +24,7 @@ public class RemoveAzureVirtualNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId public override void ExecuteCmdlet() { - WriteObject(Client.DeleteVirtualNetworkGateway(gatewayId)); + WriteObject(Client.DeleteVirtualNetworkGateway(GatewayId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs index 65ecd6985c2e..97a07baf8759 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/RemoveAzureVirtualNetworkGatewayConnection.cs @@ -24,7 +24,7 @@ public class RemoveAzureVirtualNetworkGatewayConnection : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -33,7 +33,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "Virtual network gateway connected EntityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedEntityId + public string ConnectedEntityId { get; set; @@ -41,7 +41,7 @@ public string connectedEntityId public override void ExecuteCmdlet() { - WriteObject(Client.DeleteVirtualNetworkGatewayConnection(gatewayId, connectedEntityId)); + WriteObject(Client.DeleteVirtualNetworkGatewayConnection(GatewayId, ConnectedEntityId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs index 977a66595b25..37ac78b3ddc9 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGateway.cs @@ -24,14 +24,14 @@ public class ResetAzureVirtualNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; } public override void ExecuteCmdlet() { - WriteObject(Client.ResetVirtualNetworkGateway(gatewayId)); + WriteObject(Client.ResetVirtualNetworkGateway(GatewayId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs index 4a36e0afd6d1..67c2be2bd4a7 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs @@ -24,7 +24,7 @@ public class ResetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -33,7 +33,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -50,7 +50,7 @@ public int keyLength public override void ExecuteCmdlet() { - WriteObject(Client.ResetSharedKeyV2(gatewayId, connectedentityId, keyLength)); + WriteObject(Client.ResetSharedKeyV2(GatewayId, ConnectedEntityId, keyLength)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs index d8b479d34de7..3478ccacb8f0 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVirtualNetworkGateway.cs @@ -24,7 +24,7 @@ public class ResizeAzureVirtualNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; } @@ -38,7 +38,7 @@ public string GatewaySKU public override void ExecuteCmdlet() { - WriteObject(Client.ResizeVirtualNetworkGateway(gatewayId, GatewaySKU)); + WriteObject(Client.ResizeVirtualNetworkGateway(GatewayId, GatewaySKU)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs index 25fa408f9f5c..eecc17a8dc24 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs @@ -24,7 +24,7 @@ public class SetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -33,7 +33,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -77,7 +77,7 @@ public int SALifetimeSeconds public override void ExecuteCmdlet() { - WriteObject(Client.SetIPsecParametersV2(gatewayId, connectedentityId, EncryptionType, PfsGroup, SADataSizeKilobytes, SALifetimeSeconds)); + WriteObject(Client.SetIPsecParametersV2(GatewayId, ConnectedEntityId, EncryptionType, PfsGroup, SADataSizeKilobytes, SALifetimeSeconds)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs index 8e1f3d7fa161..067c17cf9d46 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs @@ -23,7 +23,7 @@ public class SetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -32,7 +32,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -48,7 +48,7 @@ public string SharedKey public override void ExecuteCmdlet() { - WriteObject(Client.SetSharedKeyV2(gatewayId, connectedentityId, SharedKey)); + WriteObject(Client.SetSharedKeyV2(GatewayId, ConnectedEntityId, SharedKey)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs index 6176b3073dd3..9fff0b337990 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -25,7 +25,7 @@ public class StartAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId { get; set; } + public string GatewayId { get; set; } [Parameter(Position = 1, Mandatory = false, HelpMessage = "The duration of the capture in seconds (between 1 and 300)")] [ValidateNotNullOrEmpty] @@ -40,7 +40,7 @@ public class StartAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase public override void ExecuteCmdlet() { - WriteObject(Client.StartDiagnosticsV2(gatewayId, CaptureDurationInSeconds, ContainerName, StorageContext)); + WriteObject(Client.StartDiagnosticsV2(GatewayId, CaptureDurationInSeconds, ContainerName, StorageContext)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs index af1367520255..232dc48b906f 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs @@ -24,11 +24,11 @@ public class StopAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId { get; set; } + public string GatewayId { get; set; } public override void ExecuteCmdlet() { - WriteObject(Client.StopDiagnosticsV2(gatewayId)); + WriteObject(Client.StopDiagnosticsV2(GatewayId)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs index c2a5d90dacb5..498e70abce46 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureLocalNetworkGateway.cs @@ -25,21 +25,21 @@ public class ResetAzureLocalNetworkGateway : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; } [Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network gateway AddressSpace.")] [ValidateNotNullOrEmpty] - public List addressSpace + public List AddressSpace { get; set; } public override void ExecuteCmdlet() { - WriteObject(Client.UpdateLocalNetworkGateway(gatewayId, addressSpace)); + WriteObject(Client.UpdateLocalNetworkGateway(GatewayId, AddressSpace)); } } } diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs index 9055a2f6c5e3..8d3312681186 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/UpdateAzureVirtualNetworkGatewayConnection.cs @@ -24,7 +24,7 @@ public class ResetAzureVirtualNetworkGatewayConnection : NetworkCmdletBase [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string gatewayId + public string GatewayId { get; set; @@ -33,7 +33,7 @@ public string gatewayId [Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")] [ValidateGuid] [ValidateNotNullOrEmpty] - public string connectedentityId + public string ConnectedEntityId { get; set; @@ -41,14 +41,14 @@ public string connectedentityId [Parameter(Position = 2, Mandatory = true, HelpMessage = "The Routing Weight.")] [ValidateNotNullOrEmpty] - public int routingWeight + public int RoutingWeight { get; set; } [Parameter(Position = 3, Mandatory = false, HelpMessage = "The Ipsec share key.")] - public string sharedKey + public string SharedKey { get; set; @@ -56,7 +56,7 @@ public string sharedKey public override void ExecuteCmdlet() { - WriteObject(Client.UpdateVirtualNetworkGatewayConnection(gatewayId, connectedentityId, routingWeight, sharedKey)); + WriteObject(Client.UpdateVirtualNetworkGatewayConnection(GatewayId, ConnectedEntityId, RoutingWeight, SharedKey)); } } } From 8876285e5deb4185006fd55f7999ce1cedf8842f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 May 2015 12:15:12 -0700 Subject: [PATCH 3/3] WORK:3387747 Code review comments incorporation --- .../Commands.ServiceManagement.Network.csproj | 16 ++++++++-------- ... GetAzureVirtualNetworkGatewayDiagnostics.cs} | 2 +- ...AzureVirtualNetworkGatewayIPsecParameters.cs} | 2 +- ...V2.cs => GetAzureVirtualNetworkGatewayKey.cs} | 2 +- ....cs => ResetAzureVirtualNetworkGatewayKey.cs} | 2 +- ...AzureVirtualNetworkGatewayIPsecParameters.cs} | 2 +- ...V2.cs => SetAzureVirtualNetworkGatewayKey.cs} | 2 +- ...tartAzureVirtualNetworkGatewayDiagnostics.cs} | 2 +- ...StopAzureVirtualNetworkGatewayDiagnostics.cs} | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) rename src/ServiceManagement/Network/Commands.Network/Gateway/{GetAzureVirtualNetworkGatewayDiagnosticsV2.cs => GetAzureVirtualNetworkGatewayDiagnostics.cs} (94%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{GetAzureVirtualNetworkGatewayIPsecParametersV2.cs => GetAzureVirtualNetworkGatewayIPsecParameters.cs} (95%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{GetAzureVirtualNetworkGatewayKeyV2.cs => GetAzureVirtualNetworkGatewayKey.cs} (95%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{ResetAzureVirtualNetworkGatewayKeyV2.cs => ResetAzureVirtualNetworkGatewayKey.cs} (96%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{SetAzureVirtualNetworkGatewayIPsecParametersV2.cs => SetAzureVirtualNetworkGatewayIPsecParameters.cs} (97%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{SetAzureVirtualNetworkGatewayKeyV2.cs => SetAzureVirtualNetworkGatewayKey.cs} (96%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{StartAzureVirtualNetworkGatewayDiagnosticsV2.cs => StartAzureVirtualNetworkGatewayDiagnostics.cs} (96%) rename src/ServiceManagement/Network/Commands.Network/Gateway/{StopAzureVirtualNetworkGatewayDiagnosticsV2.cs => StopAzureVirtualNetworkGatewayDiagnostics.cs} (94%) diff --git a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj index 13698be4ccc6..90fde1475547 100644 --- a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj +++ b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj @@ -148,6 +148,9 @@ + + + @@ -168,30 +171,27 @@ + + + + + - - - - - - - - diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnostics.cs similarity index 94% rename from src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnostics.cs index 32a57e190dbe..4f367b18a271 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayDiagnostics.cs @@ -19,7 +19,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] - public class GetAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + public class GetAzureVirtualNetworkGatewayDiagnostics : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParameters.cs similarity index 95% rename from src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParameters.cs index 784e59a0119d..90e8e6a9f170 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParametersV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayIPsecParameters.cs @@ -19,7 +19,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))] - public class GetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase + public class GetAzureVirtualNetworkGatewayIPsecParameters : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKey.cs similarity index 95% rename from src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKey.cs index cbc7cf34b2c8..5da31292abee 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVirtualNetworkGatewayKey.cs @@ -18,7 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(SharedKeyContext))] - public class GetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + public class GetAzureVirtualNetworkGatewayKey : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKey.cs similarity index 96% rename from src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKey.cs index 67c2be2bd4a7..fa18f1176e36 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResetAzureVirtualNetworkGatewayKey.cs @@ -19,7 +19,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Reset, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(GatewayGetOperationStatusResponse))] - public class ResetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + public class ResetAzureVirtualNetworkGatewayKey : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParameters.cs similarity index 97% rename from src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParameters.cs index eecc17a8dc24..4907cc3e28aa 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParametersV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayIPsecParameters.cs @@ -19,7 +19,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Set, "AzureVirtualNetworkGatewayIPsecParameters"), OutputType(typeof(GatewayGetOperationStatusResponse))] - public class SetAzureVirtualNetworkGatewayIPsecParametersV2 : NetworkCmdletBase + public class SetAzureVirtualNetworkGatewayIPsecParameters : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKey.cs similarity index 96% rename from src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKey.cs index 067c17cf9d46..292d5f3cff1c 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKeyV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVirtualNetworkGatewayKey.cs @@ -18,7 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsCommon.Set, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(SharedKeyContext))] - public class SetAzureVirtualNetworkGatewayKeyV2 : NetworkCmdletBase + public class SetAzureVirtualNetworkGatewayKey : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnostics.cs similarity index 96% rename from src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnostics.cs index 9fff0b337990..b61c181335ce 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StartAzureVirtualNetworkGatewayDiagnostics.cs @@ -20,7 +20,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsLifecycle.Start, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] - public class StartAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + public class StartAzureVirtualNetworkGatewayDiagnostics : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid] diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnostics.cs similarity index 94% rename from src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs rename to src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnostics.cs index 232dc48b906f..74e950bb3310 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnosticsV2.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/StopAzureVirtualNetworkGatewayDiagnostics.cs @@ -19,7 +19,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway { [Cmdlet(VerbsLifecycle.Stop, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))] - public class StopAzureVirtualNetworkGatewayDiagnosticsV2 : NetworkCmdletBase + public class StopAzureVirtualNetworkGatewayDiagnostics : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network gateway Id.")] [ValidateGuid]