Skip to content

Commit e7d919d

Browse files
Azure RedisCache New Api v2024.11.01 (#26876)
* Generate new api version code * Update cmdlets * Update help docs * Add tests for zonalallocationpolicy * executed all tests * updated ChangeLog.md * Update TestImportExportRebootClear.json --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent b01f7ce commit e7d919d

30 files changed

+28441
-19284
lines changed

src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCreateParameters.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ public RedisCreateParameters()
8888
/// Default value is false.
8989
/// </param>
9090

91+
/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
92+
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
93+
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
94+
/// will select availability zones passed in by you using the &#39;zones&#39;
95+
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
96+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
97+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
98+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
99+
/// supported.
100+
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>
101+
91102
/// <param name="subnetId">The full resource ID of a subnet in a virtual network to deploy the Redis
92103
/// cache in. Example format:
93104
/// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
@@ -96,7 +107,7 @@ public RedisCreateParameters()
96107
/// <param name="staticIP">Static IP address. Optionally, may be specified when deploying a Redis
97108
/// cache inside an existing Azure Virtual Network; auto assigned by default.
98109
/// </param>
99-
public RedisCreateParameters(string location, Sku sku, System.Collections.Generic.IList<string> zones = default(System.Collections.Generic.IList<string>), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?), string subnetId = default(string), string staticIP = default(string))
110+
public RedisCreateParameters(string location, Sku sku, System.Collections.Generic.IList<string> zones = default(System.Collections.Generic.IList<string>), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?), string zonalAllocationPolicy = default(string), string subnetId = default(string), string staticIP = default(string))
100111

101112
{
102113
this.Zones = zones;
@@ -115,6 +126,7 @@ public RedisCreateParameters()
115126
this.MinimumTlsVersion = minimumTlsVersion;
116127
this.PublicNetworkAccess = publicNetworkAccess;
117128
this.DisableAccessKeyAuthentication = disableAccessKeyAuthentication;
129+
this.ZonalAllocationPolicy = zonalAllocationPolicy;
118130
this.SubnetId = subnetId;
119131
this.StaticIP = staticIP;
120132
CustomInit();
@@ -238,6 +250,20 @@ public RedisCreateParameters()
238250
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableAccessKeyAuthentication")]
239251
public bool? DisableAccessKeyAuthentication {get; set; }
240252

253+
/// <summary>
254+
/// Gets or sets optional: Specifies how availability zones are allocated to
255+
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
256+
/// automatically select zones based on regional availability and capacity.
257+
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
258+
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
259+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
260+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
261+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
262+
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
263+
/// </summary>
264+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
265+
public string ZonalAllocationPolicy {get; set; }
266+
241267
/// <summary>
242268
/// Gets or sets the full resource ID of a subnet in a virtual network to
243269
/// deploy the Redis cache in. Example format:
@@ -286,6 +312,7 @@ public virtual void Validate()
286312

287313

288314

315+
289316
if (this.SubnetId != null)
290317
{
291318
if (!System.Text.RegularExpressions.Regex.IsMatch(this.SubnetId, "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$"))

src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisResource.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ public RedisResource()
104104
/// Default value is false.
105105
/// </param>
106106

107+
/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
108+
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
109+
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
110+
/// will select availability zones passed in by you using the &#39;zones&#39;
111+
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
112+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
113+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
114+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
115+
/// supported.
116+
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>
117+
107118
/// <param name="subnetId">The full resource ID of a subnet in a virtual network to deploy the Redis
108119
/// cache in. Example format:
109120
/// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
@@ -135,7 +146,7 @@ public RedisResource()
135146
/// <param name="privateEndpointConnections">List of private endpoint connection associated with the specified redis
136147
/// cache
137148
/// </param>
138-
public RedisResource(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), System.Collections.Generic.IList<string> zones = default(System.Collections.Generic.IList<string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), string provisioningState = default(string), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?), string subnetId = default(string), string staticIP = default(string), string hostName = default(string), int? port = default(int?), int? sslPort = default(int?), RedisAccessKeys accessKeys = default(RedisAccessKeys), System.Collections.Generic.IList<RedisLinkedServer> linkedServers = default(System.Collections.Generic.IList<RedisLinkedServer>), System.Collections.Generic.IList<RedisInstanceDetails> instances = default(System.Collections.Generic.IList<RedisInstanceDetails>), System.Collections.Generic.IList<PrivateEndpointConnection> privateEndpointConnections = default(System.Collections.Generic.IList<PrivateEndpointConnection>))
149+
public RedisResource(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), System.Collections.Generic.IList<string> zones = default(System.Collections.Generic.IList<string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), string provisioningState = default(string), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?), string zonalAllocationPolicy = default(string), string subnetId = default(string), string staticIP = default(string), string hostName = default(string), int? port = default(int?), int? sslPort = default(int?), RedisAccessKeys accessKeys = default(RedisAccessKeys), System.Collections.Generic.IList<RedisLinkedServer> linkedServers = default(System.Collections.Generic.IList<RedisLinkedServer>), System.Collections.Generic.IList<RedisInstanceDetails> instances = default(System.Collections.Generic.IList<RedisInstanceDetails>), System.Collections.Generic.IList<PrivateEndpointConnection> privateEndpointConnections = default(System.Collections.Generic.IList<PrivateEndpointConnection>))
139150

