Skip to content

Commit 0863a9b

Browse files
author
Siddharth Chatrola
committed
Help updated and code review fixed
1 parent 160916d commit 0863a9b

File tree

5 files changed

+167
-26
lines changed

5 files changed

+167
-26
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,18 @@
171171
<None Include="ScenarioTests\RedisCacheTests.ps1">
172172
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173173
</None>
174+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestCreateExistingRedisCacheTest.json">
175+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
176+
</None>
174177
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
175178
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
176179
</None>
180+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCacheClustering.json">
181+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
182+
</None>
183+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCacheParameterDeprecated.json">
184+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
185+
</None>
177186
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCachePipeline.json">
178187
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
179188
</None>

src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml

Lines changed: 101 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@
305305
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
306306
<maml:name>Size</maml:name>
307307
<maml:description>
308-
<maml:para>Size of the redis cache. The default value is 1GB or C1. Possible values are C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
308+
<maml:para>Size of the redis cache. The default value is 1GB or C1. Possible values are P1,P2, P3, P4, C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
309309
</maml:description>
310310
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
311311
</command:parameter>
312312
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
313313
<maml:name>Sku</maml:name>
314314
<maml:description>
315-
<maml:para>Sku of redis cache. The default value is Standard. Possible values are Basic and Standard.</maml:para>
315+
<maml:para>Sku of redis cache. The default value is Standard. Possible values are Basic, Standard and Premium.</maml:para>
316316
</maml:description>
317317
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
318318
</command:parameter>
@@ -337,6 +337,34 @@
337337
</maml:description>
338338
<command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue>
339339
</command:parameter>
340+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
341+
<maml:name>ShardCount</maml:name>
342+
<maml:description>
343+
<maml:para>The number of shards to create on a Premium Cluster Cache.</maml:para>
344+
</maml:description>
345+
<command:parameterValue required="true" variableLength="false">Integer</command:parameterValue>
346+
</command:parameter>
347+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
348+
<maml:name>VirtualNetwork</maml:name>
349+
<maml:description>
350+
<maml:para>The exact ARM resource ID of the virtual network to deploy the redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1</maml:para>
351+
</maml:description>
352+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
353+
</command:parameter>
354+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
355+
<maml:name>Subnet</maml:name>
356+
<maml:description>
357+
<maml:para>Required when deploying a redis cache inside an existing Azure Virtual Network.</maml:para>
358+
</maml:description>
359+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
360+
</command:parameter>
361+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
362+
<maml:name>StaticIP</maml:name>
363+
<maml:description>
364+
<maml:para>Required when deploying a redis cache inside an existing Azure Virtual Network.</maml:para>
365+
</maml:description>
366+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
367+
</command:parameter>
340368
</command:syntaxItem>
341369
</command:syntax>
342370
<command:parameters>
@@ -394,7 +422,7 @@
394422
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
395423
<maml:name>Size</maml:name>
396424
<maml:description>
397-
<maml:para>Size of the redis cache. The default value is 1GB or C1. Possible values are C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
425+
<maml:para>Size of the redis cache. The default value is 1GB or C1. Possible values are P1,P2, P3, P4, C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
398426
</maml:description>
399427
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
400428
<dev:type>
@@ -406,7 +434,7 @@
406434
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
407435
<maml:name>Sku</maml:name>
408436
<maml:description>
409-
<maml:para>Sku of the redis cache. The default value is Standard. Possible values are Basic and Standard.</maml:para>
437+
<maml:para>Sku of redis cache. The default value is Standard. Possible values are Basic, Standard and Premium.</maml:para>
410438
</maml:description>
411439
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
412440
<dev:type>
@@ -451,6 +479,54 @@
451479
</dev:type>
452480
<dev:defaultValue></dev:defaultValue>
453481
</command:parameter>
482+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
483+
<maml:name>ShardCount</maml:name>
484+
<maml:description>
485+
<maml:para>The number of shards to create on a Premium Cluster Cache.</maml:para>
486+
</maml:description>
487+
<command:parameterValue required="true" variableLength="false">Integer</command:parameterValue>
488+
<dev:type>
489+
<maml:name>Integer</maml:name>
490+
<maml:uri />
491+
</dev:type>
492+
<dev:defaultValue></dev:defaultValue>
493+
</command:parameter>
494+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
495+
<maml:name>VirtualNetwork</maml:name>
496+
<maml:description>
497+
<maml:para>The exact ARM resource ID of the virtual network to deploy the redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1</maml:para>
498+
</maml:description>
499+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
500+
<dev:type>
501+
<maml:name>String</maml:name>
502+
<maml:uri />
503+
</dev:type>
504+
<dev:defaultValue></dev:defaultValue>
505+
</command:parameter>
506+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
507+
<maml:name>Subnet</maml:name>
508+
<maml:description>
509+
<maml:para>Required when deploying a redis cache inside an existing Azure Virtual Network.</maml:para>
510+
</maml:description>
511+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
512+
<dev:type>
513+
<maml:name>String</maml:name>
514+
<maml:uri />
515+
</dev:type>
516+
<dev:defaultValue></dev:defaultValue>
517+
</command:parameter>
518+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
519+
<maml:name>StaticIP</maml:name>
520+
<maml:description>
521+
<maml:para>Required when deploying a redis cache inside an existing Azure Virtual Network.</maml:para>
522+
</maml:description>
523+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
524+
<dev:type>
525+
<maml:name>String</maml:name>
526+
<maml:uri />
527+
</dev:type>
528+
<dev:defaultValue></dev:defaultValue>
529+
</command:parameter>
454530
</command:parameters>
455531
<command:inputTypes>
456532
<command:inputType>
@@ -1096,14 +1172,14 @@
10961172
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
10971173
<maml:name>Size</maml:name>
10981174
<maml:description>
1099-
<maml:para>Size of the redis cache. Possible values are C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
1175+
<maml:para>Size of the redis cache. The default value is 1GB or C1. Possible values are P1,P2, P3, P4, C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB.</maml:para>
11001176
</maml:description>
11011177
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
11021178
</command:parameter>
11031179
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
11041180
<maml:name>Sku</maml:name>
11051181
<maml:description>
1106-
<maml:para>Sku of redis cache. Possible values are Basic and Standard.</maml:para>
1182+
<maml:para>Sku of redis cache. The default value is Standard. Possible values are Basic, Standard and Premium.</maml:para>
11071183
</maml:description>
11081184
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
11091185
</command:parameter>
@@ -1128,6 +1204,13 @@
11281204
</maml:description>
11291205
<command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue>
11301206
</command:parameter>
1207+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
1208+
<maml:name>ShardCount</maml:name>
1209+
<maml:description>
1210+
<maml:para>The number of shards to create on a Premium Cluster Cache.</maml:para>
1211+
</maml:description>
1212+
<command:parameterValue required="true" variableLength="false">Integer</command:parameterValue>
1213+
</command:parameter>
11311214
</command:syntaxItem>
11321215
</command:syntax>
11331216
<command:parameters>
@@ -1217,6 +1300,18 @@
12171300
</dev:type>
12181301
<dev:defaultValue></dev:defaultValue>
12191302
</command:parameter>
1303+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="">
1304+
<maml:name>ShardCount</maml:name>
1305+
<maml:description>
1306+
<maml:para>The number of shards to create on a Premium Cluster Cache.</maml:para>
1307+
</maml:description>
1308+
<command:parameterValue required="true" variableLength="false">Integer</command:parameterValue>
1309+
<dev:type>
1310+
<maml:name>Integer</maml:name>
1311+
<maml:uri />
1312+
</dev:type>
1313+
<dev:defaultValue></dev:defaultValue>
1314+
</command:parameter>
12201315
</command:parameters>
12211316
<command:inputTypes>
12221317
<command:inputType>

