Skip to content

Commit 3637d82

Browse files
committed
update APIs and Versions
1 parent fe652ea commit 3637d82

File tree

11 files changed

+63
-39
lines changed

11 files changed

+63
-39
lines changed

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6868
</Reference>
6969
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.16-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
70+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.0.3-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
7171
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Management.Network" version="2.0.16-preview" targetFramework="net45" />
10+
<package id="Microsoft.Azure.Management.Network" version="3.0.3-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.5799.28345-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5799.28345-prerelease" targetFramework="net45" />

src/ResourceManager/Network/Commands.Network/Commands.Network.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</Reference>
7979
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8080
<SpecificVersion>False</SpecificVersion>
81-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.16-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
81+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.0.3-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
8282
</Reference>
8383
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8484
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/Network/Commands.Network/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
12-
<package id="Microsoft.Azure.Management.Network" version="2.0.16-preview" targetFramework="net45" />
12+
<package id="Microsoft.Azure.Management.Network" version="3.0.3-preview" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1414
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1515
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
9292
</Reference>
9393
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
94-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.6-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
94+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.12-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
9595
<Private>True</Private>
9696
</Reference>
9797
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitStats/GetAzureDedicatedCircuitPeeringArpInfo.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2222
{
23-
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitPeeringArpInfo"), OutputType(typeof(AzureDedicatedCircuitPeeringArpInfo), typeof(IEnumerable<AzureDedicatedCircuitPeeringArpInfo>))]
23+
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitPeeringArpInfo"), OutputType(typeof(string), typeof(IEnumerable<string>))]
2424
public class GetAzureDedicatedCircuitPeeringArpInfoCommand : ExpressRouteBaseCmdlet
2525
{
2626
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
@@ -37,7 +37,8 @@ public class GetAzureDedicatedCircuitPeeringArpInfoCommand : ExpressRouteBaseCmd
3737

3838
public override void ExecuteCmdlet()
3939
{
40-
var arpInfo = ExpressRouteClient.GetAzureDedicatedCircuitPeeringArpInfo(ServiceKey, AccessType, BgpPeeringDevicePath);
40+
var arpInfo = ExpressRouteClient.GetAzureDedicatedCircuitPeeringArpInfo(ServiceKey, AccessType, BgpPeeringDevicePath);
41+
Console.WriteLine(arpInfo);
4142
WriteObject(arpInfo);
4243
}
4344
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuitStats/GetAzureDedicatedCircuitStats.cs

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
// ----------------------------------------------------------------------------------
1414

1515

16-
using System.Collections.Generic;
16+
using System.ComponentModel;
1717
using System.Management.Automation;
1818
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
1919
using System;
20+
using System.Collections.Generic;
2021

2122
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2223
{
23-
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitStats"), OutputType(typeof(AzureDedicatedCircuitStats), typeof(IEnumerable<AzureDedicatedCircuitStats>))]
24+
[Cmdlet(VerbsCommon.Get, "AzureDedicatedCircuitStats"), OutputType(typeof(AzureDedicatedCircuitPeeringStats), typeof(IEnumerable<AzureDedicatedCircuitPeeringStats>))]
2425
public class GetAzureDedicatedCircuitPeeringStatsCommand : ExpressRouteBaseCmdlet
2526
{
2627
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
@@ -29,20 +30,54 @@ public class GetAzureDedicatedCircuitPeeringStatsCommand : ExpressRouteBaseCmdle
2930

3031
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
3132
HelpMessage = "Bgp Peering Access Type: Public or Private or Microsoft")]
32-
public BgpPeeringAccessType AccessType { get; set; }
33+
public string AccessType { get; set; }
3334

35+
3436
public override void ExecuteCmdlet()
3537
{
36-
if(AccessType.Equals(null))
38+
if(string.IsNullOrEmpty(AccessType))
3739
{
38-
var stats = ExpressRouteClient.GetAzureDedicatedCircuitStatspInfo(ServiceKey);
39-
WriteObject(stats);
40+
AzureDedicatedCircuitStats stats = new AzureDedicatedCircuitStats
41+
{
42+
PrimaryBytesIn = (ulong)0,
43+
PrimaryBytesOut = (ulong)0,
44+
SecondaryBytesIn = (ulong)0,
45+
SecondaryBytesOut = (ulong)0
46+
};
47+
AzureBgpPeering peering= ExpressRouteClient.GetAzureBGPPeering(ServiceKey, BgpPeeringAccessType.Private);
48+
if (peering != null)
49+
{
50+
stats = compute(stats, ServiceKey, BgpPeeringAccessType.Private);
51+
}
52+
peering = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, BgpPeeringAccessType.Public);
53+
if (peering != null)
54+
{
55+
stats = compute(stats, ServiceKey, BgpPeeringAccessType.Public);
56+
}
57+
peering = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, BgpPeeringAccessType.Microsoft);
58+
if (peering != null)
59+
{
60+
stats = compute(stats, ServiceKey, BgpPeeringAccessType.Microsoft);
61+
}
62+
WriteObject(stats);
63+
4064
}
41-
else
65+
BgpPeeringAccessType type;
66+
if (BgpPeeringAccessType.TryParse(AccessType, out type))
4267
{
43-
var stats = ExpressRouteClient.GetAzureDedicatedCircuitPeeringStatsInfo(ServiceKey, AccessType);
68+
var stats = ExpressRouteClient.GetAzureDedicatedCircuitStatsInfo(ServiceKey, type);
4469
WriteObject(stats);
45-
}
70+
}
71+
}
72+
73+
private AzureDedicatedCircuitStats compute(AzureDedicatedCircuitStats stats, Guid key, BgpPeeringAccessType type)
74+
{
75+
var tempstats = ExpressRouteClient.GetAzureDedicatedCircuitStatsInfo(key,type);
76+
stats.PrimaryBytesIn += tempstats.PrimaryBytesIn;
77+
stats.PrimaryBytesOut += tempstats.PrimaryBytesOut;
78+
stats.SecondaryBytesIn += tempstats.SecondaryBytesIn;
79+
stats.SecondaryBytesOut += tempstats.SecondaryBytesOut;
80+
return stats;
4681
}
4782
}
4883
}

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,24 @@ public ExpressRouteClient(ExpressRouteManagementClient client)
5555
Client = client;
5656
}
5757

