Skip to content

Commit dd5eb8e

Browse files
committed
Incorporating Review changes
Remove server side validations from PS
1 parent 66b68b0 commit dd5eb8e

File tree

4 files changed

+1
-80
lines changed

4 files changed

+1
-80
lines changed

src/ResourceManager/Network/Commands.Network/Commands.Network.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
9191
</Reference>
9292
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
93-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.6\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
93+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
9494
<Private>True</Private>
9595
</Reference>
9696
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/Network/Commands.Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -219,27 +219,6 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
219219
}
220220
}
221221

222-
if (this.EnableActiveActiveFeature.IsPresent
223-
&& !vnetGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.HighPerformance)
224-
&& !vnetGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw1)
225-
&& !vnetGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw2)
226-
&& !vnetGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw3))
227-
{
228-
string errorMessage = string.Format(
229-
"Virtual Network Gateway Sku should be one of {0}/{1}/{2}/{3} when Active-Active feature flag is set to True.",
230-
MNM.VirtualNetworkGatewaySkuTier.HighPerformance,
231-
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
232-
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
233-
MNM.VirtualNetworkGatewaySkuTier.VpnGw3);
234-
235-
throw new ArgumentException(errorMessage);
236-
}
237-
238-
if (this.VpnType.Equals(MNM.VpnType.PolicyBased) && !vnetGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.Basic))
239-
{
240-
throw new ArgumentException("Virtual Network Gateway Sku should be " + MNM.VirtualNetworkGatewaySkuTier.Basic + " when VpnType is PolicyBased.");
241-
}
242-
243222
if (this.EnableActiveActiveFeature.IsPresent && !this.VpnType.Equals(MNM.VpnType.RouteBased))
244223
{
245224
throw new ArgumentException("Virtual Network Gateway VpnType should be " + MNM.VpnType.RouteBased + " when Active-Active feature flag is set to True.");

src/ResourceManager/Network/Commands.Network/VirtualNetworkGateway/ResizeAzureVirtualNetworkGatewayCommand.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,6 @@ public override void Execute()
6161
throw new ArgumentException("Current Gateway SKU is same as Resize SKU size:"+ this.GatewaySku + " requested. No need to resize!");
6262
}
6363

64-
if (IsV2Sku(getvirtualnetGateway.Sku.Tier) != IsV2Sku(this.GatewaySku))
65-
{
66-
throw new ArgumentException("Cannot resize gateway from V1 gateway sizes (Default/Standard/HighPerformance) to V2 gateway sizes (VpnGw1/VpnGw2/VpnGw3)");
67-
}
68-
69-
if (this.VirtualNetworkGateway.ActiveActive
70-
&& !GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.HighPerformance)
71-
&& !GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw1)
72-
&& !GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw2)
73-
&& !GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw3))
74-
{
75-
string errorMessage = string.Format(
76-
"Virtual Network Gateway Sku should be one of {0}/{1}/{2}/{3} when Active-Active feature flag is set to True.",
77-
MNM.VirtualNetworkGatewaySkuTier.HighPerformance,
78-
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
79-
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
80-
MNM.VirtualNetworkGatewaySkuTier.VpnGw3);
81-
82-
throw new ArgumentException(errorMessage);
83-
}
84-
8564
this.VirtualNetworkGateway.Sku = new PSVirtualNetworkGatewaySku();
8665
this.VirtualNetworkGateway.Sku.Tier = this.GatewaySku;
8766
this.VirtualNetworkGateway.Sku.Name = this.GatewaySku;
@@ -96,17 +75,5 @@ public override void Execute()
9675

9776
WriteObject(getvirtualnetGateway);
9877
}
99-
100-
private bool IsV2Sku(string gatewaySkuTier)
101-
{
102-
if (gatewaySkuTier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw1, StringComparison.OrdinalIgnoreCase) ||
103-
gatewaySkuTier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw2, StringComparison.OrdinalIgnoreCase) ||
104-
gatewaySkuTier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw3, StringComparison.OrdinalIgnoreCase))
105-
{
106-
return true;
107-
}
108-
109-
return false;
110-
}
11178
}
11279
}

src/ResourceManager/Network/Commands.Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,6 @@ public override void Execute()
118118
this.VirtualNetworkGateway.ActiveActive = false;
119119
}
120120

121-
if (this.VirtualNetworkGateway.ActiveActive)
122-
{
123-
bool activeActiveSkuCriteria =
124-
!string.IsNullOrEmpty(this.GatewaySku) ?
125-
(!this.GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.HighPerformance)
126-
&& !this.GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw1)
127-
&& !this.GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw2)
128-
&& !this.GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw3)) :
129-
(!this.VirtualNetworkGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.HighPerformance)
130-
&& !this.VirtualNetworkGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw1)
131-
&& !this.VirtualNetworkGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw2)
132-
&& !this.VirtualNetworkGateway.Sku.Tier.Equals(MNM.VirtualNetworkGatewaySkuTier.VpnGw3));
133-
134-
if (activeActiveSkuCriteria)
135-
{
136-
string errorMessage = string.Format(
137-
"Virtual Network Gateway Sku should be one of {0}/{1}/{2}/{3} when Active-Active feature flag is set to True.",
138-
MNM.VirtualNetworkGatewaySkuTier.HighPerformance,
139-
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
140-
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
141-
MNM.VirtualNetworkGatewaySkuTier.VpnGw3);
142-
143-
throw new ArgumentException(errorMessage);
144-
}
145-
}
146121

147122
if (!string.IsNullOrEmpty(GatewaySku))
148123
{

0 commit comments

Comments
 (0)