Skip to content
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

WORK:3387747 Added new Brooklyn Co-existance feature Powershell commandlets #450

Merged
merged 4 commits into from
Jun 2, 2015
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 @@ -100,8 +100,8 @@
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.2.0-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.2" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -147,6 +147,10 @@
<Compile Include="ApplicationGateway\StartApplicationGateway.cs" />
<Compile Include="ApplicationGateway\StopApplicationGateway.cs" />
<Compile Include="ApplicationGateway\UpdateApplicationGateway.cs" />
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayConnection.cs" />
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayDiagnostics.cs" />
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayIPsecParameters.cs" />
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayKey.cs" />
<Compile Include="Gateway\GetAzureVNetConnection.cs" />
<Compile Include="Gateway\GetAzureVNetGateway.cs" />
<Compile Include="Gateway\GetAzureVNetGatewayDiagnostics.cs" />
Expand All @@ -157,17 +161,39 @@
<Compile Include="Gateway\Model\SharedKeyContext.cs" />
<Compile Include="Gateway\Model\VirtualNetworkDiagnosticsContext.cs" />
<Compile Include="Gateway\Model\VirtualNetworkGatewayContext.cs" />
<Compile Include="Gateway\Model\GetLocalNetworkGatewayContext.cs" />
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayConnectionContext.cs" />
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayContext.cs" />
<Compile Include="Gateway\Model\LocalNetwrokGatewayContext.cs" />
<Compile Include="Gateway\Model\ValidateGuid.cs" />
<Compile Include="Gateway\NewAzureVirtualNetworkGateway.cs" />
<Compile Include="Gateway\NewAzureVirtualNetworkGatewayConnection.cs" />
<Compile Include="Gateway\NewAzureVNetGateway.cs" />
<Compile Include="Gateway\RemoveAzureVNetGateway.cs" />
<Compile Include="Gateway\RemoveAzureVNetGatewayDefaultSite.cs" />
<Compile Include="Gateway\ResetAzureVirtualNetworkGatewayKey.cs" />
<Compile Include="Gateway\ResetAzureVNetGateway.cs" />
<Compile Include="Gateway\ResizeAzureVNetGateway.cs" />
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayIPsecParameters.cs" />
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayKey.cs" />
<Compile Include="Gateway\SetAzureVNetGateway.cs" />
<Compile Include="Gateway\SetAzureVNetGatewayDefaultSite.cs" />
<Compile Include="Gateway\SetAzureVNetGatewayIPsecParameters.cs" />
<Compile Include="Gateway\SetAzureVNetGatewayKey.cs" />
<Compile Include="Gateway\StartAzureVirtualNetworkGatewayDiagnostics.cs" />
<Compile Include="Gateway\StartAzureVNetGatewayDiagnostics.cs" />
<Compile Include="Gateway\StopAzureVirtualNetworkGatewayDiagnostics.cs" />
<Compile Include="Gateway\StopAzureVNetGatewayDiagnostics.cs" />
<Compile Include="Gateway\GetAzureLocalNetworkGateway.cs" />
<Compile Include="Gateway\GetAzureVirtualNetworkGateway.cs" />
<Compile Include="Gateway\NewAzureLocalNetworkGateway.cs" />
<Compile Include="Gateway\RemoveAzureLocalNetworkGateway.cs" />
<Compile Include="Gateway\RemoveAzureVirtualNetworkGateway.cs" />
<Compile Include="Gateway\RemoveAzureVirtualNetworkGatewayConnection.cs" />
<Compile Include="Gateway\ResetAzureVirtualNetworkGateway.cs" />
<Compile Include="Gateway\ResizeAzureVirtualNetworkGateway.cs" />
<Compile Include="Gateway\UpdateAzureLocalNetworkGateway.cs" />
<Compile Include="Gateway\UpdateAzureVirtualNetworkGatewayConnection.cs" />
<Compile Include="IPForwarding\GetAzureIPForwarding.cs" />
<Compile Include="IPForwarding\Model\IPForwardingState.cs" />
<Compile Include="IPForwarding\SetAzureIPForwarding.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,23 @@

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, "AzureVNetGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))]
public class GetAzureVNetGatewayIPsecParameters : NetworkCmdletBase
{
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")]
[ValidateGuid]
[ValidateNotNullOrEmpty]
public string VNetName
{
get; set;
}

[Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")]
[ValidateGuid]
[ValidateNotNullOrEmpty]
public string LocalNetworkSiteName
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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 GetAzureVirtualNetworkGatewayDiagnostics : 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));
}
}
}
Original file line number Diff line number Diff line change
@@ -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 GetAzureVirtualNetworkGatewayIPsecParameters : 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));
}
}
}
Original file line number Diff line number Diff line change
@@ -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 GetAzureVirtualNetworkGatewayKey : 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));
}
}
}
Loading