Skip to content

Commit

Permalink
Azure RedisCache New Api v2024.11.01 (Azure#26876)
Browse files Browse the repository at this point in the history
* 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]>
aandukuria and VeryEarly authored Dec 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b01f7ce commit e7d919d
Showing 30 changed files with 28,441 additions and 19,284 deletions.
Original file line number Diff line number Diff line change
@@ -88,6 +88,17 @@ public RedisCreateParameters()
/// Default value is false.
/// </param>

/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
/// will select availability zones passed in by you using the &#39;zones&#39;
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported.
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>

/// <param name="subnetId">The full resource ID of a subnet in a virtual network to deploy the Redis
/// cache in. Example format:
/// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
@@ -96,7 +107,7 @@ public RedisCreateParameters()
/// <param name="staticIP">Static IP address. Optionally, may be specified when deploying a Redis
/// cache inside an existing Azure Virtual Network; auto assigned by default.
/// </param>
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))
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))

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

/// <summary>
/// Gets or sets optional: Specifies how availability zones are allocated to
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
/// automatically select zones based on regional availability and capacity.
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
public string ZonalAllocationPolicy {get; set; }

/// <summary>
/// Gets or sets the full resource ID of a subnet in a virtual network to
/// deploy the Redis cache in. Example format:
@@ -286,6 +312,7 @@ public virtual void Validate()




if (this.SubnetId != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(this.SubnetId, "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$"))
Original file line number Diff line number Diff line change
@@ -104,6 +104,17 @@ public RedisResource()
/// Default value is false.
/// </param>

/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
/// will select availability zones passed in by you using the &#39;zones&#39;
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported.
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>

/// <param name="subnetId">The full resource ID of a subnet in a virtual network to deploy the Redis
/// cache in. Example format:
/// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
@@ -135,7 +146,7 @@ public RedisResource()
/// <param name="privateEndpointConnections">List of private endpoint connection associated with the specified redis
/// cache
/// </param>
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>))
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>))

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

/// <summary>
/// Gets or sets optional: Specifies how availability zones are allocated to
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
/// automatically select zones based on regional availability and capacity.
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
public string ZonalAllocationPolicy {get; set; }

/// <summary>
/// Gets or sets the full resource ID of a subnet in a virtual network to
/// deploy the Redis cache in. Example format:
@@ -366,6 +392,7 @@ public override void Validate()




if (this.SubnetId != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(this.SubnetId, "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$"))
Original file line number Diff line number Diff line change
@@ -80,7 +80,18 @@ public RedisUpdateParameters()
/// <param name="disableAccessKeyAuthentication">Authentication to Redis through access keys is disabled when set as true.
/// Default value is false.
/// </param>
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?))

/// <param name="zonalAllocationPolicy">Optional: Specifies how availability zones are allocated to the Redis
/// cache. &#39;Automatic&#39; enables zone redundancy and Azure will automatically
/// select zones based on regional availability and capacity. &#39;UserDefined&#39;
/// will select availability zones passed in by you using the &#39;zones&#39;
/// parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported.
/// Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;</param>
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))

{
this.Tags = tags;
@@ -97,6 +108,7 @@ public RedisUpdateParameters()
this.MinimumTlsVersion = minimumTlsVersion;
this.PublicNetworkAccess = publicNetworkAccess;
this.DisableAccessKeyAuthentication = disableAccessKeyAuthentication;
this.ZonalAllocationPolicy = zonalAllocationPolicy;
CustomInit();
}

@@ -204,6 +216,20 @@ public RedisUpdateParameters()
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableAccessKeyAuthentication")]
public bool? DisableAccessKeyAuthentication {get; set; }

/// <summary>
/// Gets or sets optional: Specifies how availability zones are allocated to
/// the Redis cache. &#39;Automatic&#39; enables zone redundancy and Azure will
/// automatically select zones based on regional availability and capacity.
/// &#39;UserDefined&#39; will select availability zones passed in by you using the
/// &#39;zones&#39; parameter. &#39;NoZones&#39; will produce a non-zonal cache. If
/// &#39;zonalAllocationPolicy&#39; is not passed, it will be set to &#39;UserDefined&#39; when
/// zones are passed in, otherwise, it will be set to &#39;Automatic&#39; in regions
/// where zones are supported and &#39;NoZones&#39; in regions where zones are not
/// supported. Possible values include: &#39;Automatic&#39;, &#39;UserDefined&#39;, &#39;NoZones&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalAllocationPolicy")]
public string ZonalAllocationPolicy {get; set; }
/// <summary>
/// Validate the object.
/// </summary>
@@ -227,6 +253,7 @@ public virtual void Validate()




}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Microsoft.Azure.Management.RedisCache.Models
{

/// <summary>
/// Defines values for ZonalAllocationPolicy.
/// </summary>


public static class ZonalAllocationPolicy
{
public const string Automatic = "Automatic";
public const string UserDefined = "UserDefined";
public const string NoZones = "NoZones";
}
}
Original file line number Diff line number Diff line change
@@ -346,7 +346,7 @@ private void Initialize()
this.AccessPolicy = new AccessPolicyOperations(this);
this.AccessPolicyAssignment = new AccessPolicyAssignmentOperations(this);
this.BaseUri = new System.Uri("https://management.azure.com");
this.ApiVersion = "2024-03-01";
this.ApiVersion = "2024-11-01";
this.AcceptLanguage = "en-US";
this.LongRunningOperationRetryTimeout = 30;
this.GenerateClientRequestId = true;
4 changes: 2 additions & 2 deletions src/RedisCache/RedisCache.Management.Sdk/README.md
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@ payload-flattening-threshold: 2
###
``` yaml
commit: ab064e0047ec560a700d6b501097d99471ad817b
commit: ada2aba3ac674ba632c07571421d64484230289a
input-file:
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/redis.json
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/redis.json

output-folder: Generated

Loading

0 comments on commit e7d919d

Please sign in to comment.