src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.format.ps1xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@
6666
<Label>ResourceGroupName</Label>
6767
<PropertyName>ResourceGroupName</PropertyName>
6868
</ListItem>
69+
<ListItem>
70+
<Label>VirtualNetwork</Label>
71+
<PropertyName>VirtualNetwork</PropertyName>
72+
</ListItem>
73+
<ListItem>
74+
<Label>Subnet</Label>
75+
<PropertyName>Subnet</PropertyName>
76+
</ListItem>
77+
<ListItem>
78+
<Label>StaticIP</Label>
79+
<PropertyName>StaticIP</PropertyName>
80+
</ListItem>
81+
<ListItem>
82+
<Label>TenantSettings</Label>
83+
<PropertyName>TenantSettings</PropertyName>
84+
</ListItem>
85+
<ListItem>
86+
<Label>ShardCount</Label>
87+
<PropertyName>ShardCount</PropertyName>
88+
</ListItem>
6989
</ListItems>
7090
</ListEntry>
7191
</ListEntries>
@@ -144,6 +164,26 @@
144164
<Label>SecondaryKey</Label>
145165
<PropertyName>SecondaryKey</PropertyName>
146166
</ListItem>
167+
<ListItem>
168+
<Label>VirtualNetwork</Label>
169+
<PropertyName>VirtualNetwork</PropertyName>
170+
</ListItem>
171+
<ListItem>
172+
<Label>Subnet</Label>
173+
<PropertyName>Subnet</PropertyName>
174+
</ListItem>
175+
<ListItem>
176+
<Label>StaticIP</Label>
177+
<PropertyName>StaticIP</PropertyName>
178+
</ListItem>
179+
<ListItem>
180+
<Label>TenantSettings</Label>
181+
<PropertyName>TenantSettings</PropertyName>
182+
</ListItem>
183+
<ListItem>
184+
<Label>ShardCount</Label>
185+
<PropertyName>ShardCount</PropertyName>
186+
</ListItem>
147187
</ListItems>
148188
</ListEntry>
149189
</ListEntries>

