Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CLI for redisenterprise 2023-03-01-preview using aaz #6048

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83d2f43
Update CLI for redisenterprise 2023-03-01-preview using aaz
revanthballa1188 Mar 21, 2023
3ab2cd0
remove older files created by autorest
revanthballa1188 Apr 13, 2023
a4fed1f
Add demo folder which is entirely based on aaz
revanthballa1188 Apr 20, 2023
6f7585e
Add tests and update custom.py
revanthballa1188 Apr 21, 2023
c40b3d0
Remove quantum changes which were added by mistake
revanthballa1188 Apr 21, 2023
5dfc4d3
Update subscription ID
revanthballa1188 Apr 21, 2023
962ac0d
Fix params and database creation with complex params
revanthballa1188 Apr 24, 2023
809a42d
Fix issue with unable to read modules and update list and show command
revanthballa1188 May 3, 2023
743c4cd
Add test cases and recordings
revanthballa1188 May 3, 2023
5259c34
Rename the extension to the correct one
revanthballa1188 May 4, 2023
dab959f
minor refractoring
revanthballa1188 May 4, 2023
6c5e490
Add changes related to CMK
revanthballa1188 May 8, 2023
9bf4c3c
Refractoring the code
revanthballa1188 May 8, 2023
3134676
Fix errors
revanthballa1188 May 8, 2023
6b1da95
Update the list-keys command
revanthballa1188 May 9, 2023
2df4ff9
Fix build issue
revanthballa1188 May 9, 2023
e100402
Fix issues w.r.t flush
revanthballa1188 May 9, 2023
883aafe
Fix minor issues
revanthballa1188 May 9, 2023
4e8cf17
Add test cases
revanthballa1188 May 10, 2023
f6548fa
Fixing the test cases
revanthballa1188 May 10, 2023
64826fa
Fixing the linter errors
revanthballa1188 May 10, 2023
c13e476
Resolving suggestions
revanthballa1188 May 15, 2023
d4329c3
Add shorter commands and remove unnessary commands
revanthballa1188 May 17, 2023
f3f5df4
Update the shorter alias in params file
revanthballa1188 May 17, 2023
f3e4d1f
update the version
revanthballa1188 May 17, 2023
3946637
Update release notes
revanthballa1188 May 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/redisenterprise/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Release History

0.1.0
++++++
* Initial release.
* Initial release.
4 changes: 2 additions & 2 deletions src/redisenterprise/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Azure CLI redisenterprise Extension #
This is the extension for redisenterprise
# Azure CLI RedisEnterprise Extension #
This is an extension to Azure CLI to manage redisenterprise resources.

### How to use ###
Install this extension using the below CLI command
Expand Down
59 changes: 24 additions & 35 deletions src/redisenterprise/azext_redisenterprise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# 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.
# --------------------------------------------------------------------------
# pylint: disable=unused-import
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

import azext_redisenterprise._help
from azure.cli.core import AzCommandsLoader
from azext_redisenterprise._help import helps # pylint: disable=unused-import


class RedisEnterpriseManagementClientCommandsLoader(AzCommandsLoader):
class DemoCommandsLoader(AzCommandsLoader):
revanthballa1188 marked this conversation as resolved.
Show resolved Hide resolved

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_redisenterprise.generated._client_factory import cf_redisenterprise_cl
redisenterprise_custom = CliCommandType(
operations_tmpl='azext_redisenterprise.custom#{}',
client_factory=cf_redisenterprise_cl)
parent = super(RedisEnterpriseManagementClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=redisenterprise_custom)
custom_command_type = CliCommandType(
operations_tmpl='azext_redisenterprise.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)

def load_command_table(self, args):
from azext_redisenterprise.generated.commands import load_command_table
load_command_table(self, args)
from azext_redisenterprise.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from azext_redisenterprise.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError as e:
if e.name.endswith('manual.commands'):
pass
else:
raise e
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_redisenterprise.generated._params import load_arguments
from azext_redisenterprise._params import load_arguments
load_arguments(self, command)
try:
from azext_redisenterprise.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError as e:
if e.name.endswith('manual._params'):
pass
else:
raise e


COMMAND_LOADER_CLS = RedisEnterpriseManagementClientCommandsLoader
COMMAND_LOADER_CLS = DemoCommandsLoader
revanthballa1188 marked this conversation as resolved.
Show resolved Hide resolved
51 changes: 33 additions & 18 deletions src/redisenterprise/azext_redisenterprise/_help.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# 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.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=unused-import
from .generated._help import helps # pylint: disable=reimported
try:
from .manual._help import helps # pylint: disable=reimported
except ImportError as e:
if e.name.endswith('manual._help'):
pass
else:
raise e
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import

helps['redisenterprise'] = """
type: group
Manage the redisenterprise cache
"""

helps['redisenterprise create'] = """
type: command
short-summary: Create an existing (overwrite/recreate, with potential downtime) cache cluster
examples:
- name: create cache
text: |-
az redisenterprise create --cluster-name "cache1" --location "East US" --minimum-tls-version "1.2" --sku "Enterprise_E20" --capacity 4 --tags tag1="value1" --zones "1" "2" "3" --client-protocol "Encrypted" --clustering-policy "EnterpriseCluster" --eviction-policy "NoEviction" --modules name="RedisBloom" args="ERROR_RATE 0.02 INITIAL_SIZE 400" --persistence aof-enabled=true aof-frequency="1s" --port 10000 --resource-group "rg1"
"""

helps['redisenterprise list'] = """
type: command
short-summary: List all RedisEnterprise clusters in the specified subscription
"""

helps['redisenterprise show'] = """
type: command
short-summary: Get information about a RedisEnterprise cluster
"""
Loading