140151
: base(location, id, name, type, tags)
141152
{
@@ -154,6 +165,7 @@ public RedisResource()
154165
this.MinimumTlsVersion = minimumTlsVersion;
155166
this.PublicNetworkAccess = publicNetworkAccess;
156167
this.DisableAccessKeyAuthentication = disableAccessKeyAuthentication;
168+
this.ZonalAllocationPolicy = zonalAllocationPolicy;
157169
this.SubnetId = subnetId;
158170
this.StaticIP = staticIP;
159171
this.HostName = hostName;
@@ -278,6 +290,20 @@ public RedisResource()
278290
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableAccessKeyAuthentication")]
279291
public bool? DisableAccessKeyAuthentication {get; set; }
280292

293+
/// <summary>
294+
/// Gets or sets optional: Specifies how availability zones are allocated to
295+
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
296+
/// automatically select zones based on regional availability and capacity.
297+
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
298+
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
299+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
300+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
301+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
302+
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
303+
/// </summary>
304+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
305+
public string ZonalAllocationPolicy {get; set; }
306+
281307
/// <summary>
282308
/// Gets or sets the full resource ID of a subnet in a virtual network to
283309
/// deploy the Redis cache in. Example format:
@@ -366,6 +392,7 @@ public override void Validate()
366392

367393

368394

395+
369396
if (this.SubnetId != null)
370397
{
371398
if (!System.Text.RegularExpressions.Regex.IsMatch(this.SubnetId, "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$"))

src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisUpdateParameters.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,18 @@ public RedisUpdateParameters()
8080
/// <param name="disableAccessKeyAuthentication">Authentication to Redis through access keys is disabled when set as true.
8181
/// Default value is false.
8282
/// </param>
83-
public RedisUpdateParameters(System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), Sku sku = default(Sku), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?))
83+
84+
/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
85+
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
86+
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
87+
/// will select availability zones passed in by you using the &#39;zones&#39;
88+
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
89+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
90+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
91+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
92+
/// supported.
93+
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>
94+
public RedisUpdateParameters(System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string updateChannel = default(string), Sku sku = default(Sku), RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary<string, string> tenantSettings = default(System.Collections.Generic.IDictionary<string, string>), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), bool? disableAccessKeyAuthentication = default(bool?), string zonalAllocationPolicy = default(string))
8495

8596
{
8697
this.Tags = tags;
@@ -97,6 +108,7 @@ public RedisUpdateParameters()
97108
this.MinimumTlsVersion = minimumTlsVersion;
98109
this.PublicNetworkAccess = publicNetworkAccess;
99110
this.DisableAccessKeyAuthentication = disableAccessKeyAuthentication;
111+
this.ZonalAllocationPolicy = zonalAllocationPolicy;
100112
CustomInit();
101113
}
102114

@@ -204,6 +216,20 @@ public RedisUpdateParameters()
204216
/// </summary>
205217
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableAccessKeyAuthentication")]
206218
public bool? DisableAccessKeyAuthentication {get; set; }
219+
220+
/// <summary>
221+
/// Gets or sets optional: Specifies how availability zones are allocated to
222+
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
223+
/// automatically select zones based on regional availability and capacity.
224+
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
225+
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
226+
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
227+
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
228+
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
229+
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
230+
/// </summary>
231+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
232+
public string ZonalAllocationPolicy {get; set; }
207233
/// <summary>
208234
/// Validate the object.
209235
/// </summary>
@@ -227,6 +253,7 @@ public virtual void Validate()
227253

228254

229255

256+
230257
}
231258
}
232259
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.RedisCache.Models
7+
{
8+
9+
/// <summary>
10+
/// Defines values for ZonalAllocationPolicy.
11+
/// </summary>
12+
13+
14+
public static class ZonalAllocationPolicy
15+
{
16+
public const string Automatic = "Automatic";
17+
public const string UserDefined = "UserDefined";
18+
public const string NoZones = "NoZones";
19+
}
20+
}

src/RedisCache/RedisCache.Management.Sdk/Generated/RedisManagementClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private void Initialize()
346346
this.AccessPolicy = new AccessPolicyOperations(this);
347347
this.AccessPolicyAssignment = new AccessPolicyAssignmentOperations(this);
348348
this.BaseUri = new System.Uri("https://management.azure.com");
349-
this.ApiVersion = "2024-03-01";
349+
this.ApiVersion = "2024-11-01";
350350
this.AcceptLanguage = "en-US";
351351
this.LongRunningOperationRetryTimeout = 30;
352352
this.GenerateClientRequestId = true;

src/RedisCache/RedisCache.Management.Sdk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ payload-flattening-threshold: 2
2323
2424
###
2525
``` yaml
26-
commit: ab064e0047ec560a700d6b501097d99471ad817b
26+
commit: ada2aba3ac674ba632c07571421d64484230289a
2727
input-file:
28-
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/redis.json
28+
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/redis.json
2929

3030
output-folder: Generated
3131

0 commit comments

Comments
 (0)