Skip to content

Commit ed6cbfe

Browse files
committed
Merge pull request #20 from Azure/dev
.
2 parents 443f614 + 0513a42 commit ed6cbfe

32 files changed

+355
-212
lines changed

setup/azurepowershell.sln

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
33
VisualStudioVersion = 12.0.30110.0
44
MinimumVisualStudioVersion = 10.0.40219.1
5+
56
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "azurepowershell", "azurepowershell.wixproj", "{36D6E303-E057-4963-A093-C7AAE0FD92B3}"
67
ProjectSection(ProjectDependencies) = postProject
78
{EA5BD11B-10B3-433D-A250-92AE76669D8D} = {EA5BD11B-10B3-433D-A250-92AE76669D8D}
@@ -15,10 +16,8 @@ Global
1516
Release|Any CPU = Release|Any CPU
1617
EndGlobalSection
1718
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18-
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19-
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
20-
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
21-
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.ActiveCfg = Debug|x86
20+
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.ActiveCfg = Release|x86
2221
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2322
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
2423
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public void TestGetResourcesViaPipingFromAnotherResource()
7777
}
7878

7979
[Fact]
80-
[Trait(Category.AcceptanceType, Category.CheckIn)]
8180
public void TestMoveAResourceTest()
8281
{
8382
ResourcesController.NewInstance.RunPsTest("Test-MoveAResource");

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ public void TestDatabaseDataMaskingPolicyEnablementToggling()
2727
RunPowerShellTest("Test-DatabaseDataMaskingPolicyEnablementToggling");
2828
}
2929

30-
[Fact(Skip = "Test executes for long time period")]
30+
[Fact]
3131
[Trait(Category.RunType, Category.LiveOnly)]
32-
[Trait(Category.AcceptanceType, Category.CheckIn)]
3332
public void TestDatabaseDataMaskingLevelChanges()
3433
{
3534
RunPowerShellTest("Test-DatabaseDataMaskingLevelChanges");
@@ -63,9 +62,8 @@ public void TestDatabaseDataMaskingTextRuleLifecycle()
6362
RunPowerShellTest("Test-DatabaseDataMaskingTextRuleLifecycle");
6463
}
6564

66-
[Fact(Skip = "Test executes for long time period")]
65+
[Fact]
6766
[Trait(Category.RunType, Category.LiveOnly)]
68-
[Trait(Category.AcceptanceType, Category.CheckIn)]
6967
public void TestDatabaseDataMaskingRuleCreationFailures()
7068
{
7169
RunPowerShellTest("Test-DatabaseDataMaskingRuleCreationFailures");

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,21 @@ public void TestDatabaseUpdatePolicyWithStorage()
2626
RunPowerShellTest("Test-DatabaseUpdatePolicyWithStorage");
2727
}
2828

29-
[Fact(Skip = "Test executes for long time period")]
29+
[Fact]
3030
[Trait(Category.RunType, Category.LiveOnly)]
31-
[Trait(Category.AcceptanceType, Category.CheckIn)]
3231
public void TestServerUpdatePolicyWithStorage()
3332
{
3433
RunPowerShellTest("Test-ServerUpdatePolicyWithStorage");
3534
}
3635

37-
[Fact(Skip = "Test executes for long time period")]
38-
[Trait(Category.AcceptanceType, Category.CheckIn)]
36+
[Fact]
3937
public void TestDatabaseUpdatePolicyWithEventTypes()
4038
{
4139
RunPowerShellTest("Test-DatabaseUpdatePolicyWithEventTypes");
4240
}
4341

44-
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
42+
[Fact]
4543
[Trait(Category.RunType, Category.LiveOnly)]
46-
[Trait(Category.AcceptanceType, Category.CheckIn)]
4744
public void TestServerUpdatePolicyWithEventTypes()
4845
{
4946
RunPowerShellTest("Test-ServerUpdatePolicyWithEventTypes");
@@ -184,33 +181,29 @@ public void TestServerStorageKeyRotation()
184181
RunPowerShellTest("Test-ServerStorageKeyRotation");
185182
}
186183

187-
[Fact(Skip = "Test executes for long time period")]
184+
[Fact]
188185
[Trait(Category.RunType, Category.LiveOnly)]
189-
[Trait(Category.AcceptanceType, Category.CheckIn)]
190186
public void TestServerUpdatePolicyWithRetention()
191187
{
192188
RunPowerShellTest("Test-ServerUpdatePolicyWithRetention");
193189
}
194190

195-
[Fact(Skip = "Test executes for long time period")]
191+
[Fact]
196192
[Trait(Category.RunType, Category.LiveOnly)]
197-
[Trait(Category.AcceptanceType, Category.CheckIn)]
198193
public void TestDatabaseUpdatePolicyWithRetention()
199194
{
200195
RunPowerShellTest("Test-DatabaseUpdatePolicyWithRetention");
201196
}
202197