58-
public AzureDedicatedCircuitPeeringArpInfo GetAzureDedicatedCircuitPeeringArpInfo(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
58+
public string GetAzureDedicatedCircuitPeeringArpInfo(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
5959
{
60-
return Client.DedicatedCircuitPeeringArpInfo.Get(serviceKey.ToString(), accessType, devicePath).DedicatedCircuitPeeringArpInfo;
60+
return Client.DedicatedCircuitPeeringArpInfo.Get(serviceKey.ToString(), accessType, devicePath).Data.ToString();
6161
}
6262

63-
public AzureDedicatedCircuitPeeringRouteTableInfo GetAzureDedicatedCircuitPeeringRouteTableInfo(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
63+
public string GetAzureDedicatedCircuitPeeringRouteTableInfo(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
6464
{
65-
return Client.DedicatedCircuitPeeringRouteTableInfo.Get(serviceKey.ToString(), accessType, devicePath).DedicatedCircuitPeeringRouteTableInfo;
65+
return Client.DedicatedCircuitPeeringRouteTableInfo.Get(serviceKey.ToString(), accessType, devicePath).Data.ToString();
6666
}
6767

68-
public AzureDedicatedCircuitPeeringRouteTableSummary GetAzureDedicatedCircuitPeeringRouteTableSummary(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
68+
public string GetAzureDedicatedCircuitPeeringRouteTableSummary(Guid serviceKey, BgpPeeringAccessType accessType, DevicePath devicePath)
6969
{
70-
return Client.DedicatedCircuitPeeringRouteTableSummary.Get(serviceKey.ToString(), accessType, devicePath).DedicatedCircuitPeeringRouteTableSummary;
70+
return Client.DedicatedCircuitPeeringRouteTableSummary.Get(serviceKey.ToString(), accessType, devicePath).Data.ToString();
7171
}
7272

73-
public AzureDedicatedCircuitStats GetAzureDedicatedCircuitPeeringStatsInfo(Guid serviceKey, BgpPeeringAccessType accessType)
73+
public AzureDedicatedCircuitStats GetAzureDedicatedCircuitStatsInfo(Guid serviceKey, BgpPeeringAccessType accessType)
7474
{
75-
var stats = Client.DedicatedCircuitPeeringStats.Get(serviceKey.ToString(), accessType).DedicatedCircuitPeeringStats;
76-
return new AzureDedicatedCircuitStats()
77-
{
78-
PrimaryBytesIn = stats.PrimaryBytesIn,
79-
PrimaryBytesOut = stats.PrimaryBytesOut,
80-
SecondaryBytesIn = stats.SecondaryBytesIn,
81-
SecondaryBytesOut = stats.SecondaryBytesOut
82-
};
83-
}
84-
85-
public AzureDedicatedCircuitStats GetAzureDedicatedCircuitStatspInfo(Guid serviceKey)
86-
{
87-
return Client.DedicatedCircuitStats.Get(serviceKey.ToString()).DedicatedCircuitStats;
75+
return Client.DedicatedCircuitStats.Get(serviceKey.ToString(), accessType).DedicatedCircuitStats;
8876
}
8977
public AzureBgpPeering GetAzureBGPPeering(Guid serviceKey, BgpPeeringAccessType accessType)
9078
{

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<package id="Microsoft.Rest.ClientRuntime" version="1.4.1" targetFramework="net45" />
1414
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="0.11.0" targetFramework="net45" />
1515
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
16-
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.6-preview" targetFramework="net45" />
16+
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.12-preview" targetFramework="net45" />
1717
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
1818
</packages>

src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.3.1\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
136136
</Reference>
137137
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
138-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.4-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
138+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.6-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
139139
<Private>True</Private>
140140
</Reference>
141141
<Reference Include="Microsoft.WindowsAzure.Management.MediaServices">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
2222
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
2323
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.3.1" targetFramework="net45" />
24-
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.4-preview" targetFramework="net45" />
24+
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.6-preview" targetFramework="net45" />
2525
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="4.0.0" targetFramework="net45" />
2626
<package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.17.0-preview" targetFramework="net45" />
2727
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />

0 commit comments

Comments
 (0)