Skip to content

Commit

Permalink
Add support for new SKUs and entra id feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyankar gupta committed Sep 23, 2024
1 parent 4efd89e commit 35373d5
Show file tree
Hide file tree
Showing 23 changed files with 1,813 additions and 259 deletions.
10 changes: 3 additions & 7 deletions src/redisenterprise/azext_redisenterprise/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ def load_arguments(self, _):
c.argument('tags', tags_type)
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
validator=get_default_location_from_resource_group)
c.argument('sku', arg_type=get_enum_type(['Enterprise_E1', 'Enterprise_E5', 'Enterprise_E10', 'Enterprise_E20', 'Enterprise_E50',
'Enterprise_E100', 'Enterprise_E200', 'Enterprise_E400', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700',
'EnterpriseFlash_F1500']), help='The type of RedisEnterprise cluster '
c.argument('sku', arg_type=get_enum_type(['Balanced_B0', 'Balanced_B1', 'Balanced_B10', 'Balanced_B100', 'Balanced_B1000', 'Balanced_B150', 'Balanced_B20', 'Balanced_B250', 'Balanced_B3', 'Balanced_B350', 'Balanced_B5', 'Balanced_B50', 'Balanced_B500', 'Balanced_B700', 'ComputeOptimized_X10', 'ComputeOptimized_X100', 'ComputeOptimized_X150', 'ComputeOptimized_X20', 'ComputeOptimized_X250', 'ComputeOptimized_X3', 'ComputeOptimized_X350', 'ComputeOptimized_X5', 'ComputeOptimized_X50', 'ComputeOptimized_X500', 'ComputeOptimized_X700', 'EnterpriseFlash_F1500', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', 'Enterprise_E1', 'Enterprise_E10', 'Enterprise_E100', 'Enterprise_E20', 'Enterprise_E200', 'Enterprise_E400', 'Enterprise_E5', 'Enterprise_E50', 'FlashOptimized_A1000', 'FlashOptimized_A1500', 'FlashOptimized_A2000', 'FlashOptimized_A250', 'FlashOptimized_A4500', 'FlashOptimized_A500', 'FlashOptimized_A700', 'MemoryOptimized_M10', 'MemoryOptimized_M100', 'MemoryOptimized_M1000', 'MemoryOptimized_M150', 'MemoryOptimized_M1500', 'MemoryOptimized_M20', 'MemoryOptimized_M2000', 'MemoryOptimized_M250', 'MemoryOptimized_M350', 'MemoryOptimized_M50', 'MemoryOptimized_M500', 'MemoryOptimized_M700']), help='The type of RedisEnterprise cluster '
'to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.)')
c.argument('capacity', type=int, help='The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending '
'on SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs.')
Expand Down Expand Up @@ -102,10 +100,8 @@ def load_arguments(self, _):
c.argument('resource_group_name', resource_group_name_type)
c.argument('cluster_name', options_list=['--cluster-name', '--name', '-n'], type=str, help='The name of the '
'RedisEnterprise cluster.', id_part='name')
c.argument('sku', arg_type=get_enum_type(['Enterprise_E1', 'Enterprise_E5', 'Enterprise_E10', 'Enterprise_E20', 'Enterprise_E50',
'Enterprise_E100', 'Enterprise_E200', 'Enterprise_E400', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700',
'EnterpriseFlash_F1500']), help='The type of RedisEnterprise cluster '
'to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.)')
c.argument('sku', arg_type=get_enum_type(['Balanced_B0', 'Balanced_B1', 'Balanced_B10', 'Balanced_B100', 'Balanced_B1000', 'Balanced_B150', 'Balanced_B20', 'Balanced_B250', 'Balanced_B3', 'Balanced_B350', 'Balanced_B5', 'Balanced_B50', 'Balanced_B500', 'Balanced_B700', 'ComputeOptimized_X10', 'ComputeOptimized_X100', 'ComputeOptimized_X150', 'ComputeOptimized_X20', 'ComputeOptimized_X250', 'ComputeOptimized_X3', 'ComputeOptimized_X350', 'ComputeOptimized_X5', 'ComputeOptimized_X50', 'ComputeOptimized_X500', 'ComputeOptimized_X700', 'EnterpriseFlash_F1500', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', 'Enterprise_E1', 'Enterprise_E10', 'Enterprise_E100', 'Enterprise_E20', 'Enterprise_E200', 'Enterprise_E400', 'Enterprise_E5', 'Enterprise_E50', 'FlashOptimized_A1000', 'FlashOptimized_A1500', 'FlashOptimized_A2000', 'FlashOptimized_A250', 'FlashOptimized_A4500', 'FlashOptimized_A500', 'FlashOptimized_A700', 'MemoryOptimized_M10', 'MemoryOptimized_M100', 'MemoryOptimized_M1000', 'MemoryOptimized_M150', 'MemoryOptimized_M1500', 'MemoryOptimized_M20', 'MemoryOptimized_M2000', 'MemoryOptimized_M250', 'MemoryOptimized_M350', 'MemoryOptimized_M50', 'MemoryOptimized_M500', 'MemoryOptimized_M700']), help='The type of RedisEnterprise cluster '
'to deploy. Possible values: (Balanced_B1, ComputeOptimized_X10, MemoryOptimized_M10, Enterprise_E10, EnterpriseFlash_F300 etc.)')
c.argument('capacity', type=int, help='The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending '
'on SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs.')
c.argument('tags', tags_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2023-03-01-preview",
"version": "2024-09-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2023-03-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2024-09-01-preview"],
]
}

Expand All @@ -46,6 +46,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["-n", "--name", "--cluster-name"],
help="The name of the RedisEnterprise cluster.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[A-Za-z0-9]{1,60}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -126,6 +129,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.high_availability = AAZStrArg(
options=["--high-availability"],
arg_group="Properties",
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.",
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
)
_args_schema.minimum_tls_version = AAZStrArg(
options=["--minimum-tls-version"],
arg_group="Properties",
Expand All @@ -146,7 +155,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Sku",
help="The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.)",
required=True,
enum={"EnterpriseFlash_F1500": "EnterpriseFlash_F1500", "EnterpriseFlash_F300": "EnterpriseFlash_F300", "EnterpriseFlash_F700": "EnterpriseFlash_F700", "Enterprise_E1": "Enterprise_E1", "Enterprise_E10": "Enterprise_E10", "Enterprise_E100": "Enterprise_E100", "Enterprise_E20": "Enterprise_E20", "Enterprise_E200": "Enterprise_E200", "Enterprise_E400": "Enterprise_E400", "Enterprise_E5": "Enterprise_E5","Enterprise_E50": "Enterprise_E50"},
enum={"Balanced_B0": "Balanced_B0", "Balanced_B1": "Balanced_B1", "Balanced_B10": "Balanced_B10", "Balanced_B100": "Balanced_B100", "Balanced_B1000": "Balanced_B1000", "Balanced_B150": "Balanced_B150", "Balanced_B20": "Balanced_B20", "Balanced_B250": "Balanced_B250", "Balanced_B3": "Balanced_B3", "Balanced_B350": "Balanced_B350", "Balanced_B5": "Balanced_B5", "Balanced_B50": "Balanced_B50", "Balanced_B500": "Balanced_B500", "Balanced_B700": "Balanced_B700", "ComputeOptimized_X10": "ComputeOptimized_X10", "ComputeOptimized_X100": "ComputeOptimized_X100", "ComputeOptimized_X150": "ComputeOptimized_X150", "ComputeOptimized_X20": "ComputeOptimized_X20", "ComputeOptimized_X250": "ComputeOptimized_X250", "ComputeOptimized_X3": "ComputeOptimized_X3", "ComputeOptimized_X350": "ComputeOptimized_X350", "ComputeOptimized_X5": "ComputeOptimized_X5", "ComputeOptimized_X50": "ComputeOptimized_X50", "ComputeOptimized_X500": "ComputeOptimized_X500", "ComputeOptimized_X700": "ComputeOptimized_X700", "EnterpriseFlash_F1500": "EnterpriseFlash_F1500", "EnterpriseFlash_F300": "EnterpriseFlash_F300", "EnterpriseFlash_F700": "EnterpriseFlash_F700", "Enterprise_E1": "Enterprise_E1", "Enterprise_E10": "Enterprise_E10", "Enterprise_E100": "Enterprise_E100", "Enterprise_E20": "Enterprise_E20", "Enterprise_E200": "Enterprise_E200", "Enterprise_E400": "Enterprise_E400", "Enterprise_E5": "Enterprise_E5", "Enterprise_E50": "Enterprise_E50", "FlashOptimized_A1000": "FlashOptimized_A1000", "FlashOptimized_A1500": "FlashOptimized_A1500", "FlashOptimized_A2000": "FlashOptimized_A2000", "FlashOptimized_A250": "FlashOptimized_A250", "FlashOptimized_A4500": "FlashOptimized_A4500", "FlashOptimized_A500": "FlashOptimized_A500", "FlashOptimized_A700": "FlashOptimized_A700", "MemoryOptimized_M10": "MemoryOptimized_M10", "MemoryOptimized_M100": "MemoryOptimized_M100", "MemoryOptimized_M1000": "MemoryOptimized_M1000", "MemoryOptimized_M150": "MemoryOptimized_M150", "MemoryOptimized_M1500": "MemoryOptimized_M1500", "MemoryOptimized_M20": "MemoryOptimized_M20", "MemoryOptimized_M2000": "MemoryOptimized_M2000", "MemoryOptimized_M250": "MemoryOptimized_M250", "MemoryOptimized_M350": "MemoryOptimized_M350", "MemoryOptimized_M50": "MemoryOptimized_M50", "MemoryOptimized_M500": "MemoryOptimized_M500", "MemoryOptimized_M700": "MemoryOptimized_M700"},
)
return cls._args_schema

Expand Down Expand Up @@ -231,7 +240,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-03-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -275,6 +284,7 @@ def content(self):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("encryption", AAZObjectType)
properties.set_prop("highAvailability", AAZStrType, ".high_availability")
properties.set_prop("minimumTlsVersion", AAZStrType, ".minimum_tls_version")

encryption = _builder.get(".properties.encryption")
Expand Down Expand Up @@ -340,11 +350,6 @@ def _build_schema_on_200_201(cls):
_schema_on_200_201.sku = AAZObjectType(
flags={"required": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_CreateHelper._build_schema_system_data_read(_schema_on_200_201.system_data)
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
Expand Down Expand Up @@ -382,6 +387,9 @@ def _build_schema_on_200_201(cls):

properties = cls._schema_on_200_201.properties
properties.encryption = AAZObjectType()
properties.high_availability = AAZStrType(
serialized_name="highAvailability",
)
properties.host_name = AAZStrType(
serialized_name="hostName",
flags={"read_only": True},
Expand All @@ -401,6 +409,10 @@ def _build_schema_on_200_201(cls):
serialized_name="redisVersion",
flags={"read_only": True},
)
properties.redundancy_mode = AAZStrType(
serialized_name="redundancyMode",
flags={"read_only": True},
)
properties.resource_state = AAZStrType(
serialized_name="resourceState",
flags={"read_only": True},
Expand Down Expand Up @@ -440,11 +452,6 @@ def _build_schema_on_200_201(cls):
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_CreateHelper._build_schema_system_data_read(_element.system_data)
_element.type = AAZStrType(
flags={"read_only": True},
)
Expand Down Expand Up @@ -492,49 +499,5 @@ def _build_schema_on_200_201(cls):
class _CreateHelper:
"""Helper class for Create"""

_schema_system_data_read = None

@classmethod
def _build_schema_system_data_read(cls, _schema):
if cls._schema_system_data_read is not None:
_schema.created_at = cls._schema_system_data_read.created_at
_schema.created_by = cls._schema_system_data_read.created_by
_schema.created_by_type = cls._schema_system_data_read.created_by_type
_schema.last_modified_at = cls._schema_system_data_read.last_modified_at
_schema.last_modified_by = cls._schema_system_data_read.last_modified_by
_schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type
return

cls._schema_system_data_read = _schema_system_data_read = AAZObjectType(
flags={"read_only": True}
)

system_data_read = _schema_system_data_read
system_data_read.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data_read.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data_read.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data_read.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data_read.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data_read.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)

_schema.created_at = cls._schema_system_data_read.created_at
_schema.created_by = cls._schema_system_data_read.created_by
_schema.created_by_type = cls._schema_system_data_read.created_by_type
_schema.last_modified_at = cls._schema_system_data_read.last_modified_at
_schema.last_modified_by = cls._schema_system_data_read.last_modified_by
_schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type


__all__ = ["Create"]
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2023-03-01-preview",
"version": "2024-09-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2023-03-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cache/redisenterprise/{}", "2024-09-01-preview"],
]
}

Expand All @@ -48,6 +48,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the RedisEnterprise cluster.",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[A-Za-z0-9]{1,60}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -140,7 +143,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-03-01-preview",
"api-version", "2024-09-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class List(AAZCommand):
]
}

AZ_SUPPORT_PAGINATION = True

def _handler(self, command_args):
super()._handler(command_args)
return self.build_paging(self._execute_operations, self._output)
Expand Down
Loading

0 comments on commit 35373d5

Please sign in to comment.