203-
[Fact(Skip = "Test executes for long time period")]
198+
[Fact]
204199
[Trait(Category.RunType, Category.LiveOnly)]
205-
[Trait(Category.AcceptanceType, Category.CheckIn)]
206200
public void TestServerRetentionKeepProperties()
207201
{
208202
RunPowerShellTest("Test-ServerRetentionKeepProperties");
209203
}
210204

211-
[Fact(Skip = "Test executes for long time period")]
205+
[Fact]
212206
[Trait(Category.RunType, Category.LiveOnly)]
213-
[Trait(Category.AcceptanceType, Category.CheckIn)]
214207
public void TestDatabaseRetentionKeepProperties()
215208
{
216209
RunPowerShellTest("Test-DatabaseRetentionKeepProperties");

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/AuthorizedDedicatedCircuits/GetAzureAuthorizedDedicatedCircuit.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System;
16+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System.Collections.Generic;
18+
using System.Management.Automation;
1519

1620
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1721
{
18-
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
19-
using System.Collections.Generic;
20-
using System.Management.Automation;
2122

2223
[Cmdlet(VerbsCommon.Get, "AzureAuthorizedDedicatedCircuit"), OutputType(typeof(AzureAuthorizedDedicatedCircuit), typeof(IEnumerable<AzureAuthorizedDedicatedCircuit>))]
2324
public class GetAzureAuthorizedDedicatedCircuitCommand : ExpressRouteBaseCmdlet
2425
{
2526
[Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true,
2627
HelpMessage = "Service Key representing the Dedicated Circuit")]
27-
[ValidateGuid]
28-
[ValidateNotNullOrEmpty]
29-
public string ServiceKey { get; set; }
28+
public Guid ServiceKey { get; set; }
3029

3130
public override void ExecuteCmdlet()
3231
{
33-
if (!string.IsNullOrEmpty(ServiceKey))
32+
if (ServiceKey != Guid.Empty)
3433
{
3534
GetByServiceKey();
3635
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/GetAzureBGPPeering.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
using System.ComponentModel;
1616
using System.Management.Automation;
1717
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
18+
using System;
1819

1920
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2021
{
22+
2123
[Cmdlet(VerbsCommon.Get, "AzureBGPPeering"), OutputType(typeof(AzureBgpPeering))]
2224
public class GetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
2325
{
2426
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2527
HelpMessage = "Service Key representing the Azure Circuit")]
26-
[ValidateGuid]
27-
[ValidateNotNullOrEmpty]
28-
public string ServiceKey { get; set; }
28+
public Guid ServiceKey { get; set; }
2929

3030
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
3131
[DefaultValue("Private")]

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/NewAzureBGPPeering.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2323
public class NewAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
2424
{
2525
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
26-
[ValidateGuid]
26+
public Guid ServiceKey { get; set; }
27+
28+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
2729
[ValidateNotNullOrEmpty]
28-
public string ServiceKey { get; set; }
30+
public string AdvertisedPublicPrefixes { get; set; }
31+
32+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Customer AS number")]
33+
public UInt32 CustomerAsn { get; set; }
2934

3035
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
3136
HelpMessage = "Peer Asn")]
@@ -35,6 +40,9 @@ public class NewAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
3540
[ValidateNotNullOrEmpty]
3641
public string PrimaryPeerSubnet { get; set; }
3742

43+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Routing Registry Name for Prefix Validation")]
44+
public string RoutingRegistryName { get; set; }
45+
3846
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Secondary Peer Subnet")]
3947
[ValidateNotNullOrEmpty]
4048
public string SecondaryPeerSubnet { get; set; }
@@ -46,14 +54,14 @@ public class NewAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
4654
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Vlan Id")]
4755
public UInt32 VlanId { get; set; }
4856

49-
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
57+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Microsoft, Public or Private")]
5058
[DefaultValue("Private")]
5159
public BgpPeeringAccessType AccessType { get; set; }
5260

5361
public override void ExecuteCmdlet()
5462
{
55-
var route = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, PeerAsn, PrimaryPeerSubnet,
56-
SecondaryPeerSubnet, VlanId, AccessType, SharedKey);
63+
var route = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, AdvertisedPublicPrefixes, CustomerAsn, PeerAsn,
64+
PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId, AccessType, SharedKey);
5765
WriteObject(route);
5866
}
5967
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/RemoveAzureBGPPeering.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public class RemoveAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
2525
{
2626
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2727
HelpMessage = "Service Key associated with the Azure BGP Peering to be removed")]
28-
[ValidateGuid]
29-
[ValidateNotNullOrEmpty]
30-
public string ServiceKey { get; set; }
28+
public Guid ServiceKey { get; set; }
3129

