Skip to content

Commit b5b6cf3

Browse files
nikitagarg123Nikita Garg
andauthored
[Redis-Enterprise] 2025-05-01-preview api changes (#8710)
* 2025-05-01-preview api changes * add changelog and version * version update * update example * version fix * linter fix * changelog correct version --------- Co-authored-by: Nikita Garg <nikitagarg@microsoft.com>
1 parent 9b102ec commit b5b6cf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7955
-6249
lines changed

src/redisenterprise/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.2.1
7+
- Added support for listing all SKUs a cluster can scale to.
8+
- Added a new enum: NoCluster for Clustering policy.
9+
610
1.2.1b2
711
+++++++++
812
- Update module documentation.

src/redisenterprise/azext_redisenterprise/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def load_arguments(self, _):
8181
c.argument('port', type=int, help='TCP port of the database endpoint. Specified at create time. Defaults to an '
8282
'available port.')
8383
c.argument('access_keys_authentication', options_list=['--access-keys-auth', '--access-keys-authentication'], arg_type=get_enum_type(['Enabled', 'Disabled']), help='Access database using keys - default is enabled. This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created.')
84-
c.argument('clustering_policy', arg_type=get_enum_type(['EnterpriseCluster', 'OSSCluster']), help='Clustering policy - default '
84+
c.argument('clustering_policy', arg_type=get_enum_type(['EnterpriseCluster', 'OSSCluster', 'NoCluster']), help='Clustering policy - default '
8585
'is OSSCluster. Specified at create time.')
8686
c.argument('eviction_policy', arg_type=get_enum_type(['AllKeysLFU', 'AllKeysLRU', 'AllKeysRandom',
8787
'VolatileLRU', 'VolatileLFU', 'VolatileTTL',
@@ -162,7 +162,7 @@ def load_arguments(self, _):
162162
c.argument('access_keys_authentication', options_list=['--access-keys-auth', '--access-keys-authentication'], arg_type=get_enum_type(['Enabled', 'Disabled']), help='Access database using keys - default is enabled. This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created.')
163163
c.argument('port', type=int, help='TCP port of the database endpoint. Specified at create time. Defaults to an '
164164
'available port.')
165-
c.argument('clustering_policy', arg_type=get_enum_type(['EnterpriseCluster', 'OSSCluster']), help='Clustering '
165+
c.argument('clustering_policy', arg_type=get_enum_type(['EnterpriseCluster', 'OSSCluster', 'NoCluster']), help='Clustering '
166166
'policy - default is OSSCluster. Specified at create time.')
167167
c.argument('eviction_policy', arg_type=get_enum_type(['AllKeysLFU', 'AllKeysLRU', 'AllKeysRandom',
168168
'VolatileLRU', 'VolatileLFU', 'VolatileTTL',

src/redisenterprise/azext_redisenterprise/aaz/latest/redisenterprise/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ._create import *
1313
from ._delete import *
1414
from ._list import *
15+
from ._list_skus_for_scaling import *
1516
from ._show import *
1617
from ._update import *
1718
from ._wait import *

src/redisenterprise/azext_redisenterprise/aaz/latest/redisenterprise/_create.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class Create(AAZCommand):
1919
"""
2020

2121
_aaz_info = {
22-
"version": "2024-09-01-preview",
22+
"version": "2025-05-01-preview",
2323
"resources": [
24-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2024-09-01-preview"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2025-05-01-preview"],
2525
]
2626
}
2727

@@ -47,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4747
help="The name of the RedisEnterprise cluster.",
4848
required=True,
4949
fmt=AAZStrArgFormat(
50-
pattern="^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$",
50+
pattern="^(?=.{1,60}$)[A-Za-z0-9]+(-[A-Za-z0-9]+)*$",
5151
),
5252
)
5353
_args_schema.resource_group = AAZResourceGroupNameArg(
@@ -66,18 +66,33 @@ def _build_arguments_schema(cls, *args, **kwargs):
6666
# define Arg Group "Identity"
6767

6868
_args_schema = cls._args_schema
69+
_args_schema.mi_system_assigned = AAZStrArg(
70+
options=["--system-assigned", "--mi-system-assigned"],
71+
arg_group="Identity",
72+
help="Set the system managed identity.",
73+
blank="True",
74+
)
6975
_args_schema.identity_type = AAZStrArg(
7076
options=["--identity-type"],
7177
arg_group="Identity",
7278
help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
7379
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"},
7480
)
81+
_args_schema.mi_user_assigned = AAZListArg(
82+
options=["--user-assigned", "--mi-user-assigned"],
83+
arg_group="Identity",
84+
help="Set the user managed identities.",
85+
blank=[],
86+
)
7587
_args_schema.user_assigned_identities = AAZDictArg(
7688
options=["--assigned-identities", "--user-assigned-identities"],
7789
arg_group="Identity",
7890
help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.",
7991
)
8092

93+
mi_user_assigned = cls._args_schema.mi_user_assigned
94+
mi_user_assigned.Element = AAZStrArg()
95+
8196
user_assigned_identities = cls._args_schema.user_assigned_identities
8297
user_assigned_identities.Element = AAZObjectArg(
8398
blank={},
@@ -95,7 +110,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
95110
_args_schema.user_assigned_identity_resource_id = AAZStrArg(
96111
options=["--identity-resource-id", "--user-assigned-identity-resource-id"],
97112
arg_group="KeyEncryptionKeyIdentity",
98-
help="User assigned identity to use for accessing key encryption key Url. Ex: `/subscriptions/<sub uuid>/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId`.",
113+
help="User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/<sub uuid>/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId.",
99114
)
100115

101116
# define Arg Group "Parameters"
@@ -133,7 +148,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
133148
options=["--high-availability"],
134149
arg_group="Properties",
135150
help="Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss.",
136-
is_preview=True,
137151
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
138152
)
139153
_args_schema.minimum_tls_version = AAZStrArg(
@@ -241,7 +255,7 @@ def url_parameters(self):
241255
def query_parameters(self):
242256
parameters = {
243257
**self.serialize_query_param(
244-
"api-version", "2024-09-01-preview",
258+
"api-version", "2025-05-01-preview",
245259
required=True,
246260
),
247261
}
@@ -266,7 +280,7 @@ def content(self):
266280
typ=AAZObjectType,
267281
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
268282
)
269-
_builder.set_prop("identity", AAZObjectType)
283+
_builder.set_prop("identity", AAZIdentityObjectType)
270284
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
271285
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
272286
_builder.set_prop("sku", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
@@ -277,11 +291,17 @@ def content(self):
277291
if identity is not None:
278292
identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}})
279293
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
294+
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
295+
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})
280296

281297
user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
282298
if user_assigned_identities is not None:
283299
user_assigned_identities.set_elements(AAZObjectType, ".")
284300

301+
user_assigned = _builder.get(".identity.userAssigned")
302+
if user_assigned is not None:
303+
user_assigned.set_elements(AAZStrType, ".")
304+
285305
properties = _builder.get(".properties")
286306
if properties is not None:
287307
properties.set_prop("encryption", AAZObjectType)
@@ -338,7 +358,10 @@ def _build_schema_on_200_201(cls):
338358
_schema_on_200_201.id = AAZStrType(
339359
flags={"read_only": True},
340360
)
341-
_schema_on_200_201.identity = AAZObjectType()
361+
_schema_on_200_201.identity = AAZIdentityObjectType()
362+
_schema_on_200_201.kind = AAZStrType(
363+
flags={"read_only": True},
364+
)
342365
_schema_on_200_201.location = AAZStrType(
343366
flags={"required": True},
344367
)

src/redisenterprise/azext_redisenterprise/aaz/latest/redisenterprise/_delete.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class Delete(AAZCommand):
2020
"""
2121

2222
_aaz_info = {
23-
"version": "2024-09-01-preview",
23+
"version": "2025-05-01-preview",
2424
"resources": [
25-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2024-09-01-preview"],
25+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2025-05-01-preview"],
2626
]
2727
}
2828

@@ -49,7 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4949
required=True,
5050
id_part="name",
5151
fmt=AAZStrArgFormat(
52-
pattern="^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$",
52+
pattern="^(?=.{1,60}$)[A-Za-z0-9]+(-[A-Za-z0-9]+)*$",
5353
),
5454
)
5555
_args_schema.resource_group = AAZResourceGroupNameArg(
@@ -143,7 +143,7 @@ def url_parameters(self):
143143
def query_parameters(self):
144144
parameters = {
145145
**self.serialize_query_param(
146-
"api-version", "2024-09-01-preview",
146+
"api-version", "2025-05-01-preview",
147147
required=True,
148148
),
149149
}

0 commit comments

Comments
 (0)