src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ public RedisCreateOrUpdateResponse CreateOrUpdateCache(string resourceGroupName,
7171
}
7272
}
7373

74-
if (shardCount.HasValue)
75-
{
76-
parameters.Properties.ShardCount = shardCount.Value;
77-
}
78-
74+
parameters.Properties.ShardCount = shardCount;
75+
7976
if (!string.IsNullOrWhiteSpace(virtualNetwork))
8077
{
8178
parameters.Properties.VirtualNetwork = virtualNetwork;

src/ResourceManager/RedisCache/Commands.RedisCache/Models/SizeConverter.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Microsoft.Azure.Commands.RedisCache.Models
1616
{
1717
using System.Collections.Generic;
1818

19-
public static class SizeConverter
19+
internal static class SizeConverter
2020
{
2121
public const string MB250 = "250MB";
2222
public const string GB1 = "1GB";
@@ -39,18 +39,18 @@ public static class SizeConverter
3939
public const string P3String = "P3";
4040
public const string P4String = "P4";
4141

42-
private static Dictionary<string, string> skuStringToAztualSize = new Dictionary<string, string>{
43-
{C0String,MB250},
44-
{C1String,GB1},
45-
{C2String,GB2_5},
46-
{C3String,GB6},
47-
{C4String,GB13},
48-
{C5String,GB26},
49-
{C6String,GB53},
50-
{P1String,GB6},
51-
{P2String,GB13},
52-
{P3String,GB26},
53-
{P4String,GB53}
42+
private static Dictionary<string, string> skuStringToActualSize = new Dictionary<string, string>{
43+
{ C0String, MB250 },
44+
{ C1String, GB1 },
45+
{ C2String, GB2_5 },
46+
{ C3String, GB6 },
47+
{ C4String, GB13 },
48+
{ C5String, GB26 },
49+
{ C6String, GB53 },
50+
{ P1String, GB6 },
51+
{ P2String, GB13 },
52+
{ P3String, GB26 },
53+
{ P4String, GB53 }
5454
};
5555

5656
public static string GetSizeInRedisSpecificFormat(string actualSizeFromUser, bool isPremiumCache)
@@ -109,9 +109,9 @@ public static string GetSizeInRedisSpecificFormat(string actualSizeFromUser, boo
109109
public static string GetSizeInUserSpecificFormat(string skuFamily, int skuCapacity)
110110
{
111111
string sizeConstant = skuFamily + skuCapacity.ToString();
112-
if (skuStringToAztualSize.ContainsKey(sizeConstant))
112+
if (skuStringToActualSize.ContainsKey(sizeConstant))
113113
{
114-
return skuStringToAztualSize[sizeConstant];
114+
return skuStringToActualSize[sizeConstant];
115115
}
116116
return GB1;
117117
}

0 commit comments

Comments
 (0)