Skip to content
Merged

. #20

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
7 changes: 3 additions & 4 deletions setup/azurepowershell.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1

Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "azurepowershell", "azurepowershell.wixproj", "{36D6E303-E057-4963-A093-C7AAE0FD92B3}"
ProjectSection(ProjectDependencies) = postProject
{EA5BD11B-10B3-433D-A250-92AE76669D8D} = {EA5BD11B-10B3-433D-A250-92AE76669D8D}
Expand All @@ -15,10 +16,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.Build.0 = Release|Any CPU
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Debug|Any CPU.ActiveCfg = Debug|x86
{36D6E303-E057-4963-A093-C7AAE0FD92B3}.Release|Any CPU.ActiveCfg = Release|x86
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA5BD11B-10B3-433D-A250-92AE76669D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void TestGetResourcesViaPipingFromAnotherResource()
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestMoveAResourceTest()
{
ResourcesController.NewInstance.RunPsTest("Test-MoveAResource");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public void TestDatabaseDataMaskingPolicyEnablementToggling()
RunPowerShellTest("Test-DatabaseDataMaskingPolicyEnablementToggling");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseDataMaskingLevelChanges()
{
RunPowerShellTest("Test-DatabaseDataMaskingLevelChanges");
Expand Down Expand Up @@ -63,9 +62,8 @@ public void TestDatabaseDataMaskingTextRuleLifecycle()
RunPowerShellTest("Test-DatabaseDataMaskingTextRuleLifecycle");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseDataMaskingRuleCreationFailures()
{
RunPowerShellTest("Test-DatabaseDataMaskingRuleCreationFailures");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ public void TestDatabaseUpdatePolicyWithStorage()
RunPowerShellTest("Test-DatabaseUpdatePolicyWithStorage");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerUpdatePolicyWithStorage()
{
RunPowerShellTest("Test-ServerUpdatePolicyWithStorage");
}

[Fact(Skip = "Test executes for long time period")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Fact]
public void TestDatabaseUpdatePolicyWithEventTypes()
{
RunPowerShellTest("Test-DatabaseUpdatePolicyWithEventTypes");
}

[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerUpdatePolicyWithEventTypes()
{
RunPowerShellTest("Test-ServerUpdatePolicyWithEventTypes");
Expand Down Expand Up @@ -184,33 +181,29 @@ public void TestServerStorageKeyRotation()
RunPowerShellTest("Test-ServerStorageKeyRotation");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerUpdatePolicyWithRetention()
{
RunPowerShellTest("Test-ServerUpdatePolicyWithRetention");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseUpdatePolicyWithRetention()
{
RunPowerShellTest("Test-DatabaseUpdatePolicyWithRetention");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerRetentionKeepProperties()
{
RunPowerShellTest("Test-ServerRetentionKeepProperties");
}

[Fact(Skip = "Test executes for long time period")]
[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseRetentionKeepProperties()
{
RunPowerShellTest("Test-DatabaseRetentionKeepProperties");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.WindowsAzure.Commands.ExpressRoute
{
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
using System.Collections.Generic;
using System.Management.Automation;

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

public override void ExecuteCmdlet()
{
if (!string.IsNullOrEmpty(ServiceKey))
if (ServiceKey != Guid.Empty)
{
GetByServiceKey();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
using System.ComponentModel;
using System.Management.Automation;
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
using System;

namespace Microsoft.WindowsAzure.Commands.ExpressRoute
{

[Cmdlet(VerbsCommon.Get, "AzureBGPPeering"), OutputType(typeof(AzureBgpPeering))]
public class GetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
HelpMessage = "Service Key representing the Azure Circuit")]
[ValidateGuid]
[ValidateNotNullOrEmpty]
public string ServiceKey { get; set; }
public Guid ServiceKey { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
[DefaultValue("Private")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
public class NewAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
[ValidateGuid]
public Guid ServiceKey { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
[ValidateNotNullOrEmpty]
public string ServiceKey { get; set; }
public string AdvertisedPublicPrefixes { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Customer AS number")]
public UInt32 CustomerAsn { get; set; }

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

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Routing Registry Name for Prefix Validation")]
public string RoutingRegistryName { get; set; }

[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Secondary Peer Subnet")]
[ValidateNotNullOrEmpty]
public string SecondaryPeerSubnet { get; set; }
Expand All @@ -46,14 +54,14 @@ public class NewAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Vlan Id")]
public UInt32 VlanId { get; set; }

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

public override void ExecuteCmdlet()
{
var route = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, PeerAsn, PrimaryPeerSubnet,
SecondaryPeerSubnet, VlanId, AccessType, SharedKey);
var route = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, AdvertisedPublicPrefixes, CustomerAsn, PeerAsn,
PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId, AccessType, SharedKey);
WriteObject(route);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public class RemoveAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
HelpMessage = "Service Key associated with the Azure BGP Peering to be removed")]
[ValidateGuid]
[ValidateNotNullOrEmpty]
public string ServiceKey { get; set; }
public Guid ServiceKey { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Bgp Peering Access Type: Public or Private")]
[DefaultValue("Private")]
Expand All @@ -45,7 +43,7 @@ public override void ExecuteCmdlet()
Force.IsPresent,
string.Format(Resources.RemoveAzureBGPPeeringWarning, ServiceKey),
Resources.RemoveAzureBGPPeeringMessage,
ServiceKey,
ServiceKey.ToString(),
() =>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@

namespace Microsoft.WindowsAzure.Commands.ExpressRoute
{

[Cmdlet(VerbsCommon.Set, "AzureBGPPeering"), OutputType(typeof(AzureBgpPeering))]
public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
[ValidateGuid]
public Guid ServiceKey { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
[ValidateNotNullOrEmpty]
public string ServiceKey { get; set; }
public string AdvertisedPublicPrefixes;

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Customer AS number")]
public UInt32 CustomerAsn { get; set; }

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

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Routing Registry Name for Prefix Validation")]
public string RoutingRegistryName { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Secondary Peer Subnet")]
[ValidateNotNullOrEmpty]
public string SecondaryPeerSubnet { get; set; }
Expand All @@ -47,7 +56,7 @@ public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Vlan Id")]
public UInt32? VlanId { get; set; }

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

Expand All @@ -56,8 +65,8 @@ public override void ExecuteCmdlet()
try
{
var route = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, AccessType);
var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, AccessType,
PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet ?? route.PrimaryPeerSubnet,
var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, AccessType, CustomerAsn,
PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet ?? route.PrimaryPeerSubnet, RoutingRegistryName,
SecondaryPeerSubnet ?? route.SecondaryPeerSubnet, VlanId.HasValue ? VlanId.Value : route.VlanId,
SharedKey);
WriteObject(updatedRoute, false);
Expand All @@ -84,8 +93,9 @@ public override void ExecuteCmdlet()
throw new ArgumentException(Resources.SecondaryPeerSubnetRequired);
}

var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, PeerAsn.Value, PrimaryPeerSubnet,
SecondaryPeerSubnet, VlanId.Value, AccessType, SharedKey);
var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, AdvertisedPublicPrefixes, CustomerAsn,
PeerAsn.Value, PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId.Value, AccessType,
SharedKey);
WriteObject(newRoute);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
<Compile Include="BgpPeerings\NewAzureBGPPeering.cs" />
<Compile Include="BgpPeerings\RemoveAzureBGPPeering.cs" />
<Compile Include="BgpPeerings\SetAzureBGPPeering.cs" />
<Compile Include="CrossConnections\GetAzureCrossConnection.cs" />
<Compile Include="CrossConnections\NewAzureCrossConnections.cs" />
<Compile Include="CrossConnections\SetAzureCrossConnection.cs" />
<Compile Include="DedicatedCircuitLinkAuthorizationMicrosoftIds\NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs" />
<Compile Include="DedicatedCircuitLinkAuthorizationMicrosoftIds\RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs" />
<Compile Include="DedicatedCircuitLinkAuthorizations\GetAzureDedicatedCircuitLinkAuthorization.cs" />
Expand All @@ -144,7 +147,6 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Model\ValidateGuid.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="ExpressRoute.psd1">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Management.Automation;
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;

namespace Microsoft.WindowsAzure.Commands.ExpressRoute
{
using System;

[Cmdlet(VerbsCommon.Get, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection), typeof(IEnumerable<AzureCrossConnection>))]
public class GetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
{
[Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Service Key representing the Dedicated Circuit")]
public Guid ServiceKey { get; set; }

public override void ExecuteCmdlet()
{
if(ServiceKey != Guid.Empty)
{
GetByServiceKey();
}
else
{
GetNoServiceKey();
}
}

private void GetByServiceKey()
{
var crossConnection = ExpressRouteClient.GetAzureCrossConnection(ServiceKey);
WriteObject(crossConnection);
}

private void GetNoServiceKey()
{
var crossConnections = ExpressRouteClient.ListAzureCrossConnections();
WriteObject(crossConnections, true);
}
}
}

Loading