Skip to content

[Release 1.5.0] Fix virtual network gateway creation #2360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void TestVirtualNetworkExpressRouteGatewayCRUD()
}


[Fact(Skip = "Rerecord tests")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualNetworkGatewayCRUD()
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
<Compile Include="RouteTable\Route\RemoveAzureRouteConfigCommand.cs" />
<Compile Include="RouteTable\Route\SetAzureRouteConfigCommand.cs" />
<Compile Include="RouteTable\SetAzureRouteTableCommand.cs" />
<Compile Include="VirtualNetworkGateway\AzureVirtualNetworkGatewayIpConfigBase.cs" />
<Compile Include="VirtualNetworkGateway\ChildResourceHelp.cs" />
<Compile Include="VirtualNetworkGateway\VirtualNetworkGatewayBaseCmdlet.cs" />
<Compile Include="VirtualNetworkGateway\GetAzureVirtualNetworkGatewayCommand.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// ----------------------------------------------------------------------------------
//
// 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.Commands.Network.Models;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Network
{
public class AzureVirtualNetworkGatewayIpConfigBase : NetworkBaseCmdlet
{
[Parameter(
Mandatory = false,
HelpMessage = "The name of the FrontendIpConfiguration")]
[ValidateNotNullOrEmpty]
public virtual string Name { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The private ip address of the frontendIpConfiguration " +
"if static allocation is specified.")]
public string PrivateIpAddress { get; set; }

[Parameter(
ParameterSetName = "SetByResourceId",
HelpMessage = "SubnetId")]
[ValidateNotNullOrEmpty]
public string SubnetId { get; set; }

[Parameter(
ParameterSetName = "SetByResource",
HelpMessage = "Subnet")]
public PSSubnet Subnet { get; set; }

[Parameter(
ParameterSetName = "SetByResourceId",
HelpMessage = "PublicIpAddressId")]
public string PublicIpAddressId { get; set; }

[Parameter(
ParameterSetName = "SetByResource",
HelpMessage = "PublicIpAddress")]
public PSPublicIpAddress PublicIpAddress { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

if (string.Equals(ParameterSetName, Microsoft.Azure.Commands.Network.Properties.Resources.SetByResource))
{
if (this.Subnet != null)
{
this.SubnetId = this.Subnet.Id;
}

if (this.PublicIpAddress != null)
{
this.PublicIpAddressId = this.PublicIpAddress.Id;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace Microsoft.Azure.Commands.Network
{
[Cmdlet(VerbsCommon.New, "AzureRmVirtualNetworkGatewayIpConfig"), OutputType(typeof(PSVirtualNetworkGatewayIpConfiguration))]
public class NewAzureVirtualNetworkGatewayIpConfigCommand : AzureLoadBalancerFrontendIpConfigBase
public class NewAzureVirtualNetworkGatewayIpConfigCommand : AzureVirtualNetworkGatewayIpConfigBase
{
[Parameter(
Mandatory = true,
Expand Down