Skip to content

Commit 7071e98

Browse files
committed
Converting ServiceKey and AuthorizationId to Guid
1 parent 834f6bb commit 7071e98

25 files changed

+131
-160
lines changed

setup/azurepowershell.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 2012
1+
# Visual Studio 2013
2+
VisualStudioVersion = 12.0.30110.0
3+
MinimumVisualStudioVersion = 10.0.40219.1
4+
35
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "azurepowershell", "azurepowershell.wixproj", "{36D6E303-E057-4963-A093-C7AAE0FD92B3}"
46
ProjectSection(ProjectDependencies) = postProject
57
{EA5BD11B-10B3-433D-A250-92AE76669D8D} = {EA5BD11B-10B3-433D-A250-92AE76669D8D}

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ 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]
27-
[ValidateNotNullOrEmpty]
28-
public string ServiceKey { get; set; }
26+
public Guid ServiceKey { get; set; }
2927

3028
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
3129
[ValidateNotNullOrEmpty]

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2525
public class SetAzureBGPPeeringCommand : ExpressRouteBaseCmdlet
2626
{
2727
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
28-
[ValidateGuid]
29-
[ValidateNotNullOrEmpty]
30-
public string ServiceKey { get; set; }
28+
public Guid ServiceKey { get; set; }
3129

3230
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Advertised Public Prefixes")]
3331
[ValidateNotNullOrEmpty]

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/GetAzureCrossConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919

2020
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2121
{
22+
using System;
23+
2224
[Cmdlet(VerbsCommon.Get, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection), typeof(IEnumerable<AzureCrossConnection>))]
2325
public class GetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
2426
{
2527
[Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true,
2628
HelpMessage = "Service Key representing the Dedicated Circuit")]
27-
[ValidateGuid]
28-
[ValidateNotNullOrEmpty]
29-
public string ServiceKey { get; set; }
29+
public Guid ServiceKey { get; set; }
3030

3131
public override void ExecuteCmdlet()
3232
{
33-
if (!string.IsNullOrEmpty(ServiceKey))
33+
if(ServiceKey != Guid.Empty)
3434
{
3535
GetByServiceKey();
3636
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/NewAzureCrossConnections.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ public class NewAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
2424
{
2525
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2626
HelpMessage = "Dedicated Circuit Service Key")]
27-
[ValidateGuid]
28-
[ValidateNotNullOrEmpty]
29-
public string ServiceKey { get; set; }
27+
public Guid ServiceKey { get; set; }
3028

3129
[Parameter(HelpMessage = "Do not confirm Azure Cross Connection creation")]
3230
public SwitchParameter Force { get; set; }
@@ -37,7 +35,7 @@ public override void ExecuteCmdlet()
3735
Force.IsPresent,
3836
string.Format(Resources.NewAzureCrossConnectionWarning, ServiceKey),
3937
string.Format(Resources.NewAzureCrossConnectionMessage, ServiceKey),
40-
ServiceKey,
38+
ServiceKey.ToString(),
4139
() =>
4240
{
4341
var crossConnection = ExpressRouteClient.NewAzureCrossConnection(ServiceKey);

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/CrossConnections/SetAzureCrossConnection.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2525
public class SetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
2626
{
2727
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")]
28-
[ValidateGuid]
29-
[ValidateNotNullOrEmpty]
30-
public string ServiceKey { get; set; }
28+
public Guid ServiceKey { get; set; }
3129

3230
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Notification Operation to perform. NotifyCrossConnectionProvisioned or NotifyCrossConnectionNotProvisioned")]
3331
[ValidateNotNullOrEmpty]
@@ -36,17 +34,16 @@ public class SetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet
3634
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Provisioning Error Message")]
3735
public string ProvisioningError { get; set; }
3836

39-
[Parameter(Mandatory = false)]
37+
[Parameter(Mandatory = false)]
4038
public SwitchParameter PassThru { get; set; }
4139

4240
public override void ExecuteCmdlet()
4341
{
44-
var crossConnection = ExpressRouteClient.SetAzureCrossConnection(ServiceKey,
45-
new CrossConnectionUpdateParameters() {Operation = Operation, ProvisioningError = ProvisioningError});
42+
var crossConnection = ExpressRouteClient.SetAzureCrossConnection(ServiceKey, new CrossConnectionUpdateParameters() {Operation = Operation, ProvisioningError = ProvisioningError});
4643
if(PassThru.IsPresent)
47-
{
48-
WriteObject(crossConnection);
49-
}
44+
{
45+
WriteObject(crossConnection);
46+
}
5047
}
5148
}
5249
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs

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

15+
using System;
16+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System.Management.Automation;
18+
1519
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1620
{
17-
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
18-
using System.Management.Automation;
19-
21+
2022
[Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLinkAuthorizationMicrosoftIds")]
2123
public class NewAzureDedicatedCircuitLinkAuthorizationMicrosoftIdsCommand : ExpressRouteBaseCmdlet
2224
{
2325
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2426
HelpMessage = "Service Key representing Azure Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
27+
public Guid ServiceKey { get; set; }
2828

2929
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")]
30-
[ValidateGuid]
31-
[ValidateNotNullOrEmpty]
32-
public string AuthorizationId { get; set; }
30+
public Guid AuthorizationId { get; set; }
3331

3432
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Microsoft Ids to be removed")]
3533
public string MicrosoftIds { get; set; }

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizationMicrosoftIds/RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIds.cs

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

15+
using System;
16+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System.Management.Automation;
18+
1519
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1620
{
17-
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
18-
using System.Management.Automation;
19-
21+
2022
[Cmdlet(VerbsCommon.Remove, "AzureDedicatedCircuitLinkAuthorizationMicrosoftIds")]
2123
public class RemoveAzureDedicatedCircuitLinkAuthorizationMicrosoftIdsCommand : ExpressRouteBaseCmdlet
2224
{
2325
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2426
HelpMessage = "Service Key representing Azure Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
27+
public Guid ServiceKey { get; set; }
2828

2929
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Authorization Id")]
30-
[ValidateGuid]
31-
[ValidateNotNullOrEmpty]
32-
public string AuthorizationId { get; set; }
30+
public Guid AuthorizationId { get; set; }
3331

3432
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Microsoft Ids to be removed")]
3533
public string MicrosoftIds { get; set; }

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/GetAzureDedicatedCircuitLinkAuthorization.cs

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

15+
using System;
16+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System.Management.Automation;
18+
1519
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1620
{
17-
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
18-
using System.Management.Automation;
19-
2021
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(AzureDedicatedCircuitLinkAuthorization))]
2122
public class GetAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteBaseCmdlet
2223
{
2324
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2425
HelpMessage = "Service Key representing the Azure Dedicated Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
26+
public Guid ServiceKey { get; set; }
2827

2928
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
3029
HelpMessage = "Authorization Id")]
31-
[ValidateGuid]
32-
[ValidateNotNullOrEmpty]
33-
public string AuthorizationId { get; set; }
30+
public Guid AuthorizationId { get; set; }
3431

3532
public override void ExecuteCmdlet()
3633
{
37-
if (!string.IsNullOrEmpty(AuthorizationId))
34+
if (AuthorizationId != Guid.Empty)
3835
{
3936
GetByAuthorizationId();
4037
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/NewAzureDedicatedCircuitLinkAuthorization.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
16+
using System.Management.Automation;
17+
using System;
1518
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1619
{
17-
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
18-
using System.Management.Automation;
1920

2021
[Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(AzureDedicatedCircuitLinkAuthorization))]
2122
public class NewAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteBaseCmdlet
2223
{
2324
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2425
HelpMessage = "Service Key representing Azure Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
26+
public Guid ServiceKey { get; set; }
2827

2928
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
3029
HelpMessage = "Description")]

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/RemoveAzureDedicatedCircuitLinkAuthorization.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ public class RemoveAzureDedicatedCircuitLinkAuthorizationCommand : ExpressRouteB
2323
{
2424
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2525
HelpMessage = "Service Key for the Azure Circuit")]
26-
[ValidateGuid]
27-
[ValidateNotNullOrEmpty]
28-
public string ServiceKey { get; set; }
26+
public Guid ServiceKey { get; set; }
2927

3028
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
3129
HelpMessage = "Authorization Id")]
32-
[ValidateGuid]
33-
[ValidateNotNullOrEmpty]
34-
public string AuthorizationId { get; set; }
30+
public Guid AuthorizationId { get; set; }
3531

3632
[Parameter(HelpMessage = "Do not confirm")]
3733
public SwitchParameter Force { get; set; }

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinkAuthorizations/SetAzureDedicatedCircuitLinkAuthorization.cs

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

15+
using System;
16+
using System.Management.Automation;
17+
1518
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1619
{
17-
using System.Management.Automation;
1820

1921
[Cmdlet(VerbsCommon.Set, "AzureDedicatedCircuitLinkAuthorization"), OutputType(typeof(bool))]
2022
public class SetAzureDedicatedCircuitLinkAuthorizationAuthorizationCommand : ExpressRouteBaseCmdlet
2123
{
2224
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2325
HelpMessage = "Service Key for the Azure Circuit")]
24-
[ValidateGuid]
25-
[ValidateNotNullOrEmpty]
26-
public string ServiceKey { get; set; }
26+
public Guid ServiceKey { get; set; }
2727

2828
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2929
HelpMessage = "Authorization Id")]
30-
[ValidateGuid]
31-
[ValidateNotNullOrEmpty]
32-
public string AuthorizationId { get; set; }
30+
public Guid AuthorizationId { get; set; }
3331

3432
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
3533
HelpMessage = "Description")]

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/GetAzureDedicatedCircuitLink.cs

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

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System;
1718

1819
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1920
{
21+
2022
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitLink"), OutputType(typeof(AzureDedicatedCircuitLink))]
2123
public class GetAzureDedicatedCircuitLinkCommand : ExpressRouteBaseCmdlet
2224
{
2325
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2426
HelpMessage = "Service Key representing the Azure Dedicated Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
27+
public Guid ServiceKey { get; set; }
2828

2929
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
3030
HelpMessage = "Vnet Name")]

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitLinks/NewAzureDedicatedCircuitLink.cs

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

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
17+
using System;
1718

1819
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
1920
{
21+
2022
[Cmdlet(VerbsCommon.New, "AzureDedicatedCircuitLink"), OutputType(typeof(AzureDedicatedCircuitLink))]
2123
public class NewAzureDedicatedCircuitLinkCommand : ExpressRouteBaseCmdlet
2224
{
2325
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2426
HelpMessage = "Service Key representing Azure Circuit")]
25-
[ValidateGuid]
26-
[ValidateNotNullOrEmpty]
27-
public string ServiceKey { get; set; }
27+
public Guid ServiceKey { get; set; }
2828

2929
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Virtual Network Name")]
3030
[ValidateNotNullOrEmpty]

0 commit comments

Comments
 (0)