3230
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
3331
[DefaultValue("Private")]
@@ -45,7 +43,7 @@ public override void ExecuteCmdlet()
4543
Force.IsPresent,
4644
string.Format(Resources.RemoveAzureBGPPeeringWarning, ServiceKey),
4745
Resources.RemoveAzureBGPPeeringMessage,
48-
ServiceKey,
46+
ServiceKey.ToString(),
4947
() =>
5048
{
5149

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/SetAzureBGPPeering.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@
2020

2121
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2222
{
23+
2324
[Cmdlet(VerbsCommon.Set, "AzureBGPPeering"), OutputType(typeof(AzureBgpPeering))]
2425
public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
2526
{
2627
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
27-
[ValidateGuid]
28+
public Guid ServiceKey { get; set; }
29+
30+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
2831
[ValidateNotNullOrEmpty]
29-
public string ServiceKey { get; set; }
32+
public string AdvertisedPublicPrefixes;
33+
34+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Customer AS number")]
35+
public UInt32 CustomerAsn { get; set; }
3036

3137
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
3238
HelpMessage = "Peer Asn")]
@@ -36,6 +42,9 @@ public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
3642
[ValidateNotNullOrEmpty]
3743
public string PrimaryPeerSubnet { get; set; }
3844

45+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Routing Registry Name for Prefix Validation")]
46+
public string RoutingRegistryName { get; set; }
47+
3948
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Secondary Peer Subnet")]
4049
[ValidateNotNullOrEmpty]
4150
public string SecondaryPeerSubnet { get; set; }
@@ -47,7 +56,7 @@ public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
4756
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Vlan Id")]
4857
public UInt32? VlanId { get; set; }
4958

50-
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
59+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Microsoft, Public or Private")]
5160
[DefaultValue("Private")]
5261
public BgpPeeringAccessType AccessType { get; set; }
5362

@@ -56,8 +65,8 @@ public override void ExecuteCmdlet()
5665
try
5766
{
5867
var route = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, AccessType);
59-
var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, AccessType,
60-
PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet ?? route.PrimaryPeerSubnet,
68+
var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, AccessType, CustomerAsn,
69+
PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet ?? route.PrimaryPeerSubnet, RoutingRegistryName,
6170
SecondaryPeerSubnet ?? route.SecondaryPeerSubnet, VlanId.HasValue ? VlanId.Value : route.VlanId,
6271
SharedKey);
6372
WriteObject(updatedRoute, false);
@@ -84,8 +93,9 @@ public override void ExecuteCmdlet()
8493
throw new ArgumentException(Resources.SecondaryPeerSubnetRequired);
8594
}
8695

87-
var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, PeerAsn.Value, PrimaryPeerSubnet,
88-
SecondaryPeerSubnet, VlanId.Value, AccessType, SharedKey);
96+
var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, AdvertisedPublicPrefixes, CustomerAsn,
97+
PeerAsn.Value, PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId.Value, AccessType,
98+
SharedKey);
8999
WriteObject(newRoute);
90100
}
91101
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
<Compile Include="BgpPeerings\NewAzureBGPPeering.cs" />
123123
<Compile Include="BgpPeerings\RemoveAzureBGPPeering.cs" />
124124
<Compile Include="BgpPeerings\SetAzureBGPPeering.cs" />
125+
<Compile Include="CrossConnections\GetAzureCrossConnection.cs" />
126+
<Compile Include="CrossConnections\NewAzureCrossConnections.cs" />
127+
<Compile Include="CrossConnections\SetAzureCrossConnection.cs" />
125128
<Compile Include="DedicatedCircuitLinkAuthorizationMicrosoftIds\NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs" />
126129
<Compile Include="DedicatedCircuitLinkAuthorizationMicrosoftIds\RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs" />
127130
<Compile Include="DedicatedCircuitLinkAuthorizations\GetAzureDedicatedCircuitLinkAuthorization.cs" />
@@ -144,7 +147,6 @@
144147
<AutoGen>True</AutoGen>
145148
<DesignTime>True</DesignTime>
146149
</Compile>
147-
<Compile Include="Model\ValidateGuid.cs" />
148150
</ItemGroup>
149151
<ItemGroup>
150152
<Content Include="ExpressRoute.psd1">
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
16+
using System.Collections.Generic;
17+
using System.Management.Automation;
18+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
19+
20+
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
21+
{
22+
using System;
23+
24+
[Cmdlet(VerbsCommon.Get, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection), typeof(IEnumerable<AzureCrossConnection>))]
25+
public class GetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
26+
{
27+
[Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true,
28+
HelpMessage = "Service Key representing the Dedicated Circuit")]
29+
public Guid ServiceKey { get; set; }
30+
31+
public override void ExecuteCmdlet()
32+
{
33+
if(ServiceKey != Guid.Empty)
34+
{
35+
GetByServiceKey();
36+
}
37+
else
38+
{
39+
GetNoServiceKey();
40+
}
41+
}
42+
43+
private void GetByServiceKey()
44+
{
45+
var crossConnection = ExpressRouteClient.GetAzureCrossConnection(ServiceKey);
46+
WriteObject(crossConnection);
47+
}
48+
49+
private void GetNoServiceKey()
50+
{
51+
var crossConnections = ExpressRouteClient.ListAzureCrossConnections();
52+
WriteObject(crossConnections, true);
53+
}
54+
}
55+
}
56+

0 commit comments

Comments
 (0)