Skip to content

Commit 743109a

Browse files
committed
Merge pull request #450 from Nilambari/dev
WORK:3387747 Added new Brooklyn Co-existance feature Powershell commandlets
2 parents fcbce5d + f97a38c commit 743109a

36 files changed

+1578
-13
lines changed

src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
101101
</Reference>
102102
<Reference Include="Microsoft.WindowsAzure.Management.Network">
103-
<SpecificVersion>False</SpecificVersion>
104-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
103+
<SpecificVersion>False</SpecificVersion>
104+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
105105
</Reference>
106106
<Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
107107
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/Network/Commands.Network.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
1919
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.2.0-preview" targetFramework="net45" />
20-
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.0" targetFramework="net45" />
20+
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.2" targetFramework="net45" />
2121
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2222
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2323
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />

src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
8484
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
8585
</Reference>
86-
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, processorArchitecture=MSIL">
86+
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8787
<SpecificVersion>False</SpecificVersion>
88-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
88+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
8989
</Reference>
9090
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9191
<SpecificVersion>False</SpecificVersion>
@@ -147,6 +147,10 @@
147147
<Compile Include="ApplicationGateway\StartApplicationGateway.cs" />
148148
<Compile Include="ApplicationGateway\StopApplicationGateway.cs" />
149149
<Compile Include="ApplicationGateway\UpdateApplicationGateway.cs" />
150+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayConnection.cs" />
151+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayDiagnostics.cs" />
152+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayIPsecParameters.cs" />
153+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayKey.cs" />
150154
<Compile Include="Gateway\GetAzureVNetConnection.cs" />
151155
<Compile Include="Gateway\GetAzureVNetGateway.cs" />
152156
<Compile Include="Gateway\GetAzureVNetGatewayDiagnostics.cs" />
@@ -157,17 +161,39 @@
157161
<Compile Include="Gateway\Model\SharedKeyContext.cs" />
158162
<Compile Include="Gateway\Model\VirtualNetworkDiagnosticsContext.cs" />
159163
<Compile Include="Gateway\Model\VirtualNetworkGatewayContext.cs" />
164+
<Compile Include="Gateway\Model\GetLocalNetworkGatewayContext.cs" />
165+
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayConnectionContext.cs" />
166+
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayContext.cs" />
167+
<Compile Include="Gateway\Model\LocalNetwrokGatewayContext.cs" />
168+
<Compile Include="Gateway\Model\ValidateGuid.cs" />
169+
<Compile Include="Gateway\NewAzureVirtualNetworkGateway.cs" />
170+
<Compile Include="Gateway\NewAzureVirtualNetworkGatewayConnection.cs" />
160171
<Compile Include="Gateway\NewAzureVNetGateway.cs" />
161172
<Compile Include="Gateway\RemoveAzureVNetGateway.cs" />
162173
<Compile Include="Gateway\RemoveAzureVNetGatewayDefaultSite.cs" />
174+
<Compile Include="Gateway\ResetAzureVirtualNetworkGatewayKey.cs" />
163175
<Compile Include="Gateway\ResetAzureVNetGateway.cs" />
164176
<Compile Include="Gateway\ResizeAzureVNetGateway.cs" />
177+
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayIPsecParameters.cs" />
178+
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayKey.cs" />
165179
<Compile Include="Gateway\SetAzureVNetGateway.cs" />
166180
<Compile Include="Gateway\SetAzureVNetGatewayDefaultSite.cs" />
167181
<Compile Include="Gateway\SetAzureVNetGatewayIPsecParameters.cs" />
168182
<Compile Include="Gateway\SetAzureVNetGatewayKey.cs" />
183+
<Compile Include="Gateway\StartAzureVirtualNetworkGatewayDiagnostics.cs" />
169184
<Compile Include="Gateway\StartAzureVNetGatewayDiagnostics.cs" />
185+
<Compile Include="Gateway\StopAzureVirtualNetworkGatewayDiagnostics.cs" />
170186
<Compile Include="Gateway\StopAzureVNetGatewayDiagnostics.cs" />
187+
<Compile Include="Gateway\GetAzureLocalNetworkGateway.cs" />
188+
<Compile Include="Gateway\GetAzureVirtualNetworkGateway.cs" />
189+
<Compile Include="Gateway\NewAzureLocalNetworkGateway.cs" />
190+
<Compile Include="Gateway\RemoveAzureLocalNetworkGateway.cs" />
191+
<Compile Include="Gateway\RemoveAzureVirtualNetworkGateway.cs" />
192+
<Compile Include="Gateway\RemoveAzureVirtualNetworkGatewayConnection.cs" />
193+
<Compile Include="Gateway\ResetAzureVirtualNetworkGateway.cs" />
194+
<Compile Include="Gateway\ResizeAzureVirtualNetworkGateway.cs" />
195+
<Compile Include="Gateway\UpdateAzureLocalNetworkGateway.cs" />
196+
<Compile Include="Gateway\UpdateAzureVirtualNetworkGatewayConnection.cs" />
171197
<Compile Include="IPForwarding\GetAzureIPForwarding.cs" />
172198
<Compile Include="IPForwarding\Model\IPForwardingState.cs" />
173199
<Compile Include="IPForwarding\SetAzureIPForwarding.cs" />
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureLocalNetworkGateway"), OutputType(typeof(GetLocalNetworkGatewayContext))]
21+
public class GetAzureLocalNetworkGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Local network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
public override void ExecuteCmdlet()
33+
{
34+
if (!string.IsNullOrEmpty(GatewayId))
35+
{
36+
WriteObject(Client.GetLocalNetworkGateway(GatewayId));
37+
}
38+
else
39+
{
40+
WriteObject(Client.ListLocalNetworkGateways());
41+
}
42+
}
43+
}
44+
}

