Skip to content

Commit 1bb4db0

Browse files
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into signing
2 parents fcf1d64 + faba8d0 commit 1bb4db0

File tree

21 files changed

+351
-16
lines changed

21 files changed

+351
-16
lines changed

ChangeLog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
2015.07.16 version 0.9.5
2+
* Azure RedisCache cmdlets
3+
* Set-AzureRedisCache - Bug fix done in management API that fixes bug here as well
24
* Azure Network Resource Provider cmdlets
35
* Added Application Gateway cmdlets
46
* New-AzureApplicationGateway

src/ResourceManager/Network/Commands.Network/Models/PSBackendAddressPool.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ namespace Microsoft.Azure.Commands.Network.Models
2121

2222
public class PSBackendAddressPool : PSChildResource
2323
{
24+
[JsonProperty(Order = 1)]
2425
public List<PSResourceId> BackendIpConfigurations { get; set; }
2526

27+
[JsonProperty(Order = 1)]
2628
public List<PSResourceId> LoadBalancingRules { get; set; }
2729

30+
[JsonProperty(Order = 1)]
2831
public string ProvisioningState { get; set; }
2932

3033
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSFrontendIpConfiguration.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,25 @@ namespace Microsoft.Azure.Commands.Network.Models
2121

2222
public class PSFrontendIPConfiguration : PSChildResource
2323
{
24+
[JsonProperty(Order = 1)]
2425
public string PrivateIpAddress { get; set; }
2526

27+
[JsonProperty(Order = 1)]
2628
public string PrivateIpAllocationMethod { get; set; }
2729

30+
[JsonProperty(Order = 1)]
2831
public PSResourceId Subnet { get; set; }
2932

33+
[JsonProperty(Order = 1)]
3034
public PSResourceId PublicIpAddress { get; set; }
3135

36+
[JsonProperty(Order = 1)]
3237
public List<PSResourceId> InboundNatRules { get; set; }
3338

39+
[JsonProperty(Order = 1)]
3440
public List<PSResourceId> LoadBalancingRules { get; set; }
3541

42+
[JsonProperty(Order = 1)]
3643
public string ProvisioningState { get; set; }
3744

3845
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSInboundNatRule.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,28 @@ namespace Microsoft.Azure.Commands.Network.Models
1919

2020
public class PSInboundNatRule : PSChildResource
2121
{
22+
[JsonProperty(Order = 1)]
2223
public PSResourceId FrontendIPConfiguration { get; set; }
2324

25+
[JsonProperty(Order = 1)]
2426
public PSResourceId BackendIPConfiguration { get; set; }
2527

28+
[JsonProperty(Order = 1)]
2629
public string Protocol { get; set; }
2730

31+
[JsonProperty(Order = 1)]
2832
public int FrontendPort { get; set; }
2933

34+
[JsonProperty(Order = 1)]
3035
public int BackendPort { get; set; }
3136

37+
[JsonProperty(Order = 1)]
3238
public int? IdleTimeoutInMinutes { get; set; }
3339

40+
[JsonProperty(Order = 1)]
3441
public bool EnableFloatingIP { get; set; }
3542

43+
[JsonProperty(Order = 1)]
3644
public string ProvisioningState { get; set; }
3745

3846
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSLoadBalancingRule.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,34 @@ namespace Microsoft.Azure.Commands.Network.Models
1919

2020
public class PSLoadBalancingRule : PSChildResource
2121
{
22+
[JsonProperty(Order = 1)]
2223
public PSResourceId FrontendIPConfiguration { get; set; }
2324

25+
[JsonProperty(Order = 1)]
2426
public PSResourceId BackendAddressPool { get; set; }
2527

28+
[JsonProperty(Order = 1)]
2629
public PSResourceId Probe { get; set; }
2730

31+
[JsonProperty(Order = 1)]
2832
public string Protocol { get; set; }
2933

34+
[JsonProperty(Order = 1)]
3035
public int FrontendPort { get; set; }
3136

37+
[JsonProperty(Order = 1)]
3238
public int BackendPort { get; set; }
3339

40+
[JsonProperty(Order = 1)]
3441
public int? IdleTimeoutInMinutes { get; set; }
3542

43+
[JsonProperty(Order = 1)]
3644
public string LoadDistribution { get; set; }
3745

46+
[JsonProperty(Order = 1)]
3847
public bool EnableFloatingIP { get; set; }
3948

49+
[JsonProperty(Order = 1)]
4050
public string ProvisioningState { get; set; }
4151

4252
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSNetworkInterfaceIpConfiguration.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,25 @@ namespace Microsoft.Azure.Commands.Network.Models
2020

2121
public class PSNetworkInterfaceIpConfiguration : PSChildResource
2222
{
23+
[JsonProperty(Order = 1)]
2324
public string PrivateIpAddress { get; set; }
2425

26+
[JsonProperty(Order = 1)]
2527
public string PrivateIpAllocationMethod { get; set; }
2628

29+
[JsonProperty(Order = 1)]
2730
public PSResourceId Subnet { get; set; }
2831

32+
[JsonProperty(Order = 1)]
2933
public PSResourceId PublicIpAddress { get; set; }
3034

35+
[JsonProperty(Order = 1)]
3136
public List<PSResourceId> LoadBalancerBackendAddressPools { get; set; }
3237

38+
[JsonProperty(Order = 1)]
3339
public List<PSResourceId> LoadBalancerInboundNatRules { get; set; }
3440

41+
[JsonProperty(Order = 1)]
3542
public string ProvisioningState { get; set; }
3643

3744
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSProbe.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,25 @@ namespace Microsoft.Azure.Commands.Network.Models
2121

2222
public class PSProbe : PSChildResource
2323
{
24+
[JsonProperty(Order = 1)]
2425
public List<PSResourceId> LoadBalancingRules { get; set; }
2526

27+
[JsonProperty(Order = 1)]
2628
public string Protocol { get; set; }
2729

30+
[JsonProperty(Order = 1)]
2831
public int Port { get; set; }
2932

33+
[JsonProperty(Order = 1)]
3034
public int IntervalInSeconds { get; set; }
3135

36+
[JsonProperty(Order = 1)]
3237
public int NumberOfProbes { get; set; }
3338

39+
[JsonProperty(Order = 1)]
3440
public string RequestPath { get; set; }
3541

42+
[JsonProperty(Order = 1)]
3643
public string ProvisioningState { get; set; }
3744

3845
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/Models/PSRoute.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@
1515

1616
namespace Microsoft.Azure.Commands.Network.Models
1717
{
18+
using Newtonsoft.Json;
19+
1820
public class PSRoute : PSChildResource
1921
{
22+
[JsonProperty(Order = 1)]
2023
public string AddressPrefix { get; set; }
21-
24+
25+
[JsonProperty(Order = 1)]
2226
public string NextHopType { get; set; }
2327

28+
[JsonProperty(Order = 1)]
2429
public string NextHopIpAddress { get; set; }
2530

31+
[JsonProperty(Order = 1)]
2632
public string ProvisioningState { get; set; }
2733
}
2834
}

src/ResourceManager/Network/Commands.Network/Models/PSSecurityRule.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,38 @@
1515

1616
namespace Microsoft.Azure.Commands.Network.Models
1717
{
18+
using Newtonsoft.Json;
19+
1820
public class PSSecurityRule : PSChildResource
1921
{
22+
[JsonProperty(Order = 1)]
2023
public string Description { get; set; }
2124

25+
[JsonProperty(Order = 1)]
2226
public string Protocol { get; set; }
2327

28+
[JsonProperty(Order = 1)]
2429
public string SourcePortRange { get; set; }
2530

31+
[JsonProperty(Order = 1)]
2632
public string DestinationPortRange { get; set; }
2733

34+
[JsonProperty(Order = 1)]
2835
public string SourceAddressPrefix { get; set; }
2936

37+
[JsonProperty(Order = 1)]
3038
public string DestinationAddressPrefix { get; set; }
3139

40+
[JsonProperty(Order = 1)]
3241
public string Access { get; set; }
3342

43+
[JsonProperty(Order = 1)]
3444
public int Priority { get; set; }
3545

46+
[JsonProperty(Order = 1)]
3647
public string Direction { get; set; }
3748

49+
[JsonProperty(Order = 1)]
3850
public string ProvisioningState { get; set; }
3951
}
4052
}

src/ResourceManager/Network/Commands.Network/Models/PSSubnet.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ namespace Microsoft.Azure.Commands.Network.Models
2020

2121
public class PSSubnet : PSChildResource
2222
{
23+
[JsonProperty(Order = 1)]
2324
public string AddressPrefix { get; set; }
2425

26+
[JsonProperty(Order = 1)]
2527
public List<PSResourceId> IpConfigurations { get; set; }
2628

29+
[JsonProperty(Order = 1)]
2730
public PSResourceId NetworkSecurityGroup { get; set; }
2831

32+
[JsonProperty(Order = 1)]
2933
public PSResourceId RouteTable { get; set; }
3034

35+
[JsonProperty(Order = 1)]
3136
public string ProvisioningState { get; set; }
3237

3338
[JsonIgnore]

src/ResourceManager/Network/Commands.Network/NetworkInterface/NewAzureNetworkInterfaceCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@ private PSNetworkInterface CreateNetworkInterface()
207207

208208
if (this.LoadBalancerBackendAddressPool != null)
209209
{
210+
this.LoadBalancerBackendAddressPoolId = new List<string>();
210211
foreach (var bepool in this.LoadBalancerBackendAddressPool)
211212
{
212-
this.LoadBalancerBackendAddressPoolId = new List<string>();
213213
this.LoadBalancerBackendAddressPoolId.Add(bepool.Id);
214214
}
215215
}
216216

217217
if (this.LoadBalancerInboundNatRule != null)
218218
{
219+
this.LoadBalancerInboundNatRuleId = new List<string>();
219220
foreach (var natRule in this.LoadBalancerInboundNatRule)
220221
{
221-
this.LoadBalancerInboundNatRuleId = new List<string>();
222222
this.LoadBalancerInboundNatRuleId.Add(natRule.Id);
223223
}
224224
}

src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
<Reference Include="Microsoft.Azure.Common.NetFramework">
5757
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5858
</Reference>
59-
<Reference Include="Microsoft.Azure.Management.Redis, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.1.0.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll</HintPath>
59+
<Reference Include="Microsoft.Azure.Management.Redis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60+
<SpecificVersion>False</SpecificVersion>
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.1.0.1-preview\lib\net40\Microsoft.Azure.Management.Redis.dll</HintPath>
6162
</Reference>
6263
<Reference Include="Microsoft.Azure.ResourceManager">
6364
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
@@ -162,13 +163,16 @@
162163
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
163164
</None>
164165
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
165-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
166+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
166167
</None>
167168
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCachePipeline.json">
168-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
169+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
169170
</None>
170171
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetNonExistingRedisCacheTest.json">
171-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
172+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173+
</None>
174+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetRedisCacheBugFixTest.json">
175+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
172176
</None>
173177
</ItemGroup>
174178
<ItemGroup>

src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,12 @@ public void TestRedisCachePipeline()
4040
{
4141
RunPowerShellTest("Test-RedisCachePipeline");
4242
}
43+
44+
[Fact]
45+
[Trait(Category.AcceptanceType, Category.CheckIn)]
46+
public void TestSetRedisCacheBugFixTest()
47+
{
48+
RunPowerShellTest("Test-SetRedisCacheBugFixTest");
49+
}
4350
}
4451
}

src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function Test-SetNonExistingRedisCacheTest
150150
$location = "North Central US"
151151

152152
# Creating Cache
153-
Assert-Throws {Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -MaxMemoryPolicy AllKeysLRU}
153+
Assert-Throws {Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -RedisConfiguration @{"maxmemory-policy" = "allkeys-random"} }
154154
}
155155

156156
<#
@@ -237,4 +237,25 @@ function Test-RedisCachePipeline
237237

238238
# Delete cache
239239
Assert-True {Get-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName | Remove-AzureRedisCache -Force -PassThru} "Remove cache failed."
240+
}
241+
242+
<#
243+
.SYNOPSIS
244+
Tests bug fix in set redis cache.
245+
#>
246+
function Test-SetRedisCacheBugFixTest
247+
{
248+
# Setup
249+
# resource group should exists
250+
$resourceGroupName = "Siddharth"
251+
$cacheName = "siddharthchatrola"
252+
$location = "North Central US"
253+
254+
# Updating Cache
255+
$cacheUpdated = Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -EnableNonSslPort $true
256+
Assert-True { $cacheUpdated.EnableNonSslPort }
257+
258+
$cacheUpdated2 = Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}
259+
Assert-AreEqual "allkeys-lru" $cacheUpdated2.RedisConfiguration.Item("maxmemory-policy")
260+
Assert-True { $cacheUpdated2.EnableNonSslPort }
240261
}

0 commit comments

Comments
 (0)