diff --git a/setup/azurepowershell.sln b/setup/azurepowershell.sln index a5d4bc722dc8..8af1a5339b5b 100644 --- a/setup/azurepowershell.sln +++ b/setup/azurepowershell.sln @@ -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} @@ -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 diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs index c379bed1874d..b57653da05ea 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs +++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs @@ -77,7 +77,6 @@ public void TestGetResourcesViaPipingFromAnotherResource() } [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] public void TestMoveAResourceTest() { ResourcesController.NewInstance.RunPsTest("Test-MoveAResource"); diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs index 19bfca80a5bc..d1f53b053566 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs @@ -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"); @@ -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"); diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs index b4a6cc906d87..40ec5b7ed611 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs @@ -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"); @@ -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"); diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/AuthorizedDedicatedCircuits/GetAzureAuthorizedDedicatedCircuit.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/AuthorizedDedicatedCircuits/GetAzureAuthorizedDedicatedCircuit.cs index 7b70895acd0b..b3e2f08f258e 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/AuthorizedDedicatedCircuits/GetAzureAuthorizedDedicatedCircuit.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/AuthorizedDedicatedCircuits/GetAzureAuthorizedDedicatedCircuit.cs @@ -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))] 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(); } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/GetAzureBGPPeering.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/GetAzureBGPPeering.cs index 48d26f623267..b4dd9f1a5e1e 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/GetAzureBGPPeering.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/GetAzureBGPPeering.cs @@ -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")] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/NewAzureBGPPeering.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/NewAzureBGPPeering.cs index 0735add9bb3a..a0ce990977e6 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/NewAzureBGPPeering.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/NewAzureBGPPeering.cs @@ -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")] @@ -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; } @@ -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); } } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/RemoveAzureBGPPeering.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/RemoveAzureBGPPeering.cs index 4b5ecc57aaf0..8b2184186a81 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/RemoveAzureBGPPeering.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/RemoveAzureBGPPeering.cs @@ -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")] @@ -45,7 +43,7 @@ public override void ExecuteCmdlet() Force.IsPresent, string.Format(Resources.RemoveAzureBGPPeeringWarning, ServiceKey), Resources.RemoveAzureBGPPeeringMessage, - ServiceKey, + ServiceKey.ToString(), () => { diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/SetAzureBGPPeering.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/SetAzureBGPPeering.cs index 085123494a51..56d76cab4efe 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/SetAzureBGPPeering.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/BgpPeerings/SetAzureBGPPeering.cs @@ -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")] @@ -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; } @@ -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; } @@ -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); @@ -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); } } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj index 206043d36f53..89d45187b980 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj @@ -122,6 +122,9 @@ + + + @@ -144,7 +147,6 @@ True True - diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/GetAzureCrossConnection.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/GetAzureCrossConnection.cs new file mode 100644 index 000000000000..8e86113c7d7c --- /dev/null +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/GetAzureCrossConnection.cs @@ -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))] + 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); + } + } +} + diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/NewAzureCrossConnections.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/NewAzureCrossConnections.cs new file mode 100644 index 000000000000..a9cb80c6d980 --- /dev/null +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/NewAzureCrossConnections.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------------- +// +// 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; +using System.Management.Automation; +using Microsoft.WindowsAzure.Commands.ExpressRoute.Properties; +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; + +namespace Microsoft.WindowsAzure.Commands.ExpressRoute +{ + [Cmdlet(VerbsCommon.New, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection))] + public class NewAzureCrossConnectionCommand : ExpressRouteBaseCmdlet + { + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, + HelpMessage = "Dedicated Circuit Service Key")] + public Guid ServiceKey { get; set; } + + [Parameter(HelpMessage = "Do not confirm Azure Cross Connection creation")] + public SwitchParameter Force { get; set; } + + public override void ExecuteCmdlet() + { + ConfirmAction( + Force.IsPresent, + string.Format(Resources.NewAzureCrossConnectionWarning, ServiceKey), + string.Format(Resources.NewAzureCrossConnectionMessage, ServiceKey), + ServiceKey.ToString(), + () => + { + var crossConnection = ExpressRouteClient.NewAzureCrossConnection(ServiceKey); + WriteVerboseWithTimestamp(Resources.NewAzureCrossConnectionSucceeded); + WriteObject(crossConnection); + }); + + } + } +} diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/SetAzureCrossConnection.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/SetAzureCrossConnection.cs new file mode 100644 index 000000000000..2c161e80ff8f --- /dev/null +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/SetAzureCrossConnection.cs @@ -0,0 +1,49 @@ +// ---------------------------------------------------------------------------------- +// +// 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; +using System.ComponentModel; +using System.Management.Automation; +using Microsoft.WindowsAzure.Commands.ExpressRoute.Properties; +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; + +namespace Microsoft.WindowsAzure.Commands.ExpressRoute +{ + + [Cmdlet(VerbsCommon.Set, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection))] + public class SetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet + { + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")] + public Guid ServiceKey { get; set; } + + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Notification Operation to perform. NotifyCrossConnectionProvisioned or NotifyCrossConnectionNotProvisioned")] + [ValidateNotNullOrEmpty] + public UpdateCrossConnectionOperation Operation { get; set; } + + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Provisioning Error Message")] + public string ProvisioningError { get; set; } + + [Parameter(Mandatory = false)] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteCmdlet() + { + var crossConnection = ExpressRouteClient.SetAzureCrossConnection(ServiceKey, new CrossConnectionUpdateParameters() {Operation = Operation, ProvisioningError = ProvisioningError}); + if(PassThru.IsPresent) + { + WriteObject(crossConnection); + } + } + } +} diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs index 02d621b27106..2e066a66c95f 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs @@ -12,24 +12,22 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using System; +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System.Management.Automation; + namespace Microsoft.WindowsAzure.Commands.ExpressRoute { - using Microsoft.WindowsAzure.Management.ExpressRoute.Models; - using System.Management.Automation; - + [Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLinkAuthorizationMicrosoftIds")] public class NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIdsCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string AuthorizationId { get; set; } + public Guid AuthorizationId { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Microsoft Ids to be removed")] public string MicrosoftIds { get; set; } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs index bb3a59de7f01..106a59bcf581 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs @@ -12,24 +12,22 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using System; +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System.Management.Automation; + namespace Microsoft.WindowsAzure.Commands.ExpressRoute { - using Microsoft.WindowsAzure.Management.ExpressRoute.Models; - using System.Management.Automation; - + [Cmdlet(VerbsCommon.Remove, "AzureDedicatedCircuitLinkAuthorizationMicrosoftIds")] public class RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIdsCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string AuthorizationId { get; set; } + public Guid AuthorizationId { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Microsoft Ids to be removed")] public string MicrosoftIds { get; set; } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/GetAzureDedicatedCircuitLinkAuthorization.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/GetAzureDedicatedCircuitLinkAuthorization.cs index 85312f21bc55..1429ab7ffd21 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/GetAzureDedicatedCircuitLinkAuthorization.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/GetAzureDedicatedCircuitLinkAuthorization.cs @@ -12,29 +12,26 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using System; +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System.Management.Automation; + namespace Microsoft.WindowsAzure.Commands.ExpressRoute { - using Microsoft.WindowsAzure.Management.ExpressRoute.Models; - using System.Management.Automation; - [Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(AzureDedicatedCircuitLinkAuthorization))] public class GetAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing the Azure Dedicated Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string AuthorizationId { get; set; } + public Guid AuthorizationId { get; set; } public override void ExecuteCmdlet() { - if (!string.IsNullOrEmpty(AuthorizationId)) + if (AuthorizationId != Guid.Empty) { GetByAuthorizationId(); } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/NewAzureDedicatedCircuitLinkAuthorization.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/NewAzureDedicatedCircuitLinkAuthorization.cs index 9b38f1f2a4e2..a2fa064b47e3 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/NewAzureDedicatedCircuitLinkAuthorization.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/NewAzureDedicatedCircuitLinkAuthorization.cs @@ -12,19 +12,18 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System.Management.Automation; +using System; namespace Microsoft.WindowsAzure.Commands.ExpressRoute { - using Microsoft.WindowsAzure.Management.ExpressRoute.Models; - using System.Management.Automation; [Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(AzureDedicatedCircuitLinkAuthorization))] public class NewAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Description")] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/RemoveAzureDedicatedCircuitLinkAuthorization.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/RemoveAzureDedicatedCircuitLinkAuthorization.cs index 57a89ac34939..3b7c800ea2d9 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/RemoveAzureDedicatedCircuitLinkAuthorization.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/RemoveAzureDedicatedCircuitLinkAuthorization.cs @@ -23,15 +23,11 @@ public class RemoveAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteB { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key for the Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string AuthorizationId { get; set; } + public Guid AuthorizationId { get; set; } [Parameter(HelpMessage = "Do not confirm")] public SwitchParameter Force { get; set; } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/SetAzureDedicatedCircuitLinkAuthorization.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/SetAzureDedicatedCircuitLinkAuthorization.cs index 5f328865ef74..1e0a1332003d 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/SetAzureDedicatedCircuitLinkAuthorization.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/SetAzureDedicatedCircuitLinkAuthorization.cs @@ -12,24 +12,22 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using System; +using System.Management.Automation; + namespace Microsoft.WindowsAzure.Commands.ExpressRoute { - using System.Management.Automation; [Cmdlet(VerbsCommon.Set, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(bool))] public class SetAzureDedicatedCircuitLinkAuthorizationAuthorizationCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key for the Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string AuthorizationId { get; set; } + public Guid AuthorizationId { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Description")] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/GetAzureDedicatedCircuitLink.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/GetAzureDedicatedCircuitLink.cs index 03e0fd0a9073..fc057bcf01ba 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/GetAzureDedicatedCircuitLink.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/GetAzureDedicatedCircuitLink.cs @@ -14,17 +14,17 @@ using System.Management.Automation; using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System; namespace Microsoft.WindowsAzure.Commands.ExpressRoute { + [Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitLink"), OutputType(typeof(AzureDedicatedCircuitLink))] public class GetAzureDedicatedCircuitLinkCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing the Azure Dedicated Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Vnet Name")] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/NewAzureDedicatedCircuitLink.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/NewAzureDedicatedCircuitLink.cs index dcc00c943938..212ec2e62b60 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/NewAzureDedicatedCircuitLink.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/NewAzureDedicatedCircuitLink.cs @@ -14,17 +14,17 @@ using System.Management.Automation; using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System; namespace Microsoft.WindowsAzure.Commands.ExpressRoute { + [Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLink"), OutputType(typeof(AzureDedicatedCircuitLink))] public class NewAzureDedicatedCircuitLinkCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Virtual Network Name")] [ValidateNotNullOrEmpty] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/RemoveAzureDedicatedCircuitLink.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/RemoveAzureDedicatedCircuitLink.cs index 2dc790d26043..b6c892b357c1 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/RemoveAzureDedicatedCircuitLink.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/RemoveAzureDedicatedCircuitLink.cs @@ -23,9 +23,7 @@ public class RemoveAzureDedicatedCircuitLinkCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key for the Azure Circuit Vnet Mapping to be removed")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Virtual Network Name for the Azure Circuit Vnet Mapping to be removed")] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitProperties/SetAzureDedicatedCircuitProperties.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitProperties/SetAzureDedicatedCircuitProperties.cs index cdb5c7af687b..ebd773f46c3c 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitProperties/SetAzureDedicatedCircuitProperties.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitProperties/SetAzureDedicatedCircuitProperties.cs @@ -25,9 +25,7 @@ public class SetAzureDedicatedCircuitPropertiesCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key of Azure Dedicated Circuit to be removed")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Bandwidth")] public UInt32? Bandwidth { get; set; } @@ -44,7 +42,7 @@ public override void ExecuteCmdlet() Force.IsPresent, string.Format(Resources.SetAzureDedicatedCircuitBandwidthWarning, ServiceKey, Bandwidth), Resources.SetAzureDedicatedCircuitBandwidthMessage, - ServiceKey, + ServiceKey.ToString(), () => { var circuit = ExpressRouteClient.SetAzureDedicatedCircuitProperties(ServiceKey, Bandwidth, Sku); diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/GetAzureDedicatedCircuit.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/GetAzureDedicatedCircuit.cs index 10f439148792..ee183d41b9b0 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/GetAzureDedicatedCircuit.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/GetAzureDedicatedCircuit.cs @@ -16,21 +16,21 @@ using System.Collections.Generic; using System.Management.Automation; using Microsoft.WindowsAzure.Management.ExpressRoute.Models; +using System; namespace Microsoft.WindowsAzure.Commands.ExpressRoute { + [Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuit"), OutputType(typeof(AzureDedicatedCircuit), typeof (IEnumerable))] public class GetAzureDedicatedCircuitCommand : 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(); } diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/RemoveAzureDedicatedCircuit.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/RemoveAzureDedicatedCircuit.cs index 5f82d967a6f3..2ef18f852f90 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/RemoveAzureDedicatedCircuit.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/RemoveAzureDedicatedCircuit.cs @@ -23,9 +23,7 @@ public class RemoveAzureDedicatedCircuitCommand : ExpressRouteBaseCmdlet { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key of Azure Dedicated Circuit to be removed")] - [ValidateGuid] - [ValidateNotNullOrEmpty] - public string ServiceKey { get; set; } + public Guid ServiceKey { get; set; } [Parameter(HelpMessage = "Do not confirm Azure Dedicated Circuit deletion")] public SwitchParameter Force { get; set; } @@ -39,7 +37,7 @@ public override void ExecuteCmdlet() Force.IsPresent, string.Format(Resources.RemoveAzureDedicatdCircuitWarning, ServiceKey), Resources.RemoveAzureDedicatedCircuitMessage, - ServiceKey, + ServiceKey.ToString(), () => { if (!ExpressRouteClient.RemoveAzureDedicatedCircuit(ServiceKey)) diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs index 3a6a4b28f34e..60b7d3b94249 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs @@ -44,6 +44,7 @@ private static ClientType CreateClient(AzureProfile profile, AzureSu /// Creates new ExpressRouteClient /// /// Subscription containing websites to manipulate + /// Azure Profile public ExpressRouteClient(AzureProfile profile, AzureSubscription subscription) : this(CreateClient(profile, subscription)) { @@ -54,18 +55,21 @@ public ExpressRouteClient(ExpressRouteManagementClient client) Client = client; } - public AzureBgpPeering GetAzureBGPPeering(string serviceKey, BgpPeeringAccessType accessType) + public AzureBgpPeering GetAzureBGPPeering(Guid serviceKey, BgpPeeringAccessType accessType) { - return Client.BorderGatewayProtocolPeerings.Get(serviceKey, accessType).BgpPeering; + return Client.BorderGatewayProtocolPeerings.Get(serviceKey.ToString(), accessType).BgpPeering; } - public AzureBgpPeering NewAzureBGPPeering(string serviceKey, UInt32 peerAsn, string primaryPeerSubnet, - string secondaryPeerSubnet, UInt32 vlanId, BgpPeeringAccessType accessType, string sharedKey = null) + public AzureBgpPeering NewAzureBGPPeering(Guid serviceKey, string advertisedPublicPrefixes, UInt32 customerAsn, UInt32 peerAsn, string primaryPeerSubnet, + string routingRegistryName, string secondaryPeerSubnet, UInt32 vlanId, BgpPeeringAccessType accessType, string sharedKey = null) { - var result = Client.BorderGatewayProtocolPeerings.New(serviceKey, accessType, new BorderGatewayProtocolPeeringNewParameters() + var result = Client.BorderGatewayProtocolPeerings.New(serviceKey.ToString(), accessType, new BorderGatewayProtocolPeeringNewParameters() { + AdvertisedPublicPrefixes = advertisedPublicPrefixes, + CustomerAutonomousSystemNumber = customerAsn, PeerAutonomousSystemNumber = peerAsn, PrimaryPeerSubnet = primaryPeerSubnet, + RoutingRegistryName = routingRegistryName, SecondaryPeerSubnet = secondaryPeerSubnet, SharedKey = sharedKey, VirtualLanId = vlanId @@ -81,20 +85,22 @@ public AzureBgpPeering NewAzureBGPPeering(string serviceKey, UInt32 peerAsn, str } } - public bool RemoveAzureBGPPeering(string serviceKey, BgpPeeringAccessType accessType) + public bool RemoveAzureBGPPeering(Guid serviceKey, BgpPeeringAccessType accessType) { - var result = Client.BorderGatewayProtocolPeerings.Remove(serviceKey, accessType); + var result = Client.BorderGatewayProtocolPeerings.Remove(serviceKey.ToString(), accessType); return result.HttpStatusCode.Equals(HttpStatusCode.OK); } - public AzureBgpPeering UpdateAzureBGPPeering(string serviceKey, - BgpPeeringAccessType accessType, UInt32 peerAsn, string primaryPeerSubnet, - string secondaryPeerSubnet, UInt32 vlanId, string sharedKey) + public AzureBgpPeering UpdateAzureBGPPeering(Guid serviceKey, + BgpPeeringAccessType accessType, UInt32 customerAsn, UInt32 peerAsn, string primaryPeerSubnet, + string routingRegistryName, string secondaryPeerSubnet, UInt32 vlanId, string sharedKey) { - var result = Client.BorderGatewayProtocolPeerings.Update(serviceKey, accessType, new BorderGatewayProtocolPeeringUpdateParameters() + var result = Client.BorderGatewayProtocolPeerings.Update(serviceKey.ToString(), accessType, new BorderGatewayProtocolPeeringUpdateParameters() { + CustomerAutonomousSystemNumber = customerAsn, PeerAutonomousSystemNumber = peerAsn, PrimaryPeerSubnet = primaryPeerSubnet, + RoutingRegistryName = routingRegistryName, SecondaryPeerSubnet = secondaryPeerSubnet, SharedKey = sharedKey, VirtualLanId = vlanId, @@ -109,9 +115,9 @@ public AzureBgpPeering UpdateAzureBGPPeering(string serviceKey, } } - public AzureDedicatedCircuit GetAzureDedicatedCircuit(string serviceKey) + public AzureDedicatedCircuit GetAzureDedicatedCircuit(Guid serviceKey) { - return (Client.DedicatedCircuits.Get(serviceKey)).DedicatedCircuit; + return (Client.DedicatedCircuits.Get(serviceKey.ToString())).DedicatedCircuit; } public AzureDedicatedCircuit NewAzureDedicatedCircuit(string circuitName, @@ -128,7 +134,7 @@ public AzureDedicatedCircuit NewAzureDedicatedCircuit(string circuitName, if (result.HttpStatusCode.Equals(HttpStatusCode.OK)) { - return GetAzureDedicatedCircuit(result.Data); + return GetAzureDedicatedCircuit(new Guid(result.Data)); } else { @@ -141,7 +147,7 @@ public IEnumerable ListAzureDedicatedCircuit() return (Client.DedicatedCircuits.List().DedicatedCircuits); } - public AzureDedicatedCircuit SetAzureDedicatedCircuitProperties(string serviceKey, UInt32? bandwidth, CircuitSku? sku) + public AzureDedicatedCircuit SetAzureDedicatedCircuitProperties(Guid serviceKey, UInt32? bandwidth, CircuitSku? sku) { var updateParams = new DedicatedCircuitUpdateParameters() {}; @@ -155,7 +161,7 @@ public AzureDedicatedCircuit SetAzureDedicatedCircuitProperties(string serviceKe updateParams.Sku = sku.Value.ToString(); } - var result = Client.DedicatedCircuits.Update(serviceKey, updateParams); + var result = Client.DedicatedCircuits.Update(serviceKey.ToString(), updateParams); if (result.HttpStatusCode.Equals(HttpStatusCode.OK)) { @@ -167,20 +173,20 @@ public AzureDedicatedCircuit SetAzureDedicatedCircuitProperties(string serviceKe } } - public bool RemoveAzureDedicatedCircuit(string serviceKey) + public bool RemoveAzureDedicatedCircuit(Guid serviceKey) { - var result = Client.DedicatedCircuits.Remove(serviceKey); + var result = Client.DedicatedCircuits.Remove(serviceKey.ToString()); return result.HttpStatusCode.Equals(HttpStatusCode.OK); } - public AzureDedicatedCircuitLink GetAzureDedicatedCircuitLink(string serviceKey, string vNetName) + public AzureDedicatedCircuitLink GetAzureDedicatedCircuitLink(Guid serviceKey, string vNetName) { - return (Client.DedicatedCircuitLinks.Get(serviceKey, vNetName)).DedicatedCircuitLink; + return (Client.DedicatedCircuitLinks.Get(serviceKey.ToString(), vNetName)).DedicatedCircuitLink; } - public AzureDedicatedCircuitLink NewAzureDedicatedCircuitLink(string serviceKey, string vNetName) + public AzureDedicatedCircuitLink NewAzureDedicatedCircuitLink(Guid serviceKey, string vNetName) { - var result = Client.DedicatedCircuitLinks.New(serviceKey, vNetName); + var result = Client.DedicatedCircuitLinks.New(serviceKey.ToString(), vNetName); if (result.HttpStatusCode.Equals(HttpStatusCode.OK)) { return GetAzureDedicatedCircuitLink(serviceKey, vNetName); @@ -191,14 +197,14 @@ public AzureDedicatedCircuitLink NewAzureDedicatedCircuitLink(string serviceKey, } } - public IEnumerable ListAzureDedicatedCircuitLink(string serviceKey) + public IEnumerable ListAzureDedicatedCircuitLink(Guid serviceKey) { - return (Client.DedicatedCircuitLinks.List(serviceKey).DedicatedCircuitLinks); + return (Client.DedicatedCircuitLinks.List(serviceKey.ToString()).DedicatedCircuitLinks); } - public bool RemoveAzureDedicatedCircuitLink(string serviceKey, string vNetName) + public bool RemoveAzureDedicatedCircuitLink(Guid serviceKey, string vNetName) { - var result = Client.DedicatedCircuitLinks.Remove(serviceKey, vNetName); + var result = Client.DedicatedCircuitLinks.Remove(serviceKey.ToString(), vNetName); return result.HttpStatusCode.Equals(HttpStatusCode.OK); } @@ -207,14 +213,14 @@ public IEnumerable ListAzureDedicatedCircu return (Client.DedicatedCircuitServiceProviders.List().DedicatedCircuitServiceProviders); } - public AzureCrossConnection GetAzureCrossConnection(string serviceKey) + public AzureCrossConnection GetAzureCrossConnection(Guid serviceKey) { - return (Client.CrossConnections.Get(serviceKey)).CrossConnection; + return (Client.CrossConnections.Get(serviceKey.ToString())).CrossConnection; } - public AzureCrossConnection NewAzureCrossConnection(string serviceKey) + public AzureCrossConnection NewAzureCrossConnection(Guid serviceKey) { - var result = Client.CrossConnections.New(serviceKey); + var result = Client.CrossConnections.New(serviceKey.ToString()); if (result.HttpStatusCode.Equals(HttpStatusCode.OK)) { @@ -226,10 +232,10 @@ public AzureCrossConnection NewAzureCrossConnection(string serviceKey) } } - public AzureCrossConnection SetAzureCrossConnection(string serviceKey, + public AzureCrossConnection SetAzureCrossConnection(Guid serviceKey, CrossConnectionUpdateParameters parameters) { - var result = Client.CrossConnections.Update(serviceKey, parameters); + var result = Client.CrossConnections.Update(serviceKey.ToString(), parameters); if (result.HttpStatusCode.Equals(HttpStatusCode.OK)) { @@ -246,14 +252,14 @@ public IEnumerable ListAzureCrossConnections() return (Client.CrossConnections.List()).CrossConnections; } - public AzureDedicatedCircuitLinkAuthorization GetAzureDedicatedCircuitLinkAuthorization(string serviceKey, string authorizationId) + public AzureDedicatedCircuitLinkAuthorization GetAzureDedicatedCircuitLinkAuthorization(Guid serviceKey, Guid authorizationId) { - return (Client.DedicatedCircuitLinkAuthorizations.Get(serviceKey, authorizationId)).DedicatedCircuitLinkAuthorization; + return (Client.DedicatedCircuitLinkAuthorizations.Get(serviceKey.ToString(), authorizationId.ToString())).DedicatedCircuitLinkAuthorization; } - public AzureDedicatedCircuitLinkAuthorization NewAzureDedicatedCircuitLinkAuthorization(string serviceKey, string description, int limit, string microsoftIds) + public AzureDedicatedCircuitLinkAuthorization NewAzureDedicatedCircuitLinkAuthorization(Guid serviceKey, string description, int limit, string microsoftIds) { - return (Client.DedicatedCircuitLinkAuthorizations.New(serviceKey, new DedicatedCircuitLinkAuthorizationNewParameters() + return (Client.DedicatedCircuitLinkAuthorizations.New(serviceKey.ToString(), new DedicatedCircuitLinkAuthorizationNewParameters() { Description = description, Limit = limit, @@ -261,29 +267,29 @@ public AzureDedicatedCircuitLinkAuthorization NewAzureDedicatedCircuitLinkAuthor })).DedicatedCircuitLinkAuthorization; } - public AzureDedicatedCircuitLinkAuthorization SetAzureDedicatedCircuitLinkAuthorization(string serviceKey, string authorizationId, string description, int limit) + public AzureDedicatedCircuitLinkAuthorization SetAzureDedicatedCircuitLinkAuthorization(Guid serviceKey, Guid authorizationId, string description, int limit) { - return (Client.DedicatedCircuitLinkAuthorizations.Update(serviceKey, authorizationId, new DedicatedCircuitLinkAuthorizationUpdateParameters() + return (Client.DedicatedCircuitLinkAuthorizations.Update(serviceKey.ToString(), authorizationId.ToString(), new DedicatedCircuitLinkAuthorizationUpdateParameters() { Description = description, Limit = limit })).DedicatedCircuitLinkAuthorization; } - public IEnumerable ListAzureDedicatedCircuitLinkAuthorizations(string serviceKey) + public IEnumerable ListAzureDedicatedCircuitLinkAuthorizations(Guid serviceKey) { - return (Client.DedicatedCircuitLinkAuthorizations.List(serviceKey).DedicatedCircuitLinkAuthorizations); + return (Client.DedicatedCircuitLinkAuthorizations.List(serviceKey.ToString()).DedicatedCircuitLinkAuthorizations); } - public bool RemoveAzureDedicatedCircuitLinkAuthorization(string serviceKey, string authorizationId) + public bool RemoveAzureDedicatedCircuitLinkAuthorization(Guid serviceKey, Guid authorizationId) { - var result = Client.DedicatedCircuitLinkAuthorizations.Remove(serviceKey, authorizationId); + var result = Client.DedicatedCircuitLinkAuthorizations.Remove(serviceKey.ToString(), authorizationId.ToString()); return result.HttpStatusCode.Equals(HttpStatusCode.OK); } - public AzureAuthorizedDedicatedCircuit GetAuthorizedAzureDedicatedCircuit(string serviceKey) + public AzureAuthorizedDedicatedCircuit GetAuthorizedAzureDedicatedCircuit(Guid serviceKey) { - return (Client.AuthorizedDedicatedCircuits.Get(serviceKey)).AuthorizedDedicatedCircuit; + return (Client.AuthorizedDedicatedCircuits.Get(serviceKey.ToString())).AuthorizedDedicatedCircuit; } public IEnumerable ListAzureAuthorizedDedicatedCircuits() @@ -291,18 +297,18 @@ public IEnumerable ListAzureAuthorizedDedicated return (Client.AuthorizedDedicatedCircuits.List().AuthorizedDedicatedCircuits); } - public bool NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds(string serviceKey, string authorizationId, string microsoftIds) + public bool NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds(Guid serviceKey, Guid authorizationId, string microsoftIds) { - var result = Client.DedicatedCircuitLinkAuthorizationMicrosoftIds.New(serviceKey, authorizationId, new DedicatedCircuitLinkAuthorizationMicrosoftIdNewParameters() + var result = Client.DedicatedCircuitLinkAuthorizationMicrosoftIds.New(serviceKey.ToString(), authorizationId.ToString(), new DedicatedCircuitLinkAuthorizationMicrosoftIdNewParameters() { MicrosoftIds = microsoftIds }); return result.StatusCode.Equals(HttpStatusCode.OK); } - public bool RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds(string serviceKey, string authorizationId, string microsoftIds) + public bool RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds(Guid serviceKey, Guid authorizationId, string microsoftIds) { - var result = Client.DedicatedCircuitLinkAuthorizationMicrosoftIds.Remove(serviceKey, authorizationId, new DedicatedCircuitLinkAuthorizationMicrosoftIdRemoveParameters() + var result = Client.DedicatedCircuitLinkAuthorizationMicrosoftIds.Remove(serviceKey.ToString(), authorizationId.ToString(), new DedicatedCircuitLinkAuthorizationMicrosoftIdRemoveParameters() { MicrosoftIds = microsoftIds }); diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Model/ValidateGuid.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Model/ValidateGuid.cs deleted file mode 100644 index 2fbd8c2cfb70..000000000000 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Model/ValidateGuid.cs +++ /dev/null @@ -1,38 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// 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; -using System.Management.Automation; -using Microsoft.WindowsAzure.Commands.ExpressRoute.Properties; - -namespace Microsoft.WindowsAzure.Commands.ExpressRoute -{ - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] - public sealed class ValidateGuid : ValidateEnumeratedArgumentsAttribute - { - protected override void ValidateElement(object element) - { - string guid = (string)element; - - try - { - Guid validGuid = Guid.Parse(guid); - } - catch - { - throw new ArgumentException(String.Format(Resources.InvalidGuid, guid)); - } - } - } -} diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.Designer.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.Designer.cs index fcbe1794622a..98b22e6cdc4f 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.Designer.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.Designer.cs @@ -69,6 +69,33 @@ internal static string InvalidGuid { } } + /// + /// Looks up a localized string similar to Provisioning Cross Connection for service key {0}. + /// + internal static string NewAzureCrossConnectionMessage { + get { + return ResourceManager.GetString("NewAzureCrossConnectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully provisioned cross connection. + /// + internal static string NewAzureCrossConnectionSucceeded { + get { + return ResourceManager.GetString("NewAzureCrossConnectionSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to provision a cross connection for service key {0}?. + /// + internal static string NewAzureCrossConnectionWarning { + get { + return ResourceManager.GetString("NewAzureCrossConnectionWarning", resourceCulture); + } + } + /// /// Looks up a localized string similar to Creating Azure Dedicated Circuit with name {0} with service provider {1}. /// diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.resx b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.resx index be73b2626847..aa1a9d370254 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.resx +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/Resources.resx @@ -195,4 +195,13 @@ A value for the VLan Id has to be provided. + + Provisioning Cross Connection for service key {0} + + + Successfully provisioned cross connection + + + Are you sure you want to provision a cross connection for service key {0}? + \ No newline at end of file diff --git a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureBgpPeeringTests.cs b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureBgpPeeringTests.cs index 58adc31e603b..92c8171d367f 100644 --- a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureBgpPeeringTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureBgpPeeringTests.cs @@ -116,7 +116,7 @@ public void NewAzureBgpPeeringSuccessful() NewAzureBGPPeeringCommand cmdlet = new NewAzureBGPPeeringCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), AccessType = accessType, PeerAsn = peerAsn, PrimaryPeerSubnet = primaryPeerSubnet, @@ -187,7 +187,7 @@ public void GetAzureBgpPeeringSuccessful() GetAzureBGPPeeringCommand cmdlet = new GetAzureBGPPeeringCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), AccessType = accessType, CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) @@ -232,7 +232,7 @@ public void RemoveAzureBgpPeeringSuccessful() RemoveAzureBGPPeeringCommand cmdlet = new RemoveAzureBGPPeeringCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), AccessType = accessType, CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) diff --git a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitLinkTests.cs b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitLinkTests.cs index bbf1336e5fce..eed2ed04403c 100644 --- a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitLinkTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitLinkTests.cs @@ -84,7 +84,7 @@ public void NewAzureDedicatedCircuitLinkSuccessful() NewAzureDedicatedCircuitLinkCommand cmdlet = new NewAzureDedicatedCircuitLinkCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), VNetName = vNetName, CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) @@ -130,7 +130,7 @@ public void GetAzureDedicatedCircuitLinkSuccessful() GetAzureDedicatedCircuitLinkCommand cmdlet = new GetAzureDedicatedCircuitLinkCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), VNetName = vNetName, CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) @@ -170,7 +170,7 @@ public void RemoveAzureDedicatedCircuitLinkSuccessful() RemoveAzureDedicatedCircuitLinkCommand cmdlet = new RemoveAzureDedicatedCircuitLinkCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), VNetName = vNetName, CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) @@ -218,7 +218,7 @@ public void ListAzureDedicatedCircuitLinkSuccessful() GetAzureDedicatedCircuitLinkCommand cmdlet = new GetAzureDedicatedCircuitLinkCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) }; diff --git a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitTests.cs b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitTests.cs index 3845bac4de37..658ff104a39a 100644 --- a/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitTests.cs @@ -156,7 +156,7 @@ public void GetAzureDedicatedCircuitSuccessful() GetAzureDedicatedCircuitCommand cmdlet = new GetAzureDedicatedCircuitCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) }; @@ -198,7 +198,7 @@ public void RemoveAzureDedicatedCircuitSuccessful() RemoveAzureDedicatedCircuitCommand cmdlet = new RemoveAzureDedicatedCircuitCommand() { - ServiceKey = serviceKey, + ServiceKey = Guid.Parse(serviceKey), CommandRuntime = mockCommandRuntime, ExpressRouteClient = new ExpressRouteClient(client.Object) };