src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.Network.Models;
17+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
1718

1819
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
1920
{
2021
[Cmdlet(VerbsCommon.Get, "AzureVNetGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))]
2122
public class GetAzureVNetGatewayIPsecParameters : NetworkCmdletBase
2223
{
2324
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")]
25+
[ValidateGuid]
2426
[ValidateNotNullOrEmpty]
2527
public string VNetName
2628
{
2729
get; set;
2830
}
2931

3032
[Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")]
33+
[ValidateGuid]
3134
[ValidateNotNullOrEmpty]
3235
public string LocalNetworkSiteName
3336
{
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGateway"), OutputType(typeof(GetVirtualNetworkGatewayContext))]
21+
public class GetAzureVirtualNetworkGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
public override void ExecuteCmdlet()
33+
{
34+
if (!string.IsNullOrEmpty(GatewayId))
35+
{
36+
WriteObject(Client.GetVirtualNetworkGateway(GatewayId));
37+
}
38+
else
39+
{
40+
WriteObject(Client.ListVirtualNetworkGateways());
41+
}
42+
}
43+
}
44+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(GetVirtualNetworkGatewayConnectionContext))]
21+
public class GetAzureVirtualNetworkConnectionGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
[Parameter(Position = 1, Mandatory = false, HelpMessage = "Virtual network gateway Connected entityId.")]
33+
[ValidateGuid]
34+
[ValidateNotNullOrEmpty]
35+
public string ConnectedEntityId
36+
{
37+
get;
38+
set;
39+
}
40+
41+
public override void ExecuteCmdlet()
42+
{
43+
if (!string.IsNullOrEmpty(GatewayId) && !string.IsNullOrEmpty(ConnectedEntityId))
44+
{
45+
WriteObject(Client.GetVirtualNetworkGatewayConnection(GatewayId, ConnectedEntityId));
46+
}
47+
else
48+
{
49+
WriteObject(Client.ListVirtualNetworkGatewayConnections());
50+
}
51+
}
52+
}
53+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
17+
using System.Management.Automation;
18+
19+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
20+
{
21+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayDiagnostics"), OutputType(typeof(ManagementOperationContext))]
22+
public class GetAzureVirtualNetworkGatewayDiagnostics : NetworkCmdletBase
23+
{
24+
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")]
25+
[ValidateGuid]
26+
[ValidateNotNullOrEmpty]
27+
public string GatewayId
28+
{
29+
get;
30+
set;
31+
}
32+
33+
public override void ExecuteCmdlet()
34+
{
35+
WriteObject(Client.GetDiagnosticsV2(GatewayId));
36+
}
37+
}
38+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Management.Automation;
16+
using Microsoft.WindowsAzure.Management.Network.Models;
17+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
18+
19+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
20+
{
21+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))]
22+
public class GetAzureVirtualNetworkGatewayIPsecParameters : NetworkCmdletBase
23+
{
24+
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")]
25+
[ValidateGuid]
26+
[ValidateNotNullOrEmpty]
27+
public string GatewayId
28+
{
29+
get;
30+
set;
31+
}
32+
33+
[Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")]
34+
[ValidateGuid]
35+
[ValidateNotNullOrEmpty]
36+
public string ConnectedEntityId
37+
{
38+
get;
39+
set;
40+
}
41+
42+
public override void ExecuteCmdlet()
43+
{
44+
WriteObject(Client.GetIPsecParametersV2(GatewayId, ConnectedEntityId));
45+
}
46+
}
47+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayKey"), OutputType(typeof(SharedKeyContext))]
21+
public class GetAzureVirtualNetworkGatewayKey : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network gateway id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
[Parameter(Position = 1, Mandatory = true, HelpMessage = "The virtual network gateway connected entityId.")]
33+
[ValidateGuid]
34+
[ValidateNotNullOrEmpty]
35+
public string ConnectedEntityId
36+
{
37+
get;
38+
set;
39+
}
40+
41+
public override void ExecuteCmdlet()
42+
{
43+
WriteObject(Client.GetSharedKeyV2(GatewayId, ConnectedEntityId));
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)