diff --git a/doc/authoring_command_modules/authoring_commands.md b/doc/authoring_command_modules/authoring_commands.md index 72e2d0eb2a6..2478620261f 100644 --- a/doc/authoring_command_modules/authoring_commands.md +++ b/doc/authoring_command_modules/authoring_commands.md @@ -99,8 +99,9 @@ with self.command_group('mymod', mymod_sdk) as g: # (3) Registering different types of commands g.command('command1', 'do_something_1') g.custom_command('command2', 'do_something_2') - g.generic_update('update', custom_function_name='my_custom_update') - g.generic_wait('wait') + g.generic_update_command('update', custom_function_name='my_custom_update') + g.wait_command('wait') + g.show_command('show') ``` At this point, you should be able to access your command using `az [name]` and access the built-in help with `az [name] -h/--help`. Your command will automatically be 'wired up' with the global parameters. See below for amplifying information. @@ -141,24 +142,44 @@ The signature for `custom_command` is exactly the same as `command`. The only di See the section on "Suppporting Generic Update" -***generic_wait_command*** +***wait_command*** The generic wait command provides a templated solution for polling Azure resources until specific conditions are met. ```Python -generic_wait_command(self, name, getter_name='get', getter_type=None, **kwargs) +wait_command(self, name, getter_name='get', **kwargs) ``` - `name`: The name of the command within the command group. Commonly called 'wait'. - `getter_name`: The name of the method for the object getter, relative to the path specified in `operations_tmpl`. -- `getter_type`: A `CliCommandType` object to apply to this command (optional). - `kwargs`: any supported kwarg. Since most wait commands rely on a simple GET call from the SDK, most of these entries simply look like: ```Python - g.generic_wait_command('wait') + g.wait_command('wait') ``` +***custom_wait_command*** + +Similar to `custom_command` and `command`, the signature for `custom_wait_command` is exactly the same as `wait_command` but uses `custom_command_type` as the fallback for missings kwargs. + +***show_command*** + +The generic show command ensures a consistent behavior when encountering a missing Azure resource. +With little exception, all `show` commands should be registered using this method or `custom_show_command` to ensure consistency. + +```Python +show_command(self, name, getter_name='get', **kwargs) +``` + +- `name`: The name of the command within the command group. Commonly called 'show'. +- `getter_name`: The name of the method for the object getter, relative to the path specified in `operations_tmpl`. +- `kwargs`: any supported kwarg. + +***custom_show_command*** + +Similar to `custom_command` and `command`, the signature for `custom_show_command` is exactly the same as `show_command` but uses `custom_command_type` as the fallback for missings kwargs. + **(4) Supporting --no-wait** When registering a command, the boolean `supports_no_wait` property can be used to specify that the command supports `--no-wait`. diff --git a/src/azure-cli-core/azure/cli/core/commands/__init__.py b/src/azure-cli-core/azure/cli/core/commands/__init__.py index b37dbad3337..2278829c7b9 100644 --- a/src/azure-cli-core/azure/cli/core/commands/__init__.py +++ b/src/azure-cli-core/azure/cli/core/commands/__init__.py @@ -28,6 +28,7 @@ from azure.cli.core.commands.parameters import ( AzArgumentContext, patch_arg_make_required, patch_arg_make_optional) from azure.cli.core.extension import get_extension +from azure.cli.core.util import get_command_type_kwarg, read_file_content, get_arg_list, poller_classes import azure.cli.core.telemetry as telemetry logger = get_logger(__name__) @@ -60,7 +61,6 @@ def _explode_list_args(args): def _expand_file_prefixed_files(args): def _load_file(path): - from azure.cli.core.util import read_file_content if path == '-': content = sys.stdin.read() else: @@ -380,7 +380,6 @@ def execute(self, args): is_query_active=self.data['query_active']) def _build_kwargs(self, func, ns): # pylint: disable=no-self-use - from azure.cli.core.util import get_arg_list arg_list = get_arg_list(func) kwargs = {} if 'cmd' in arg_list: @@ -573,7 +572,6 @@ def __call__(self, poller): class DeploymentOutputLongRunningOperation(LongRunningOperation): def __call__(self, result): from msrest.pipeline import ClientRawResponse - from azure.cli.core.util import poller_classes if isinstance(result, poller_classes()): # most deployment operations return a poller @@ -677,7 +675,6 @@ def _is_paged(obj): def _is_poller(obj): # Since loading msrest is expensive, we avoid it until we have to if obj.__class__.__name__ in ['AzureOperationPoller', 'LROPoller']: - from azure.cli.core.util import poller_classes return isinstance(obj, poller_classes()) return False @@ -750,7 +747,7 @@ def _flatten_kwargs(self, kwargs, default_source_name): # pylint: disable=arguments-differ def command(self, name, method_name=None, **kwargs): """ - Register a CLI command + Register a CLI command. :param name: Name of the command as it will be called on the command line :type name: str :param method_name: Name of the method the command maps to @@ -762,7 +759,7 @@ def command(self, name, method_name=None, **kwargs): - exception_handler: Exception handler for handling non-standard exceptions (function) - supports_no_wait: The command supports no wait. (bool) - no_wait_param: [deprecated] The name of a boolean parameter that will be exposed as `--no-wait` - to skip long-running operation polling. (string) + to skip long running operation polling. (string) - transform: Transform function for transforming the output of the command (function) - table_transformer: Transform function or JMESPath query to be applied to table output to create a better output format for tables. (function or string) @@ -771,20 +768,11 @@ def command(self, name, method_name=None, **kwargs): - max_api: Maximum API version required for commands within the group (string) :rtype: None """ - self._check_stale() - merged_kwargs = self._flatten_kwargs(kwargs, 'command_type') - # don't inherit deprecation info from command group - merged_kwargs['deprecate_info'] = kwargs.get('deprecate_info', None) - operations_tmpl = merged_kwargs['operations_tmpl'] - command_name = '{} {}'.format(self.group_name, name) if self.group_name else name - operation = operations_tmpl.format(method_name) if operations_tmpl else None - self.command_loader._cli_command(command_name, operation, **merged_kwargs) # pylint: disable=protected-access - - return command_name + return self._command(name, method_name=method_name, **kwargs) - def custom_command(self, name, method_name, **kwargs): + def custom_command(self, name, method_name=None, **kwargs): """ - Register a custom CLI command. + Register a CLI command. :param name: Name of the command as it will be called on the command line :type name: str :param method_name: Name of the method the command maps to @@ -805,8 +793,11 @@ def custom_command(self, name, method_name, **kwargs): - max_api: Maximum API version required for commands within the group (string) :rtype: None """ + return self._command(name, method_name=method_name, custom_command=True, **kwargs) + + def _command(self, name, method_name, custom_command=False, **kwargs): self._check_stale() - merged_kwargs = self._flatten_kwargs(kwargs, 'custom_command_type') + merged_kwargs = self._flatten_kwargs(kwargs, get_command_type_kwarg(custom_command)) # don't inherit deprecation info from command group merged_kwargs['deprecate_info'] = kwargs.get('deprecate_info', None) @@ -819,12 +810,8 @@ def custom_command(self, name, method_name, **kwargs): return command_name # pylint: disable=no-self-use - def _resolve_operation(self, kwargs, name, command_type=None, source_kwarg='command_type'): - - allowed_source_kwargs = ['command_type', 'custom_command_type'] - if source_kwarg not in allowed_source_kwargs: - raise ValueError("command authoring error: 'source_kwarg' value '{}'. Allowed values: {}".format( - source_kwarg, ' '.join(allowed_source_kwargs))) + def _resolve_operation(self, kwargs, name, command_type=None, custom_command=False): + source_kwarg = get_command_type_kwarg(custom_command) operations_tmpl = None if command_type: @@ -860,7 +847,7 @@ def generic_update_command(self, name, getter_op = self._resolve_operation(merged_kwargs, getter_name, getter_type) setter_op = self._resolve_operation(merged_kwargs, setter_name, setter_type) custom_func_op = self._resolve_operation(merged_kwargs, custom_func_name, custom_func_type, - source_kwarg='custom_command_type') if custom_func_name else None + custom_command=True) if custom_func_name else None _cli_generic_update_command( self.command_loader, '{} {}'.format(self.group_name, name), @@ -873,8 +860,17 @@ def generic_update_command(self, name, child_arg_name=child_arg_name, **merged_kwargs) + def wait_command(self, name, getter_name='get', **kwargs): + self._wait_command(name, getter_name=getter_name, custom_command=False, **kwargs) + + def custom_wait_command(self, name, getter_name='get', **kwargs): + self._wait_command(name, getter_name=getter_name, custom_command=True, **kwargs) + def generic_wait_command(self, name, getter_name='get', getter_type=None, **kwargs): - from azure.cli.core.commands.arm import _cli_generic_wait_command + self._wait_command(name, getter_name=getter_name, getter_type=getter_type, **kwargs) + + def _wait_command(self, name, getter_name='get', getter_type=None, custom_command=False, **kwargs): + from azure.cli.core.commands.arm import _cli_wait_command self._check_stale() merged_kwargs = _merge_kwargs(kwargs, self.group_kwargs, CLI_COMMAND_KWARGS) # don't inherit deprecation info from command group @@ -882,22 +878,25 @@ def generic_wait_command(self, name, getter_name='get', getter_type=None, **kwar if getter_type: merged_kwargs = _merge_kwargs(getter_type.settings, merged_kwargs, CLI_COMMAND_KWARGS) - getter_op = self._resolve_operation(merged_kwargs, getter_name, getter_type) - _cli_generic_wait_command( - self.command_loader, - '{} {}'.format(self.group_name, name), - getter_op=getter_op, - **merged_kwargs) + getter_op = self._resolve_operation(merged_kwargs, getter_name, getter_type, custom_command=custom_command) + _cli_wait_command(self.command_loader, '{} {}'.format(self.group_name, name), getter_op=getter_op, + custom_command=custom_command, **merged_kwargs) - def generic_show_command(self, name, getter_name='get', getter_type=None, **kwargs): - from azure.cli.core.commands.arm import _cli_generic_show_command + def show_command(self, name, getter_name='get', **kwargs): + self._show_command(name, getter_name=getter_name, custom_command=False, **kwargs) + + def custom_show_command(self, name, getter_name='get', **kwargs): + self._show_command(name, getter_name=getter_name, custom_command=True, **kwargs) + + def _show_command(self, name, getter_name='get', getter_type=None, custom_command=False, **kwargs): + from azure.cli.core.commands.arm import _cli_show_command self._check_stale() merged_kwargs = _merge_kwargs(kwargs, self.group_kwargs, CLI_COMMAND_KWARGS) + # don't inherit deprecation info from command group + merged_kwargs['deprecate_info'] = kwargs.get('deprecate_info', None) + if getter_type: merged_kwargs = _merge_kwargs(getter_type.settings, merged_kwargs, CLI_COMMAND_KWARGS) - getter_op = self._resolve_operation(merged_kwargs, getter_name, getter_type) - _cli_generic_show_command( - self.command_loader, - '{} {}'.format(self.group_name, name), - getter_op=getter_op, - **merged_kwargs) + getter_op = self._resolve_operation(merged_kwargs, getter_name, getter_type, custom_command=custom_command) + _cli_show_command(self.command_loader, '{} {}'.format(self.group_name, name), getter_op=getter_op, + custom_command=custom_command, **merged_kwargs) diff --git a/src/azure-cli-core/azure/cli/core/commands/arm.py b/src/azure-cli-core/azure/cli/core/commands/arm.py index 42666c7ba66..54c86e51705 100644 --- a/src/azure-cli-core/azure/cli/core/commands/arm.py +++ b/src/azure-cli-core/azure/cli/core/commands/arm.py @@ -12,7 +12,7 @@ from six import string_types from knack.arguments import CLICommandArgument, ignore_type -from knack.introspection import extract_args_from_signature +from knack.introspection import extract_args_from_signature, extract_full_summary_from_signature from knack.log import get_logger from knack.util import todict, CLIError @@ -20,10 +20,11 @@ from azure.cli.core.commands import LongRunningOperation, _is_poller from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.commands.validators import IterateValue -from azure.cli.core.util import shell_safe_json_parse, augment_no_wait_handler_args +from azure.cli.core.util import shell_safe_json_parse, augment_no_wait_handler_args, get_command_type_kwarg from azure.cli.core.profiles import ResourceType logger = get_logger(__name__) +EXCLUDED_NON_CLIENT_PARAMS = list(set(EXCLUDED_PARAMS) - set(['self', 'client'])) # pylint:disable=too-many-lines @@ -339,16 +340,16 @@ def _get_child(parent, collection_name, item_name, collection_key): return result -def _get_operations_tmpl(cmd): - operations_tmpl = cmd.command_kwargs.get('operations_tmpl', - cmd.command_kwargs.get('command_type').settings['operations_tmpl']) +def _get_operations_tmpl(cmd, custom_command=False): + operations_tmpl = cmd.command_kwargs.get('operations_tmpl') or \ + cmd.command_kwargs.get(get_command_type_kwarg(custom_command)).settings['operations_tmpl'] if not operations_tmpl: raise CLIError("command authoring error: cmd '{}' does not have an operations_tmpl.".format(cmd.name)) return operations_tmpl -def _get_client_factory(_, kwargs): - command_type = kwargs.get('command_type', None) +def _get_client_factory(_, custom_command=False, **kwargs): + command_type = kwargs.get(get_command_type_kwarg(custom_command), None) factory = kwargs.get('client_factory', None) if not factory and command_type: factory = command_type.settings.get('client_factory', None) @@ -433,7 +434,7 @@ def __call__(self, parser, namespace, values, option_string=None): def _extract_handler_and_args(args, commmand_kwargs, op): from azure.cli.core.commands.client_factory import resolve_client_arg_name - factory = _get_client_factory(name, commmand_kwargs) + factory = _get_client_factory(name, **commmand_kwargs) client = None if factory: try: @@ -443,8 +444,7 @@ def _extract_handler_and_args(args, commmand_kwargs, op): client_arg_name = resolve_client_arg_name(op, kwargs) op_handler = context.get_op_handler(op) - exclude = list(set(EXCLUDED_PARAMS) - set(['self', 'client'])) - raw_args = dict(extract_args_from_signature(op_handler, excluded_params=exclude)) + raw_args = dict(extract_args_from_signature(op_handler, excluded_params=EXCLUDED_NON_CLIENT_PARAMS)) op_args = {key: val for key, val in args.items() if key in raw_args} if client_arg_name in raw_args: op_args[client_arg_name] = client @@ -542,12 +542,12 @@ def handler(args): # pylint: disable=too-many-branches,too-many-statements context._cli_command(name, handler=handler, argument_loader=generic_update_arguments_loader, **kwargs) # pylint: disable=protected-access -def _cli_generic_wait_command(context, name, getter_op, **kwargs): +def _cli_wait_command(context, name, getter_op, custom_command=False, **kwargs): if not isinstance(getter_op, string_types): raise ValueError("Getter operation must be a string. Got '{}'".format(type(getter_op))) - factory = _get_client_factory(name, kwargs) + factory = _get_client_factory(name, custom_command=custom_command, **kwargs) def generic_wait_arguments_loader(): cmd_args = get_arguments_loader(context, getter_op) @@ -599,17 +599,16 @@ def handler(args): from msrest.exceptions import ClientException import time - cmd = args.get('cmd') - - operations_tmpl = _get_operations_tmpl(cmd) getter_args = dict(extract_args_from_signature(context.get_op_handler(getter_op), - excluded_params=EXCLUDED_PARAMS)) + excluded_params=EXCLUDED_NON_CLIENT_PARAMS)) + cmd = args.get('cmd') if 'cmd' in getter_args else args.pop('cmd') + operations_tmpl = _get_operations_tmpl(cmd, custom_command=custom_command) client_arg_name = resolve_client_arg_name(operations_tmpl, kwargs) try: client = factory(context.cli_ctx) if factory else None except TypeError: client = factory(context.cli_ctx, args) if factory else None - if client and (client_arg_name in getter_args or client_arg_name == 'self'): + if client and (client_arg_name in getter_args): args[client_arg_name] = client getter = context.get_op_handler(getter_op) @@ -665,42 +664,47 @@ def handler(args): context._cli_command(name, handler=handler, argument_loader=generic_wait_arguments_loader, **kwargs) # pylint: disable=protected-access -def _cli_generic_show_command(context, name, getter_op, **kwargs): +def _cli_show_command(context, name, getter_op, custom_command=False, **kwargs): if not isinstance(getter_op, string_types): raise ValueError("Getter operation must be a string. Got '{}'".format(type(getter_op))) - factory = _get_client_factory(name, kwargs) + factory = _get_client_factory(name, custom_command=custom_command, **kwargs) def generic_show_arguments_loader(): cmd_args = get_arguments_loader(context, getter_op) return [(k, v) for k, v in cmd_args.items()] + def description_loader(): + return extract_full_summary_from_signature(context.get_op_handler(getter_op)) + def handler(args): from azure.cli.core.commands.client_factory import resolve_client_arg_name - cmd = args.get('cmd') - operations_tmpl = _get_operations_tmpl(cmd) getter_args = dict(extract_args_from_signature(context.get_op_handler(getter_op), - excluded_params=EXCLUDED_PARAMS)) + excluded_params=EXCLUDED_NON_CLIENT_PARAMS)) + cmd = args.get('cmd') if 'cmd' in getter_args else args.pop('cmd') + operations_tmpl = _get_operations_tmpl(cmd, custom_command=custom_command) client_arg_name = resolve_client_arg_name(operations_tmpl, kwargs) try: client = factory(context.cli_ctx) if factory else None except TypeError: client = factory(context.cli_ctx, args) if factory else None - if client and (client_arg_name in getter_args or client_arg_name == 'self'): + + if client and (client_arg_name in getter_args): args[client_arg_name] = client getter = context.get_op_handler(getter_op) try: return getter(**args) except Exception as ex: # pylint: disable=broad-except - if getattr(ex, 'status_code', None) == 404: + if getattr(getattr(ex, 'response', ex), 'status_code', None) == 404: logger.error(getattr(ex, 'message', ex)) import sys sys.exit(3) raise - context._cli_command(name, handler=handler, argument_loader=generic_show_arguments_loader, **kwargs) # pylint: disable=protected-access + context._cli_command(name, handler=handler, argument_loader=generic_show_arguments_loader, # pylint: disable=protected-access + description_loader=description_loader, **kwargs) def verify_property(instance, condition): diff --git a/src/azure-cli-core/azure/cli/core/util.py b/src/azure-cli-core/azure/cli/core/util.py index 15b29af9b11..25cbc30ec7d 100644 --- a/src/azure-cli-core/azure/cli/core/util.py +++ b/src/azure-cli-core/azure/cli/core/util.py @@ -310,3 +310,7 @@ def can_launch_browser(): result = False return result + + +def get_command_type_kwarg(custom_command): + return 'custom_command_type' if custom_command else 'command_type' diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/base.py b/src/azure-cli-testsdk/azure/cli/testsdk/base.py index 292b58ebc16..80d392336f7 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/base.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/base.py @@ -261,6 +261,14 @@ def _in_process_execute(self, cli_ctx, command, expect_failure=False): self.exit_code = 1 self.output = stdout_buf.getvalue() self.process_error = ex + except SystemExit as ex: + # SystemExit not caught by broad exception, check for sys.exit(3) + if ex.code == 3 and expect_failure: + self.exit_code = 1 + self.output = stdout_buf.getvalue() + self.applog = logging_buf.getvalue() + else: + raise finally: stdout_buf.close() logging_buf.close() diff --git a/src/command_modules/azure-cli-acr/HISTORY.rst b/src/command_modules/azure-cli-acr/HISTORY.rst index 29285078c56..8e2f5a0a20d 100644 --- a/src/command_modules/azure-cli-acr/HISTORY.rst +++ b/src/command_modules/azure-cli-acr/HISTORY.rst @@ -3,9 +3,10 @@ Release History =============== -2.0.29 -++++++ -* BREAKING CHANGE:: Update '--no-push' to a pure flag in 'acr build' command. +2.1.0 ++++++ +* BREAKING CHANGE: Update '--no-push' to a pure flag in 'acr build' command. +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * Add 'show' and 'update' commands under 'acr repository' group. * Add '--detail' flag for 'show-manifests' and 'show-tags' to show more detailed information. diff --git a/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/commands.py b/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/commands.py index 63ad8c247bd..dffbef4c719 100644 --- a/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/commands.py +++ b/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/commands.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.core.util import empty_on_404 from ._format import ( registry_output_format, @@ -80,7 +79,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements g.command('list', 'acr_list') g.command('create', 'acr_create') g.command('delete', 'acr_delete') - g.command('show', 'acr_show', exception_handler=empty_on_404) + g.show_command('show', 'acr_show') g.command('login', 'acr_login', table_transformer=None) g.command('show-usage', 'acr_show_usage', table_transformer=usage_output_format) g.generic_update_command('update', @@ -95,7 +94,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements g.command('import', 'acr_import') with self.command_group('acr credential', acr_cred_util) as g: - g.command('show', 'acr_credential_show', exception_handler=empty_on_404) + g.show_command('show', 'acr_credential_show') g.command('renew', 'acr_credential_renew') with self.command_group('acr repository', acr_repo_util) as g: @@ -111,7 +110,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements g.command('list', 'acr_webhook_list') g.command('create', 'acr_webhook_create') g.command('delete', 'acr_webhook_delete') - g.command('show', 'acr_webhook_show') + g.show_command('show', 'acr_webhook_show') g.command('get-config', 'acr_webhook_get_config', table_transformer=webhook_get_config_output_format) g.command('list-events', 'acr_webhook_list_events', table_transformer=webhook_list_events_output_format) g.command('ping', 'acr_webhook_ping', table_transformer=webhook_ping_output_format) @@ -127,7 +126,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements g.command('list', 'acr_replication_list') g.command('create', 'acr_replication_create') g.command('delete', 'acr_replication_delete') - g.command('show', 'acr_replication_show') + g.show_command('show', 'acr_replication_show') g.generic_update_command('update', getter_name='acr_replication_update_get', setter_name='acr_replication_update_set', @@ -141,7 +140,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements with self.command_group('acr build-task', acr_build_task_util) as g: g.command('create', 'acr_build_task_create') - g.command('show', 'acr_build_task_show') + g.show_command('show', 'acr_build_task_show') g.command('list', 'acr_build_task_list', table_transformer=build_task_output_format) g.command('delete', 'acr_build_task_delete') g.command('update', 'acr_build_task_update') diff --git a/src/command_modules/azure-cli-acr/setup.py b/src/command_modules/azure-cli-acr/setup.py index 80c75e6c805..b734d33a8c6 100644 --- a/src/command_modules/azure-cli-acr/setup.py +++ b/src/command_modules/azure-cli-acr/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.29" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-acs/HISTORY.rst b/src/command_modules/azure-cli-acs/HISTORY.rst index 8bff949b270..7af8ff74e70 100644 --- a/src/command_modules/azure-cli-acs/HISTORY.rst +++ b/src/command_modules/azure-cli-acs/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -2.1.4 +2.2.0 +++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * `az aks create` will error out if `--max-pods` is less than 5 2.1.3 diff --git a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/commands.py b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/commands.py index a41788f83fa..587c622c097 100644 --- a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/commands.py +++ b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/commands.py @@ -5,7 +5,6 @@ from azure.cli.core.commands import CliCommandType from azure.cli.core.commands.arm import deployment_validate_table_format -from azure.cli.core.util import empty_on_404 from ._client_factory import cf_container_services from ._client_factory import cf_managed_clusters @@ -38,8 +37,8 @@ def load_command_table(self, _): g.custom_command('list', 'list_container_services') g.custom_command('list-locations', 'list_acs_locations') g.custom_command('scale', 'update_acs') - g.command('show', 'get', exception_handler=empty_on_404) - g.generic_wait_command('wait') + g.show_command('show', 'get') + g.wait_command('wait') # ACS Mesos DC/OS commands with self.command_group('acs dcos', container_services_sdk, client_factory=cf_container_services) as g: @@ -67,13 +66,13 @@ def load_command_table(self, _): g.custom_command('remove-connector', 'k8s_uninstall_connector') g.custom_command('remove-dev-spaces', 'aks_remove_dev_spaces') g.custom_command('scale', 'aks_scale', supports_no_wait=True) - g.custom_command('show', 'aks_show', table_transformer=aks_show_table_format) + g.custom_show_command('show', 'aks_show', table_transformer=aks_show_table_format) g.custom_command('upgrade', 'aks_upgrade', supports_no_wait=True, confirmation='Kubernetes may be unavailable during cluster upgrades.\n' + 'Are you sure you want to perform this operation?') g.custom_command('upgrade-connector', 'k8s_upgrade_connector') g.custom_command('use-dev-spaces', 'aks_use_dev_spaces') - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('aks', container_services_sdk, client_factory=cf_container_services) as g: g.custom_command('get-versions', 'aks_get_versions', table_transformer=aks_versions_table_format) diff --git a/src/command_modules/azure-cli-acs/setup.py b/src/command_modules/azure-cli-acs/setup.py index f63ce6a9cc6..e296de6d284 100644 --- a/src/command_modules/azure-cli-acs/setup.py +++ b/src/command_modules/azure-cli-acs/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.1.4" +VERSION = "2.2.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-advisor/HISTORY.rst b/src/command_modules/azure-cli-advisor/HISTORY.rst index add2c80651b..a0da7a4d05d 100644 --- a/src/command_modules/azure-cli-advisor/HISTORY.rst +++ b/src/command_modules/azure-cli-advisor/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.5.3 +0.6.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.5.2 ++++++ diff --git a/src/command_modules/azure-cli-advisor/azure/cli/command_modules/advisor/commands.py b/src/command_modules/azure-cli-advisor/azure/cli/command_modules/advisor/commands.py index 4d6084dcc39..b51c6677310 100644 --- a/src/command_modules/azure-cli-advisor/azure/cli/command_modules/advisor/commands.py +++ b/src/command_modules/azure-cli-advisor/azure/cli/command_modules/advisor/commands.py @@ -23,7 +23,7 @@ def load_command_table(self, _): with self.command_group('advisor configuration', client_factory=configurations_mgmt_client_factory) as g: g.custom_command('list', 'list_configuration') - g.custom_command('show', 'show_configuration') + g.custom_show_command('show', 'show_configuration') g.generic_update_command('update', getter_name='show_configuration', getter_type=advisor_custom, diff --git a/src/command_modules/azure-cli-advisor/setup.py b/src/command_modules/azure-cli-advisor/setup.py index af4ca99c50e..47d353a70d0 100644 --- a/src/command_modules/azure-cli-advisor/setup.py +++ b/src/command_modules/azure-cli-advisor/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.5.3" +VERSION = "0.6.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-ams/HISTORY.rst b/src/command_modules/azure-cli-ams/HISTORY.rst index 25750dbd45a..3d4385f14f7 100644 --- a/src/command_modules/azure-cli-ams/HISTORY.rst +++ b/src/command_modules/azure-cli-ams/HISTORY.rst @@ -3,13 +3,9 @@ Release History =============== -0.1.3 +0.2.0 +++++ -* Minor fixes - -0.1.2 -++++++ -* Minor fixes. +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.1 +++++ diff --git a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/commands.py b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/commands.py index 827f0b70d46..b8c37b27e94 100644 --- a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/commands.py +++ b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/commands.py @@ -28,7 +28,7 @@ def get_custom_sdk(custom_module, client_factory): ) with self.command_group('ams account', get_sdk('Mediaservices', get_mediaservices_client)) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.generic_update_command('update', getter_name='mediaservice_update_getter', @@ -53,7 +53,7 @@ def get_custom_sdk(custom_module, client_factory): custom_command_type=get_custom_sdk('sp', get_mediaservices_client)) with self.command_group('ams transform', get_sdk('Transforms', get_transforms_client)) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.custom_command('create', 'create_transform', @@ -73,7 +73,7 @@ def get_custom_sdk(custom_module, client_factory): custom_command_type=get_custom_sdk('transform', get_transforms_client)) with self.command_group('ams asset', get_sdk('Assets', get_assets_client)) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.generic_update_command('update', @@ -85,7 +85,7 @@ def get_custom_sdk(custom_module, client_factory): custom_command_type=get_custom_sdk('asset', get_assets_client)) with self.command_group('ams job', get_sdk('Jobs', get_jobs_client)) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.custom_command('cancel', 'cancel_job', @@ -97,7 +97,7 @@ def get_custom_sdk(custom_module, client_factory): g.custom_command('create', 'create_streaming_locator', custom_command_type=get_custom_sdk('streaming', get_streaming_locators_client)) g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.command('get-paths', 'list_paths') @@ -105,7 +105,7 @@ def get_custom_sdk(custom_module, client_factory): g.custom_command('create', 'create_streaming_policy', custom_command_type=get_custom_sdk('streaming', get_streaming_policies_client)) g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') with self.command_group('ams streaming endpoint', get_sdk('StreamingEndpoints', get_streaming_endpoints_client)) as g: diff --git a/src/command_modules/azure-cli-ams/setup.py b/src/command_modules/azure-cli-ams/setup.py index f7fc9afc997..6b0f89d046b 100644 --- a/src/command_modules/azure-cli-ams/setup.py +++ b/src/command_modules/azure-cli-ams/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.3" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-appservice/HISTORY.rst b/src/command_modules/azure-cli-appservice/HISTORY.rst index 6b476ea3139..8f37ef0d4aa 100644 --- a/src/command_modules/azure-cli-appservice/HISTORY.rst +++ b/src/command_modules/azure-cli-appservice/HISTORY.rst @@ -3,14 +3,11 @@ Release History =============== -0.1.38 -++++++ +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * appservice: allow PremiumV2 skus -0.1.37 -++++++ -* Minor fixes - 0.1.36 ++++++ * webapp/functionapp: Adding support for disabling identity az webapp identity remove. Preview tag removed for Identity feature. diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py index 8a95557cf58..db98a36698e 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py @@ -71,7 +71,7 @@ def load_command_table(self, _): with self.command_group('webapp', webapp_sdk) as g: g.custom_command('create', 'create_webapp', exception_handler=ex_handler_factory()) g.custom_command('list', 'list_webapp', table_transformer=transform_web_list_output) - g.custom_command('show', 'show_webapp', exception_handler=empty_on_404, table_transformer=transform_web_output) + g.custom_show_command('show', 'show_webapp', table_transformer=transform_web_output) g.custom_command('delete', 'delete_webapp') g.custom_command('stop', 'stop_webapp') g.custom_command('start', 'start_webapp') @@ -85,12 +85,12 @@ def load_command_table(self, _): with self.command_group('webapp traffic-routing') as g: g.custom_command('set', 'set_traffic_routing') - g.custom_command('show', 'show_traffic_routing') + g.custom_show_command('show', 'show_traffic_routing') g.custom_command('clear', 'clear_traffic_routing') with self.command_group('webapp config') as g: g.custom_command('set', 'update_site_configs') - g.custom_command('show', 'get_site_configs', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_site_configs') with self.command_group('webapp config appsettings') as g: g.custom_command('list', 'get_app_settings', exception_handler=empty_on_404) @@ -111,7 +111,7 @@ def load_command_table(self, _): with self.command_group('webapp config container') as g: g.custom_command('set', 'update_container_settings') g.custom_command('delete', 'delete_container_settings') - g.custom_command('show', 'show_container_settings', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_container_settings') with self.command_group('webapp config ssl') as g: g.custom_command('upload', 'upload_ssl_cert', exception_handler=ex_handler_factory()) @@ -122,7 +122,7 @@ def load_command_table(self, _): with self.command_group('webapp config backup') as g: g.custom_command('list', 'list_backups') - g.custom_command('show', 'show_backup_configuration', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_backup_configuration') g.custom_command('create', 'create_backup', exception_handler=ex_handler_factory()) g.custom_command('update', 'update_backup_schedule', exception_handler=ex_handler_factory()) g.custom_command('restore', 'restore_backup', exception_handler=ex_handler_factory()) @@ -132,7 +132,7 @@ def load_command_table(self, _): g.custom_command('config-zip', 'enable_zip_deploy') g.custom_command('config', 'config_source_control', exception_handler=ex_handler_factory()) g.custom_command('sync', 'sync_site_repo', exception_handler=ex_handler_factory()) - g.custom_command('show', 'show_source_control', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_source_control') g.custom_command('delete', 'delete_source_control') g.custom_command('update-token', 'update_git_token', exception_handler=ex_handler_factory()) @@ -140,7 +140,7 @@ def load_command_table(self, _): g.custom_command('tail', 'get_streaming_log') g.custom_command('download', 'download_historical_logs') g.custom_command('config', 'config_diagnostics') - g.custom_command('show', 'show_diagnostic_settings') + g.custom_show_command('show', 'show_diagnostic_settings') with self.command_group('webapp deployment slot') as g: g.custom_command('list', 'list_slots', table_transformer=output_slots_in_table) @@ -153,7 +153,7 @@ def load_command_table(self, _): g.custom_command('list-publishing-profiles', 'list_publish_profiles') with self.command_group('webapp deployment user', webclient_sdk) as g: - g.command('show', 'get_publishing_user', exception_handler=empty_on_404) + g.show_command('show', 'get_publishing_user') g.custom_command('set', 'set_deployment_user', exception_handler=ex_handler_factory()) with self.command_group('webapp deployment container') as g: @@ -161,14 +161,14 @@ def load_command_table(self, _): g.custom_command('show-cd-url', 'show_container_cd_url') with self.command_group('webapp auth') as g: - g.custom_command('show', 'get_auth_settings') + g.custom_show_command('show', 'get_auth_settings') g.custom_command('update', 'update_auth_settings') with self.command_group('appservice plan', appservice_plan_sdk) as g: g.custom_command('create', 'create_app_service_plan', exception_handler=ex_handler_factory(creating_plan=True)) g.command('delete', 'delete', confirmation=True) g.custom_command('list', 'list_app_service_plans') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.generic_update_command('update', custom_func_name='update_app_service_plan', setter_arg_name='app_service_plan') with self.command_group('appservice') as g: g.custom_command('list-locations', 'list_locations', transform=transform_list_location_output) @@ -176,7 +176,7 @@ def load_command_table(self, _): with self.command_group('functionapp') as g: g.custom_command('create', 'create_function') g.custom_command('list', 'list_function_app', table_transformer=transform_web_list_output) - g.custom_command('show', 'show_webapp', exception_handler=empty_on_404, table_transformer=transform_web_output) + g.custom_show_command('show', 'show_webapp', table_transformer=transform_web_output) g.custom_command('delete', 'delete_function_app') g.custom_command('stop', 'stop_webapp') g.custom_command('start', 'start_webapp') @@ -210,13 +210,13 @@ def load_command_table(self, _): g.custom_command('config-zip', 'enable_zip_deploy') g.custom_command('config', 'config_source_control', exception_handler=ex_handler_factory()) g.custom_command('sync', 'sync_site_repo') - g.custom_command('show', 'show_source_control', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_source_control') g.custom_command('delete', 'delete_source_control') g.custom_command('update-token', 'update_git_token', exception_handler=ex_handler_factory()) with self.command_group('functionapp deployment user', webclient_sdk) as g: g.custom_command('set', 'set_deployment_user', exception_handler=ex_handler_factory()) - g.command('show', 'get_publishing_user', exception_handler=empty_on_404) + g.show_command('show', 'get_publishing_user') with self.command_group('functionapp deployment') as g: g.custom_command('list-publishing-profiles', 'list_publish_profiles') diff --git a/src/command_modules/azure-cli-appservice/setup.py b/src/command_modules/azure-cli-appservice/setup.py index cd21bb54d0c..f9fd853cced 100644 --- a/src/command_modules/azure-cli-appservice/setup.py +++ b/src/command_modules/azure-cli-appservice/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.38" +VERSION = "0.2.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-backup/HISTORY.rst b/src/command_modules/azure-cli-backup/HISTORY.rst index 7db2fcb5fe2..e18c3a6a753 100644 --- a/src/command_modules/azure-cli-backup/HISTORY.rst +++ b/src/command_modules/azure-cli-backup/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -1.1.3 +1.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 1.1.2 ++++++ diff --git a/src/command_modules/azure-cli-backup/azure/cli/command_modules/backup/commands.py b/src/command_modules/azure-cli-backup/azure/cli/command_modules/backup/commands.py index 7aa60f26898..a0988accdc3 100644 --- a/src/command_modules/azure-cli-backup/azure/cli/command_modules/backup/commands.py +++ b/src/command_modules/azure-cli-backup/azure/cli/command_modules/backup/commands.py @@ -28,19 +28,19 @@ def load_command_table(self, _): with self.command_group('backup vault', backup_vaults_sdk, client_factory=vaults_cf) as g: g.custom_command('create', 'create_vault') - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('list', 'list_vaults') g.command('backup-properties show', 'get', command_type=backup_storage_config_sdk) g.custom_command('backup-properties set', 'set_backup_properties', client_factory=backup_storage_configs_cf) g.custom_command('delete', 'delete_vault', confirmation=True) with self.command_group('backup container', backup_custom, client_factory=backup_protection_containers_cf) as g: - g.command('show', 'show_container') + g.show_command('show', 'show_container') g.command('list', 'list_containers', table_transformer=transform_container_list) with self.command_group('backup policy', backup_custom, client_factory=protection_policies_cf) as g: g.command('get-default-for-vm', 'get_default_policy_for_vm') - g.command('show', 'show_policy') + g.show_command('show', 'show_policy') g.command('list', 'list_policies', client_factory=backup_policies_cf, table_transformer=transform_policy_list) g.command('list-associated-items', 'list_associated_items_for_policy', client_factory=backup_protected_items_cf, table_transformer=transform_item_list) g.command('set', 'set_policy') @@ -53,18 +53,18 @@ def load_command_table(self, _): g.command('disable', 'disable_protection', confirmation=True) with self.command_group('backup item', backup_custom, client_factory=backup_protected_items_cf) as g: - g.command('show', 'show_item') + g.show_command('show', 'show_item') g.command('list', 'list_items', table_transformer=transform_item_list) g.command('set-policy', 'update_policy_for_item', client_factory=protected_items_cf) with self.command_group('backup job', backup_custom, client_factory=job_details_cf) as g: g.command('list', 'list_jobs', client_factory=backup_jobs_cf, table_transformer=transform_job_list) - g.command('show', 'show_job') + g.show_command('show', 'show_job') g.command('stop', 'stop_job', client_factory=job_cancellations_cf) g.command('wait', 'wait_for_job') with self.command_group('backup recoverypoint', backup_custom, client_factory=recovery_points_cf) as g: - g.command('show', 'show_recovery_point') + g.show_command('show', 'show_recovery_point') g.command('list', 'list_recovery_points', table_transformer=transform_recovery_point_list) with self.command_group('backup restore', backup_custom, client_factory=restores_cf) as g: diff --git a/src/command_modules/azure-cli-backup/setup.py b/src/command_modules/azure-cli-backup/setup.py index 0a7ec4e117a..b73416ce991 100644 --- a/src/command_modules/azure-cli-backup/setup.py +++ b/src/command_modules/azure-cli-backup/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "1.1.3" +VERSION = "1.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-batch/HISTORY.rst b/src/command_modules/azure-cli-batch/HISTORY.rst index a55c9cc02db..886ae606a68 100644 --- a/src/command_modules/azure-cli-batch/HISTORY.rst +++ b/src/command_modules/azure-cli-batch/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -3.2.7 +3.3.0 +++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * Fix bug on using token credential on cloud shell mode * When use json file as input parameter, deserialize content with case insentive. diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py index b014a1454dc..6f5008ac824 100644 --- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py +++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py @@ -51,7 +51,7 @@ def get_data_factory(name): # Mgmt Account Operations with self.command_group('batch account', get_mgmt_type('batch_account'), client_factory=get_mgmt_factory('batch_account')) as g: g.custom_command('list', 'list_accounts', table_transformer=account_list_table_format) - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('create', 'create_account', supports_no_wait=True) g.custom_command('set', 'update_account') g.command('delete', 'delete', supports_no_wait=True, confirmation=True) @@ -62,7 +62,7 @@ def get_data_factory(name): with self.command_group('batch application', get_mgmt_type('application'), client_factory=get_mgmt_factory('application')) as g: g.command('list', 'list', table_transformer=application_list_table_format) - g.command('show', 'get') + g.show_command('show', 'get') g.command('create', 'create') g.custom_command('set', 'update_application') g.command('delete', 'delete', confirmation=True) @@ -70,11 +70,11 @@ def get_data_factory(name): with self.command_group('batch application package', get_mgmt_type('application_package'), client_factory=get_mgmt_factory('application_package'))as g: g.custom_command('create', 'create_application_package') g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('activate', 'activate') with self.command_group('batch location quotas', get_mgmt_type('location')) as g: - g.command('show', 'get_quotas') + g.show_command('show', 'get_quotas') # Data Plane Commands with self.command_group('batch application summary', get_data_type('application')) as g: diff --git a/src/command_modules/azure-cli-batch/setup.py b/src/command_modules/azure-cli-batch/setup.py index de0b8a930c0..54cfdbcb6d4 100644 --- a/src/command_modules/azure-cli-batch/setup.py +++ b/src/command_modules/azure-cli-batch/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "3.2.7" +VERSION = "3.3.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-batchai/HISTORY.rst b/src/command_modules/azure-cli-batchai/HISTORY.rst index d93fc9621f8..ea310a53dec 100644 --- a/src/command_modules/azure-cli-batchai/HISTORY.rst +++ b/src/command_modules/azure-cli-batchai/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -0.3.3 +0.4.0 +++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * Fixed `az batchai job exec` command 0.3.2 diff --git a/src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/commands.py b/src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/commands.py index b993157b32f..d0e6b8c10cc 100644 --- a/src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/commands.py +++ b/src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/commands.py @@ -62,14 +62,14 @@ def load_command_table(self, _): with self.command_group('batchai workspace', batchai_workspace_sdk, client_factory=workspace_client_factory) as g: g.custom_command('create', 'create_workspace') - g.command('show', 'get', table_transformer=workspace_show_table_format) + g.show_command('show', 'get', table_transformer=workspace_show_table_format) g.custom_command('list', 'list_workspaces', table_transformer=workspace_list_table_format) g.command('delete', 'delete', supports_no_wait=True, confirmation=True) with self.command_group('batchai cluster', batchai_cluster_sdk, client_factory=cluster_client_factory) as g: g.custom_command('create', 'create_cluster', client_factory=batchai_client_factory) g.command('delete', 'delete', supports_no_wait=True, confirmation=True) - g.command('show', 'get', table_transformer=cluster_show_table_format) + g.show_command('show', 'get', table_transformer=cluster_show_table_format) g.custom_command('list', 'list_clusters', table_transformer=cluster_list_table_format) g.custom_command('resize', 'resize_cluster') g.custom_command('auto-scale', 'set_cluster_auto_scale_parameters') @@ -83,7 +83,7 @@ def load_command_table(self, _): with self.command_group('batchai experiment', batchai_experiment_sdk, client_factory=experiment_client_factory) as g: g.command('create', 'create') - g.command('show', 'get', table_transformer=experiment_show_table_format) + g.show_command('show', 'get', table_transformer=experiment_show_table_format) g.command('list', 'list_by_workspace', table_transformer=experiment_list_table_format) g.command('delete', 'delete', supports_no_wait=True, confirmation=True) @@ -91,7 +91,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_job', client_factory=batchai_client_factory) g.command('delete', 'delete', supports_no_wait=True, confirmation=True) g.command('terminate', 'terminate', supports_no_wait=True, confirmation=True) - g.command('show', 'get', table_transformer=job_show_table_format) + g.show_command('show', 'get', table_transformer=job_show_table_format) g.command('list', 'list_by_experiment', table_transformer=job_list_table_format) g.custom_command('wait', 'wait_for_job_completion', client_factory=batchai_client_factory) @@ -106,7 +106,7 @@ def load_command_table(self, _): with self.command_group('batchai file-server', batchai_server_sdk, client_factory=file_server_client_factory) as g: g.custom_command('create', 'create_file_server', no_wait_param='raw', client_factory=batchai_client_factory) g.command('delete', 'delete', supports_no_wait=True, confirmation=True) - g.command('show', 'get', table_transformer=file_server_show_table_format) + g.show_command('show', 'get', table_transformer=file_server_show_table_format) g.command('list', 'list_by_workspace', table_transformer=file_server_list_table_format) with self.command_group('batchai', batchai_usage_sdk, client_factory=usage_client_factory) as g: diff --git a/src/command_modules/azure-cli-batchai/setup.py b/src/command_modules/azure-cli-batchai/setup.py index 29c9d818a7b..f5cab70da14 100644 --- a/src/command_modules/azure-cli-batchai/setup.py +++ b/src/command_modules/azure-cli-batchai/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.3.3" +VERSION = "0.4.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-billing/HISTORY.rst b/src/command_modules/azure-cli-billing/HISTORY.rst index 35235dcb12e..c37f4ae1f49 100644 --- a/src/command_modules/azure-cli-billing/HISTORY.rst +++ b/src/command_modules/azure-cli-billing/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.10 -++++++ -* Minor fixes +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.9 ++++++ diff --git a/src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/commands.py b/src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/commands.py index 91609933a9d..33949e7d6b3 100644 --- a/src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/commands.py +++ b/src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/commands.py @@ -34,12 +34,12 @@ def load_command_table(self, _): with self.command_group('billing invoice', billing_invoice_util, client_factory=invoices_mgmt_client_factory) as g: g.custom_command('list', 'cli_billing_list_invoices') - g.custom_command('show', 'cli_billing_get_invoice') + g.custom_show_command('show', 'cli_billing_get_invoice') with self.command_group('billing period', billing_period_util, client_factory=billing_periods_mgmt_client_factory) as g: g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') with self.command_group('billing enrollment-account', enrollment_account_util, client_factory=enrollment_accounts_mgmt_client_factory) as g: g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') diff --git a/src/command_modules/azure-cli-billing/setup.py b/src/command_modules/azure-cli-billing/setup.py index cb5b6ddf41d..4601f0c6b99 100644 --- a/src/command_modules/azure-cli-billing/setup.py +++ b/src/command_modules/azure-cli-billing/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.1.10" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-cdn/HISTORY.rst b/src/command_modules/azure-cli-cdn/HISTORY.rst index 099324e9ca2..43da1096112 100644 --- a/src/command_modules/azure-cli-cdn/HISTORY.rst +++ b/src/command_modules/azure-cli-cdn/HISTORY.rst @@ -4,8 +4,8 @@ Release History =============== 0.1.0 -++++++ -* Minor fixes ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.0.15 ++++++ diff --git a/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/commands.py b/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/commands.py index b93794d8026..7b08caaa418 100644 --- a/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/commands.py +++ b/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/commands.py @@ -70,7 +70,7 @@ def _inner_not_found(ex): with self.command_group('cdn endpoint', cdn_endpoints_sdk) as g: for name in ['start', 'stop', 'delete']: g.command(name, name) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_profile') g.command('load', 'load_content') g.command('purge', 'purge_content') @@ -82,7 +82,7 @@ def _inner_not_found(ex): doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters') with self.command_group('cdn profile', cdn_profiles_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('usage', 'list_resource_usage') g.command('delete', 'delete') g.custom_command('list', 'list_profiles', client_factory=cf_cdn) @@ -91,7 +91,7 @@ def _inner_not_found(ex): doc_string_source='azure.mgmt.cdn.models#ProfileUpdateParameters') with self.command_group('cdn custom-domain', cdn_domain_sdk, client_factory=cf_cdn) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.command('list', 'list_by_endpoint') g.custom_command('create', 'create_custom_domain') @@ -99,7 +99,7 @@ def _inner_not_found(ex): g.command('disable-https', 'disable_custom_https') with self.command_group('cdn origin', cdn_origin_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_endpoint') with self.command_group('cdn edge-node', cdn_edge_sdk) as g: diff --git a/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/tests/latest/test_profile_scenarios.py b/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/tests/latest/test_profile_scenarios.py index 51b597a8792..8dd55912359 100644 --- a/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/tests/latest/test_profile_scenarios.py +++ b/src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/tests/latest/test_profile_scenarios.py @@ -52,7 +52,7 @@ def test_cdn_custom_domain(self, resource_group): # but they should still fail if there was a CLI-level regression. with self.assertRaises(CloudError): self.cmd('cdn custom-domain create -g {rg} --endpoint-name {endpoint} --hostname {hostname} --profile-name {profile} -n {name}') - with self.assertRaises(CLIError): + with self.assertRaises(SystemExit): # exits with code 3 due to missing resource self.cmd('cdn custom-domain show -g {rg} --endpoint-name {endpoint} --profile-name {profile} -n {name}') self.cmd('cdn custom-domain delete -g {rg} --endpoint-name {endpoint} --profile-name {profile} -n {name}') with self.assertRaises(ErrorResponseException): diff --git a/src/command_modules/azure-cli-cloud/HISTORY.rst b/src/command_modules/azure-cli-cloud/HISTORY.rst index e9c20d27575..db02eb2e56b 100644 --- a/src/command_modules/azure-cli-cloud/HISTORY.rst +++ b/src/command_modules/azure-cli-cloud/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -2.0.16 -++++++ -* Minor fixes +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 2.0.15 ++++++ diff --git a/src/command_modules/azure-cli-cloud/azure/cli/command_modules/cloud/__init__.py b/src/command_modules/azure-cli-cloud/azure/cli/command_modules/cloud/__init__.py index 82b7d4ec949..311c52ea5bf 100644 --- a/src/command_modules/azure-cli-cloud/azure/cli/command_modules/cloud/__init__.py +++ b/src/command_modules/azure-cli-cloud/azure/cli/command_modules/cloud/__init__.py @@ -24,7 +24,7 @@ def load_command_table(self, args): with self.command_group('cloud', cloud_custom) as g: g.command('list', 'list_clouds') - g.command('show', 'show_cloud') + g.show_command('show', 'show_cloud') g.command('register', 'register_cloud') g.command('unregister', 'unregister_cloud') g.command('set', 'set_cloud') diff --git a/src/command_modules/azure-cli-cloud/setup.py b/src/command_modules/azure-cli-cloud/setup.py index 346f2a5d570..f1d47475f82 100644 --- a/src/command_modules/azure-cli-cloud/setup.py +++ b/src/command_modules/azure-cli-cloud/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.16" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-cognitiveservices/HISTORY.rst b/src/command_modules/azure-cli-cognitiveservices/HISTORY.rst index b52e89fb0e3..914193a68f0 100644 --- a/src/command_modules/azure-cli-cognitiveservices/HISTORY.rst +++ b/src/command_modules/azure-cli-cognitiveservices/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.15 -++++++ -* Minor fixes +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.14 ++++++ diff --git a/src/command_modules/azure-cli-cognitiveservices/azure/cli/command_modules/cognitiveservices/commands.py b/src/command_modules/azure-cli-cognitiveservices/azure/cli/command_modules/cognitiveservices/commands.py index 40559626e7e..d5f38b7db2e 100644 --- a/src/command_modules/azure-cli-cognitiveservices/azure/cli/command_modules/cognitiveservices/commands.py +++ b/src/command_modules/azure-cli-cognitiveservices/azure/cli/command_modules/cognitiveservices/commands.py @@ -18,7 +18,7 @@ def load_command_table(self, _): with self.command_group('cognitiveservices account', mgmt_type) as g: g.custom_command('create', 'create') g.command('delete', 'delete') - g.command('show', 'get_properties') + g.show_command('show', 'get_properties') g.custom_command('update', 'update') g.command('list-skus', 'list_skus') diff --git a/src/command_modules/azure-cli-cognitiveservices/setup.py b/src/command_modules/azure-cli-cognitiveservices/setup.py index 10e96ce437f..da85266962e 100644 --- a/src/command_modules/azure-cli-cognitiveservices/setup.py +++ b/src/command_modules/azure-cli-cognitiveservices/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.15" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-consumption/HISTORY.rst b/src/command_modules/azure-cli-consumption/HISTORY.rst index 2181b60b44e..42177acd6f8 100644 --- a/src/command_modules/azure-cli-consumption/HISTORY.rst +++ b/src/command_modules/azure-cli-consumption/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.3.3 -++++++ -* Minor fixes +0.4.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.3.2 ++++++ diff --git a/src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/commands.py b/src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/commands.py index 86f39e14023..4e08c4a5b19 100644 --- a/src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/commands.py +++ b/src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/commands.py @@ -38,8 +38,8 @@ def load_command_table(self, _): exception_handler=consumption_exception_handler, client_factory=reservation_detail_mgmt_client_factory) with self.command_group('consumption pricesheet') as p: - p.custom_command('show', 'cli_consumption_list_pricesheet_show', transform=transform_pricesheet_show_output, - exception_handler=consumption_exception_handler, client_factory=pricesheet_mgmt_client_factory) + p.custom_show_command('show', 'cli_consumption_list_pricesheet_show', transform=transform_pricesheet_show_output, + exception_handler=consumption_exception_handler, client_factory=pricesheet_mgmt_client_factory) with self.command_group('consumption marketplace') as m: m.custom_command('list', 'cli_consumption_list_marketplace', transform=transform_marketplace_list_output, @@ -48,7 +48,7 @@ def load_command_table(self, _): with self.command_group('consumption budget', exception_handler=consumption_exception_handler, client_factory=budget_mgmt_client_factory) as p: p.custom_command('list', 'cli_consumption_list_budgets', transform=transform_budget_list_output) - p.custom_command('show', 'cli_consumption_show_budget', transform=transform_budget_show_output) + p.custom_show_command('show', 'cli_consumption_show_budget', transform=transform_budget_show_output) p.custom_command('create', 'cli_consumption_create_budget', transform=transform_budget_create_update_output, validator=validate_budget_parameters) diff --git a/src/command_modules/azure-cli-consumption/setup.py b/src/command_modules/azure-cli-consumption/setup.py index 627ba4d96c7..71b677ca071 100644 --- a/src/command_modules/azure-cli-consumption/setup.py +++ b/src/command_modules/azure-cli-consumption/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.3.3" +VERSION = "0.4.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-container/HISTORY.rst b/src/command_modules/azure-cli-container/HISTORY.rst index 0a78ccc0348..cb6cd21a49c 100644 --- a/src/command_modules/azure-cli-container/HISTORY.rst +++ b/src/command_modules/azure-cli-container/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -0.2.2 +0.3.0 +++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * Remove the requirement for username and password for non dockerhub registries * Fix error when creating container groups from yaml file diff --git a/src/command_modules/azure-cli-container/azure/cli/command_modules/container/commands.py b/src/command_modules/azure-cli-container/azure/cli/command_modules/container/commands.py index 0ba322027b0..191433a5e8d 100644 --- a/src/command_modules/azure-cli-container/azure/cli/command_modules/container/commands.py +++ b/src/command_modules/azure-cli-container/azure/cli/command_modules/container/commands.py @@ -3,7 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure.cli.core.util import empty_on_404 from ._client_factory import cf_container_groups, cf_container from ._format import transform_container_group_list, transform_container_group @@ -13,8 +12,7 @@ def load_command_table(self, _): g.custom_command('list', 'list_containers', table_transformer=transform_container_group_list) g.custom_command('create', 'create_container', supports_no_wait=True, table_transformer=transform_container_group) - g.custom_command('show', 'get_container', exception_handler=empty_on_404, - table_transformer=transform_container_group) + g.custom_show_command('show', 'get_container', table_transformer=transform_container_group) g.custom_command('delete', 'delete_container', confirmation=True) g.custom_command('logs', 'container_logs', client_factory=cf_container) g.custom_command('exec', 'container_exec') diff --git a/src/command_modules/azure-cli-container/setup.py b/src/command_modules/azure-cli-container/setup.py index 8746331c8a8..f79e02d338e 100644 --- a/src/command_modules/azure-cli-container/setup.py +++ b/src/command_modules/azure-cli-container/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.2" +VERSION = "0.3.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', diff --git a/src/command_modules/azure-cli-cosmosdb/HISTORY.rst b/src/command_modules/azure-cli-cosmosdb/HISTORY.rst index 5c3ea8c2d3a..a89b8b4ba30 100644 --- a/src/command_modules/azure-cli-cosmosdb/HISTORY.rst +++ b/src/command_modules/azure-cli-cosmosdb/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.23 -++++++ -* Minor fixes +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.22 ++++++ diff --git a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/commands.py b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/commands.py index 8514fed1f84..532e2ed17e7 100644 --- a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/commands.py +++ b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/commands.py @@ -17,7 +17,7 @@ def load_command_table(self, _): client_factory=cf_db_accounts) with self.command_group('cosmosdb', cosmosdb_sdk, client_factory=cf_db_accounts) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list-keys', 'list_keys') g.command('list-read-only-keys', 'list_read_only_keys') g.command('list-connection-strings', 'list_connection_strings') diff --git a/src/command_modules/azure-cli-cosmosdb/setup.py b/src/command_modules/azure-cli-cosmosdb/setup.py index 0a4179b91b7..fca80b79510 100644 --- a/src/command_modules/azure-cli-cosmosdb/setup.py +++ b/src/command_modules/azure-cli-cosmosdb/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.1.23" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-dla/HISTORY.rst b/src/command_modules/azure-cli-dla/HISTORY.rst index 777a3027cdd..d58a9ee83ee 100644 --- a/src/command_modules/azure-cli-dla/HISTORY.rst +++ b/src/command_modules/azure-cli-dla/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.2 +0.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.1 ++++++ diff --git a/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/commands.py b/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/commands.py index 4d82ab043fb..30caef3efb5 100644 --- a/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/commands.py +++ b/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/commands.py @@ -67,7 +67,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_adla_account') g.custom_command('update', 'update_adla_account') g.custom_command('list', 'list_adla_account') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') # account fire wall operations @@ -75,7 +75,7 @@ def load_command_table(self, _): g.custom_command('create', 'add_adla_firewall_rule') g.command('update', 'update') g.command('list', 'list_by_account') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') # job operations @@ -83,29 +83,29 @@ def load_command_table(self, _): with self.command_group('dla job', dla_job_sdk, client_factory=cf_dla_job) as g: g.custom_command('submit', 'submit_adla_job', validator=process_dla_job_submit_namespace) g.custom_command('wait', 'wait_adla_job') - g.command('show', 'get') + g.show_command('show', 'get') g.command('cancel', 'cancel') g.custom_command('list', 'list_adla_jobs') # job relationship operations with self.command_group('dla job pipeline', dla_job_pipeline_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') with self.command_group('dla job recurrence', dla_job_recurrence_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') # account data source operations with self.command_group('dla account blob-storage', dla_storage_sdk, client_factory=cf_dla_account_storage) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('add', 'add_adla_blob_storage') g.custom_command('update', 'update_adla_blob_storage') g.command('delete', 'delete') g.command('list', 'list_by_account') with self.command_group('dla account data-lake-store', dla_dls_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_account') g.command('add', 'add') g.command('delete', 'delete') @@ -114,69 +114,69 @@ def load_command_table(self, _): # credential with self.command_group('dla catalog credential', dla_catalog_sdk, client_factory=cf_dla_catalog) as g: g.custom_command('create', 'create_adla_catalog_credential') - g.command('show', 'get_credential') + g.show_command('show', 'get_credential') g.custom_command('update', 'update_adla_catalog_credential') g.command('list', 'list_credentials') g.command('delete', 'delete_credential') # database with self.command_group('dla catalog database', dla_catalog_sdk) as g: - g.command('show', 'get_database') + g.show_command('show', 'get_database') g.command('list', 'list_databases') # schema with self.command_group('dla catalog schema', dla_catalog_sdk) as g: - g.command('show', 'get_schema') + g.show_command('show', 'get_schema') g.command('list', 'list_schemas') # table with self.command_group('dla catalog table', dla_catalog_sdk, client_factory=cf_dla_catalog) as g: - g.command('show', 'get_table') + g.show_command('show', 'get_table') g.custom_command('list', 'list_catalog_tables') # assembly with self.command_group('dla catalog assembly', dla_catalog_sdk) as g: - g.command('show', 'get_assembly') + g.show_command('show', 'get_assembly') g.command('list', 'list_assemblies') # external data source with self.command_group('dla catalog external-data-source', dla_catalog_sdk) as g: - g.command('show', 'get_external_data_source') + g.show_command('show', 'get_external_data_source') g.command('list', 'list_external_data_sources') # get procedure with self.command_group('dla catalog procedure', dla_catalog_sdk) as g: - g.command('show', 'get_procedure') + g.show_command('show', 'get_procedure') g.command('list', 'list_procedures') # get table partition with self.command_group('dla catalog table-partition', dla_catalog_sdk) as g: - g.command('show', 'get_table_partition') + g.show_command('show', 'get_table_partition') g.command('list', 'list_table_partitions') # get table statistics with self.command_group('dla catalog table-stats', dla_catalog_sdk, client_factory=cf_dla_catalog) as g: - g.command('show', 'get_table_statistic') + g.show_command('show', 'get_table_statistic') g.custom_command('list', 'list_catalog_table_statistics') # get table types with self.command_group('dla catalog table-type', dla_catalog_sdk) as g: - g.command('show', 'get_table_type') + g.show_command('show', 'get_table_type') g.command('list', 'list_table_types') # get table valued functions with self.command_group('dla catalog tvf', dla_catalog_sdk, client_factory=cf_dla_catalog) as g: - g.command('show', 'get_table_valued_function') + g.show_command('show', 'get_table_valued_function') g.custom_command('list', 'list_catalog_tvfs') # get views with self.command_group('dla catalog view', dla_catalog_sdk, client_factory=cf_dla_catalog) as g: - g.command('show', 'get_view') + g.show_command('show', 'get_view') g.custom_command('list', 'list_catalog_views') # get packages with self.command_group('dla catalog package', dla_catalog_sdk) as g: - g.command('show', 'get_package') + g.show_command('show', 'get_package') g.command('list', 'list_packages') # compute policy @@ -184,5 +184,5 @@ def load_command_table(self, _): g.custom_command('create', 'create_adla_compute_policy') g.custom_command('update', 'update_adla_compute_policy') g.command('list', 'list_by_account') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') diff --git a/src/command_modules/azure-cli-dla/setup.py b/src/command_modules/azure-cli-dla/setup.py index 8e2738f3507..1e4708ea642 100644 --- a/src/command_modules/azure-cli-dla/setup.py +++ b/src/command_modules/azure-cli-dla/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.1.2" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-dls/HISTORY.rst b/src/command_modules/azure-cli-dls/HISTORY.rst index 86ae496e465..a9822494e26 100644 --- a/src/command_modules/azure-cli-dls/HISTORY.rst +++ b/src/command_modules/azure-cli-dls/HISTORY.rst @@ -5,7 +5,7 @@ Release History 0.1.0 ++++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.0.23 ++++++ diff --git a/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/commands.py b/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/commands.py index 6687daa7062..f0dcec68134 100644 --- a/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/commands.py +++ b/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/commands.py @@ -38,7 +38,7 @@ def load_command_table(self, _): g.custom_command('update', 'update_adls_account') g.custom_command('list', 'list_adls_account') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('enable-key-vault', 'enable_key_vault') # account firewall operations @@ -46,7 +46,7 @@ def load_command_table(self, _): g.custom_command('create', 'add_adls_firewall_rule') g.command('update', 'update') g.command('list', 'list_by_account') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') # account trusted id provider operations @@ -54,12 +54,12 @@ def load_command_table(self, _): g.command('create', 'create_or_update') g.command('update', 'update') g.command('list', 'list_by_account') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') # filesystem operations with self.command_group('dls fs', dls_custom) as g: - g.command('show', 'get_adls_item') + g.show_command('show', 'get_adls_item') g.command('list', 'list_adls_items') g.command('create', 'create_adls_item') g.command('append', 'append_adls_item') @@ -78,7 +78,7 @@ def load_command_table(self, _): with self.command_group('dls fs access', dls_custom) as g: g.command('set-permission', 'set_adls_item_permissions') g.command('set-owner', 'set_adls_item_owner') - g.command('show', 'get_adls_item_acl') + g.show_command('show', 'get_adls_item_acl') g.command('set-entry', 'set_adls_item_acl_entry') g.command('set', 'set_adls_item_acl') g.command('remove-entry', 'remove_adls_item_acl_entry') diff --git a/src/command_modules/azure-cli-dms/HISTORY.rst b/src/command_modules/azure-cli-dms/HISTORY.rst index 8e6492da592..4ae222c7998 100644 --- a/src/command_modules/azure-cli-dms/HISTORY.rst +++ b/src/command_modules/azure-cli-dms/HISTORY.rst @@ -5,7 +5,7 @@ Release History 0.1.0 ++++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.0.2 +++++ diff --git a/src/command_modules/azure-cli-dms/azure/cli/command_modules/dms/commands.py b/src/command_modules/azure-cli-dms/azure/cli/command_modules/dms/commands.py index 9428979e95e..82aa1f5106f 100644 --- a/src/command_modules/azure-cli-dms/azure/cli/command_modules/dms/commands.py +++ b/src/command_modules/azure-cli-dms/azure/cli/command_modules/dms/commands.py @@ -54,10 +54,10 @@ def load_command_table(self, _): g.custom_command('create', 'create_service', supports_no_wait=True) g.custom_command('delete', 'delete_service', supports_no_wait=True, confirmation=True) g.custom_command('list', 'list_services') - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('start', 'start_service', supports_no_wait=True) g.custom_command('stop', 'stop_service', supports_no_wait=True) - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('dms', dms_skus_sdk, client_factory=dms_cf_skus) as g: g.command('list-skus', 'list_skus') @@ -66,7 +66,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_or_update_project') g.command('delete', 'delete', confirmation=True) g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') with self.command_group('dms project', dms_sdk, client_factory=dms_cf_services) as g: g.custom_command('check-name', 'check_project_name_availability') @@ -75,7 +75,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_task') g.command('delete', 'delete', confirmation=True) g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') g.command('cancel', 'cancel') with self.command_group('dms project task', dms_sdk, client_factory=dms_cf_services) as g: diff --git a/src/command_modules/azure-cli-eventgrid/HISTORY.rst b/src/command_modules/azure-cli-eventgrid/HISTORY.rst index f4796157e22..a5987d02d9a 100644 --- a/src/command_modules/azure-cli-eventgrid/HISTORY.rst +++ b/src/command_modules/azure-cli-eventgrid/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.14 -++++++ -* Minor fixes +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.13 ++++++ diff --git a/src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/commands.py b/src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/commands.py index ca2c0659aa5..96c5f4be898 100644 --- a/src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/commands.py +++ b/src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/commands.py @@ -22,7 +22,7 @@ def load_command_table(self, _): with self.command_group('eventgrid topic', topics_mgmt_util, client_factory=topics_factory) as g: g.command('create', 'create_or_update') - g.command('show', 'get') + g.show_command('show', 'get') g.command('key list', 'list_shared_access_keys') g.command('key regenerate', 'regenerate_key') g.command('delete', 'delete') @@ -37,7 +37,7 @@ def load_command_table(self, _): with self.command_group('eventgrid event-subscription', client_factory=event_subscriptions_factory) as g: g.custom_command('create', 'cli_eventgrid_event_subscription_create') - g.custom_command('show', 'cli_eventgrid_event_subscription_get') + g.custom_show_command('show', 'cli_eventgrid_event_subscription_get') g.custom_command('delete', 'cli_eventgrid_event_subscription_delete') g.custom_command('list', 'cli_event_subscription_list') g.generic_update_command('update', @@ -49,5 +49,5 @@ def load_command_table(self, _): with self.command_group('eventgrid topic-type', topic_type_mgmt_util) as g: g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list-event-types', 'list_event_types') diff --git a/src/command_modules/azure-cli-eventgrid/setup.py b/src/command_modules/azure-cli-eventgrid/setup.py index 4e7fc4de690..5806bce08b7 100644 --- a/src/command_modules/azure-cli-eventgrid/setup.py +++ b/src/command_modules/azure-cli-eventgrid/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.14" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-eventhubs/HISTORY.rst b/src/command_modules/azure-cli-eventhubs/HISTORY.rst index d5d12427dfb..569075dea16 100644 --- a/src/command_modules/azure-cli-eventhubs/HISTORY.rst +++ b/src/command_modules/azure-cli-eventhubs/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.5 +0.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.4 ++++++ diff --git a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/commands.py b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/commands.py index 11d4e4c9a6c..1dfedfeb755 100644 --- a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/commands.py +++ b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/commands.py @@ -40,7 +40,7 @@ def load_command_table(self, _): eventhubs_custom = CliCommandType(operations_tmpl=custom_tmpl) with self.command_group('eventhubs namespace', eh_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: g.custom_command('create', 'cli_namespace_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'cli_namespace_list', exception_handler=empty_on_404) g.command('delete', 'delete') g.command('exists', 'check_name_availability') @@ -48,7 +48,7 @@ def load_command_table(self, _): with self.command_group('eventhubs namespace authorization-rule', eh_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: g.command('create', 'create_or_update_authorization_rule') - g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.show_command('show', 'get_authorization_rule') g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) g.command('keys list', 'list_keys') g.command('keys renew', 'regenerate_keys') @@ -58,14 +58,14 @@ def load_command_table(self, _): # EventHub Region with self.command_group('eventhubs eventhub', eh_event_hub_util, client_factory=event_hub_mgmt_client_factory) as g: g.custom_command('create', 'cli_eheventhub_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_namespace', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='cli_eheventhub_update') with self.command_group('eventhubs eventhub authorization-rule', eh_event_hub_util, client_factory=event_hub_mgmt_client_factory) as g: g.command('create', 'create_or_update_authorization_rule') - g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.show_command('show', 'get_authorization_rule') g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) g.command('keys list', 'list_keys') g.command('keys renew', 'regenerate_keys') @@ -75,7 +75,7 @@ def load_command_table(self, _): # ConsumerGroup Region with self.command_group('eventhubs eventhub consumer-group', eh_consumer_groups_util, client_factory=consumer_groups_mgmt_client_factory) as g: g.command('create', 'create_or_update') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_event_hub', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update') @@ -83,7 +83,7 @@ def load_command_table(self, _): # DisasterRecoveryConfigs Region with self.command_group('eventhubs georecovery-alias', eh_geodr_util, client_factory=disaster_recovery_mgmt_client_factory) as g: g.command('set', 'create_or_update') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list', exception_handler=empty_on_404) g.command('break-pair', 'break_pairing') g.command('fail-over', 'fail_over') @@ -92,5 +92,5 @@ def load_command_table(self, _): with self.command_group('eventhubs georecovery-alias authorization-rule', eh_geodr_util, client_factory=disaster_recovery_mgmt_client_factory) as g: g.command('list', 'list_authorization_rules') - g.command('show', 'get_authorization_rule') + g.show_command('show', 'get_authorization_rule') g.command('keys list', 'list_keys') diff --git a/src/command_modules/azure-cli-eventhubs/setup.py b/src/command_modules/azure-cli-eventhubs/setup.py index c2ff0d2c73f..4963d7a74f1 100644 --- a/src/command_modules/azure-cli-eventhubs/setup.py +++ b/src/command_modules/azure-cli-eventhubs/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.5" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-extension/HISTORY.rst b/src/command_modules/azure-cli-extension/HISTORY.rst index d8d6e180308..39dc7365568 100644 --- a/src/command_modules/azure-cli-extension/HISTORY.rst +++ b/src/command_modules/azure-cli-extension/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.1 +0.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.0 +++++ diff --git a/src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/__init__.py b/src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/__init__.py index 547ecd8196f..caf43236b54 100644 --- a/src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/__init__.py +++ b/src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/__init__.py @@ -42,7 +42,7 @@ def validate_extension_add(namespace): g.command('add', 'add_extension', confirmation=ext_add_has_confirmed, validator=validate_extension_add) g.command('remove', 'remove_extension') g.command('list', 'list_extensions') - g.command('show', 'show_extension') + g.show_command('show', 'show_extension') g.command('list-available', 'list_available_extensions', table_transformer=transform_extension_list_available) g.command('update', 'update_extension') diff --git a/src/command_modules/azure-cli-extension/setup.py b/src/command_modules/azure-cli-extension/setup.py index fba731e0c84..0d5d17de7bb 100644 --- a/src/command_modules/azure-cli-extension/setup.py +++ b/src/command_modules/azure-cli-extension/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.1" +VERSION = "0.2.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', diff --git a/src/command_modules/azure-cli-iot/HISTORY.rst b/src/command_modules/azure-cli-iot/HISTORY.rst index e8cd636b616..5525bbd351c 100644 --- a/src/command_modules/azure-cli-iot/HISTORY.rst +++ b/src/command_modules/azure-cli-iot/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.23 -++++++ -* Minor fixes +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.22 ++++++ diff --git a/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/commands.py b/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/commands.py index e584a464236..627ff3afb0d 100644 --- a/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/commands.py +++ b/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/commands.py @@ -35,7 +35,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements # iot dps commands with self.command_group('iot dps', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_list') - g.custom_command('show', 'iot_dps_get') + g.custom_show_command('show', 'iot_dps_get') g.custom_command('create', 'iot_dps_create') g.custom_command('delete', 'iot_dps_delete') g.generic_update_command('update', getter_name='iot_dps_get', setter_name='iot_dps_update', @@ -44,7 +44,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements # iot dps access-policy commands with self.command_group('iot dps access-policy', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_access_policy_list') - g.custom_command('show', 'iot_dps_access_policy_get') + g.custom_show_command('show', 'iot_dps_access_policy_get') g.custom_command('create', 'iot_dps_access_policy_create', supports_no_wait=True) g.custom_command('update', 'iot_dps_access_policy_update', supports_no_wait=True) g.custom_command('delete', 'iot_dps_access_policy_delete', supports_no_wait=True) @@ -52,7 +52,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements # iot dps linked-hub commands with self.command_group('iot dps linked-hub', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_linked_hub_list') - g.custom_command('show', 'iot_dps_linked_hub_get') + g.custom_show_command('show', 'iot_dps_linked_hub_get') g.custom_command('create', 'iot_dps_linked_hub_create', supports_no_wait=True) g.custom_command('update', 'iot_dps_linked_hub_update', supports_no_wait=True) g.custom_command('delete', 'iot_dps_linked_hub_delete', supports_no_wait=True) @@ -60,7 +60,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements # iot dps certificate commands with self.command_group('iot dps certificate', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_certificate_list') - g.custom_command('show', 'iot_dps_certificate_get') + g.custom_show_command('show', 'iot_dps_certificate_get') g.custom_command('create', 'iot_dps_certificate_create') g.custom_command('delete', 'iot_dps_certificate_delete') g.custom_command('generate-verification-code', 'iot_dps_certificate_gen_code') @@ -70,7 +70,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements # iot hub certificate commands with self.command_group('iot hub certificate', client_factory=iot_hub_service_factory) as g: g.custom_command('list', 'iot_hub_certificate_list') - g.custom_command('show', 'iot_hub_certificate_get') + g.custom_show_command('show', 'iot_hub_certificate_get') g.custom_command('create', 'iot_hub_certificate_create') g.custom_command('delete', 'iot_hub_certificate_delete') g.custom_command('generate-verification-code', 'iot_hub_certificate_gen_code') @@ -82,7 +82,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements g.custom_command('create', 'iot_hub_create') g.custom_command('list', 'iot_hub_list') g.custom_command('show-connection-string', 'iot_hub_show_connection_string') - g.custom_command('show', 'iot_hub_get') + g.custom_show_command('show', 'iot_hub_get') g.generic_update_command('update', getter_name='iot_hub_get', setter_name='iot_hub_update', command_type=update_custom_util) g.custom_command('delete', 'iot_hub_delete', transform=HubDeleteResultTransform(self.cli_ctx)) @@ -109,8 +109,8 @@ def load_command_table(self, _): # pylint: disable=too-many-statements deprecate_info='az iot hub device-identity list (via IoT Extension)') g.custom_command('show-connection-string', 'iot_device_show_connection_string', deprecate_info='az iot hub device-identity show-connection-string (via IoT Extension)') - g.custom_command('show', 'iot_device_get', - deprecate_info='az iot hub device-identity show (via IoT Extension)') + g.custom_show_command('show', 'iot_device_get', + deprecate_info='az iot hub device-identity show (via IoT Extension)') g.generic_update_command('update', getter_name='iot_device_get', setter_name='iot_device_update', command_type=update_custom_util, deprecate_info='az iot hub device-identity update (via IoT Extension)') diff --git a/src/command_modules/azure-cli-iot/setup.py b/src/command_modules/azure-cli-iot/setup.py index 444c49892cd..dc8d697ed66 100644 --- a/src/command_modules/azure-cli-iot/setup.py +++ b/src/command_modules/azure-cli-iot/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.23" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-keyvault/HISTORY.rst b/src/command_modules/azure-cli-keyvault/HISTORY.rst index 5e435a18c76..5a18bf5c956 100644 --- a/src/command_modules/azure-cli-keyvault/HISTORY.rst +++ b/src/command_modules/azure-cli-keyvault/HISTORY.rst @@ -3,12 +3,12 @@ Release History =============== -2.0.24 -++++++ +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * adding commands for managing storage accounts and sas-definitions * adding commands for network-rules * adding id parameter to secret, key, and certificate operations -* Minor fixes 2.0.23 ++++++ diff --git a/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/commands.py b/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/commands.py index 7df3f2c255b..d53222c9ae4 100644 --- a/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/commands.py +++ b/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/commands.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.core.util import empty_on_404 from azure.cli.command_modules.keyvault._client_factory import ( keyvault_client_vaults_factory, keyvault_data_plane_factory) @@ -41,7 +40,7 @@ def _data_sdk_path(method): g.custom_command('create', 'create_keyvault', doc_string_source='azure.mgmt.keyvault.models#VaultProperties') g.custom_command('recover', 'recover_keyvault') g.custom_command('list', 'list_keyvault') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('delete', 'delete') g.command('purge', 'purge_deleted') g.custom_command('set-policy', 'set_policy') diff --git a/src/command_modules/azure-cli-keyvault/setup.py b/src/command_modules/azure-cli-keyvault/setup.py index f2331d45f9d..346cccfb56a 100644 --- a/src/command_modules/azure-cli-keyvault/setup.py +++ b/src/command_modules/azure-cli-keyvault/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.24" +VERSION = "2.1.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-lab/HISTORY.rst b/src/command_modules/azure-cli-lab/HISTORY.rst index 19909acfc5f..2caef03cb1f 100644 --- a/src/command_modules/azure-cli-lab/HISTORY.rst +++ b/src/command_modules/azure-cli-lab/HISTORY.rst @@ -5,7 +5,7 @@ Release History 0.1.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.0.23 ++++++ diff --git a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/commands.py b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/commands.py index 27464e8ecc8..b449a96b124 100644 --- a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/commands.py +++ b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/commands.py @@ -83,7 +83,7 @@ def load_command_table(self, _): # Virtual Machine Operations Commands with self.command_group('lab vm', virtual_machine_operations, client_factory=get_devtestlabs_virtual_machine_operation) as g: - g.command('show', 'get', table_transformer=transform_vm) + g.show_command('show', 'get', table_transformer=transform_vm) g.command('delete', 'delete') g.command('start', 'start') g.command('stop', 'stop') @@ -100,7 +100,7 @@ def load_command_table(self, _): # Custom Image Operations Commands with self.command_group('lab custom-image', custom_image_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.custom_command('create', 'create_custom_image', client_factory=get_devtestlabs_custom_image_operation) @@ -116,7 +116,7 @@ def load_command_table(self, _): # Artifact Source Operations Commands with self.command_group('lab artifact-source', artifact_source_operations) as g: g.command('list', 'list', table_transformer=transform_artifact_source_list) - g.command('show', 'get', table_transformer=transform_artifact_source) + g.show_command('show', 'get', table_transformer=transform_artifact_source) # Virtual Network Operations Commands with self.command_group('lab vnet', virtual_network_operations) as g: @@ -125,7 +125,7 @@ def load_command_table(self, _): # Formula Operations Commands with self.command_group('lab formula', formula_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.command('export-artifacts', 'get', transform=export_artifacts) @@ -133,13 +133,13 @@ def load_command_table(self, _): # Secret Operations Commands with self.command_group('lab secret', secret_operations) as g: g.command('set', 'create_or_update') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') # Environment Operations Commands with self.command_group('lab environment', environment_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.command('create', 'create_or_update') @@ -148,5 +148,5 @@ def load_command_table(self, _): # ARM Templates Operations Commands with self.command_group('lab arm-template', arm_template_operations) as g: g.command('list', 'list', table_transformer=transform_arm_template_list) - g.custom_command('show', 'show_arm_template', table_transformer=transform_arm_template, - client_factory=get_devtestlabs_arm_template_operation) + g.custom_show_command('show', 'show_arm_template', table_transformer=transform_arm_template, + client_factory=get_devtestlabs_arm_template_operation) diff --git a/src/command_modules/azure-cli-maps/HISTORY.rst b/src/command_modules/azure-cli-maps/HISTORY.rst index f955cc3899a..e7ea89d1256 100644 --- a/src/command_modules/azure-cli-maps/HISTORY.rst +++ b/src/command_modules/azure-cli-maps/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + 0.2.0 +++++ * BREAKING CHANGE: `maps account create`: added requirement to accept Terms of Service either by interactive prompt or `--accept-tos` flag. diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py index 2d74cb6c5b1..d06c7c76c27 100644 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.core.util import empty_on_404 from azure.cli.command_modules.maps._client_factory import cf_accounts @@ -14,7 +13,7 @@ def load_command_table(self, _): client_factory=cf_accounts) with self.command_group('maps account', mgmt_type) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_accounts') g.custom_command('create', 'create_account') g.command('delete', 'delete') diff --git a/src/command_modules/azure-cli-maps/setup.py b/src/command_modules/azure-cli-maps/setup.py index bb4ec5b4bac..d514fab0c69 100644 --- a/src/command_modules/azure-cli-maps/setup.py +++ b/src/command_modules/azure-cli-maps/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.0" +VERSION = "0.3.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-monitor/HISTORY.rst b/src/command_modules/azure-cli-monitor/HISTORY.rst index e331bce6266..3e556592a63 100644 --- a/src/command_modules/azure-cli-monitor/HISTORY.rst +++ b/src/command_modules/azure-cli-monitor/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.9 +0.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.8 ++++++ diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/commands.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/commands.py index 5b0ce957fc4..0fe5b19c72c 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/commands.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/commands.py @@ -102,7 +102,7 @@ def load_command_table(self, _): exception_handler=monitor_exception_handler) with self.command_group('monitor action-group', action_group_sdk, custom_command_type=action_group_custom) as g: - g.command('show', 'get', table_transformer=action_group_list_table) + g.show_command('show', 'get', table_transformer=action_group_list_table) g.command('create', 'create_or_update', table_transformer=action_group_list_table) g.command('delete', 'delete') g.command('enable-receiver', 'enable_receiver', table_transformer=action_group_list_table) @@ -117,7 +117,7 @@ def load_command_table(self, _): with self.command_group('monitor activity-log alert', activity_log_alerts_sdk, custom_command_type=activity_log_alerts_custom) as g: g.custom_command('list', 'list_activity_logs_alert') g.custom_command('create', 'create') - g.command('show', 'get', exception_handler=missing_resource_handler) + g.show_command('show', 'get', exception_handler=missing_resource_handler) g.command('delete', 'delete', exception_handler=missing_resource_handler) g.generic_update_command('update', custom_func_name='update', setter_arg_name='activity_log_alert') g.custom_command('action-group add', 'add_action_group') @@ -128,7 +128,7 @@ def load_command_table(self, _): with self.command_group('monitor alert', alert_sdk, custom_command_type=alert_custom) as g: g.custom_command('create', 'create_metric_rule') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_resource_group') g.command('show-incident', 'get', command_type=alert_rule_incidents_sdk) g.command('list-incidents', 'list_by_alert_rule', command_type=alert_rule_incidents_sdk) @@ -139,13 +139,13 @@ def load_command_table(self, _): g.generic_update_command('update', custom_func_name='autoscale_update', custom_func_type=autoscale_custom, exception_handler=monitor_exception_handler) g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_resource_group') with self.command_group('monitor autoscale profile', autoscale_sdk, custom_command_type=autoscale_custom) as g: g.custom_command('create', 'autoscale_profile_create') g.custom_command('list', 'autoscale_profile_list') - g.custom_command('show', 'autoscale_profile_show') + g.custom_show_command('show', 'autoscale_profile_show') g.custom_command('delete', 'autoscale_profile_delete') g.custom_command('list-timezones', 'autoscale_profile_list_timezones') @@ -159,7 +159,7 @@ def load_command_table(self, _): deprecate_info=self.deprecate(redirect='monitor autoscale', hide='2.0.34')) as g: g.command('create', 'create_or_update', deprecate_info='az monitor autoscale create') g.command('delete', 'delete', deprecate_info='az monitor autoscale delete') - g.command('show', 'get', deprecate_info='az monitor autoscale show') + g.show_command('show', 'get', deprecate_info='az monitor autoscale show') g.command('list', 'list_by_resource_group', deprecate_info='az monitor autoscale list') g.custom_command('get-parameters-template', 'scaffold_autoscale_settings_parameters', deprecate_info='az monitor autoscale show') g.generic_update_command('update', deprecate_info='az monitor autoscale update') @@ -167,19 +167,19 @@ def load_command_table(self, _): with self.command_group('monitor diagnostic-settings', diagnostics_sdk, custom_command_type=diagnostics_custom) as g: from .validators import validate_diagnostic_settings g.custom_command('create', 'create_diagnostics_settings', validator=validate_diagnostic_settings) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.generic_update_command('update') with self.command_group('monitor diagnostic-settings categories', diagnostics_categories_sdk) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') with self.command_group('monitor log-profiles', log_profiles_sdk, custom_command_type=log_profiles_custom) as g: g.custom_command('create', 'create_log_profile_operations') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list') g.generic_update_command('update') diff --git a/src/command_modules/azure-cli-monitor/setup.py b/src/command_modules/azure-cli-monitor/setup.py index 12e39d9378c..8197bc0f7b6 100644 --- a/src/command_modules/azure-cli-monitor/setup.py +++ b/src/command_modules/azure-cli-monitor/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.9" +VERSION = "0.2.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-network/HISTORY.rst b/src/command_modules/azure-cli-network/HISTORY.rst index 35152bbf09f..329d9962306 100644 --- a/src/command_modules/azure-cli-network/HISTORY.rst +++ b/src/command_modules/azure-cli-network/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -2.1.6 +2.2.0 +++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * `network nic create/update/delete`: Add `--no-wait` support. * Added `network nic wait`. * `network vnet subnet list`: Argument `--ids` is deprecated. diff --git a/src/command_modules/azure-cli-network/azure/cli/command_modules/network/commands.py b/src/command_modules/azure-cli-network/azure/cli/command_modules/network/commands.py index 7d017787837..707b316764d 100644 --- a/src/command_modules/azure-cli-network/azure/cli/command_modules/network/commands.py +++ b/src/command_modules/azure-cli-network/azure/cli/command_modules/network/commands.py @@ -8,7 +8,6 @@ from azure.cli.core.commands import DeploymentOutputLongRunningOperation from azure.cli.core.commands.arm import deployment_validate_table_format, handle_template_based_exception from azure.cli.core.commands import CliCommandType -from azure.cli.core.util import empty_on_404 from azure.cli.command_modules.network._client_factory import ( cf_application_gateways, cf_express_route_circuit_authorizations, @@ -222,13 +221,13 @@ def load_command_table(self, _): with self.command_group('network application-gateway', network_ag_sdk) as g: g.custom_command('create', 'create_application_gateway', transform=DeploymentOutputLongRunningOperation(self.cli_ctx), supports_no_wait=True, table_transformer=deployment_validate_table_format, validator=process_ag_create_namespace, exception_handler=handle_template_based_exception) g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_application_gateways') g.command('start', 'start') g.command('stop', 'stop') g.command('show-backend-health', 'backend_health', min_api='2016-09-01') g.generic_update_command('update', supports_no_wait=True, custom_func_name='update_application_gateway') - g.generic_wait_command('wait') + g.wait_command('wait') subresource_properties = [ {'prop': 'authentication_certificates', 'name': 'auth-cert'}, @@ -259,7 +258,7 @@ def _make_singular(value): create_validator = kwargs.get('validator', None) with self.command_group('network application-gateway {}'.format(alias), network_util) as g: g.command('list', list_network_resource_property('application_gateways', subresource)) - g.command('show', get_network_resource_property_entry('application_gateways', subresource), exception_handler=empty_on_404) + g.show_command('show', get_network_resource_property_entry('application_gateways', subresource)) g.command('delete', delete_network_resource_property_entry('application_gateways', subresource), supports_no_wait=True) g.custom_command('create', 'create_ag_{}'.format(_make_singular(subresource)), supports_no_wait=True, validator=create_validator) g.generic_update_command('update', command_type=network_ag_sdk, supports_no_wait=True, @@ -269,7 +268,7 @@ def _make_singular(value): with self.command_group('network application-gateway redirect-config', network_util, min_api='2017-06-01') as g: subresource = 'redirect_configurations' g.command('list', list_network_resource_property('application_gateways', subresource)) - g.command('show', get_network_resource_property_entry('application_gateways', subresource), exception_handler=empty_on_404) + g.show_command('show', get_network_resource_property_entry('application_gateways', subresource)) g.command('delete', delete_network_resource_property_entry('application_gateways', subresource), supports_no_wait=True) g.custom_command('create', 'create_ag_{}'.format(_make_singular(subresource)), supports_no_wait=True, doc_string_source='ApplicationGatewayRedirectConfiguration') g.generic_update_command('update', command_type=network_ag_sdk, @@ -280,7 +279,7 @@ def _make_singular(value): with self.command_group('network application-gateway ssl-policy') as g: g.custom_command('set', 'set_ag_ssl_policy_2017_06_01', min_api='2017-06-01', supports_no_wait=True, validator=process_ag_ssl_policy_set_namespace, doc_string_source='ApplicationGatewaySslPolicy') g.custom_command('set', 'set_ag_ssl_policy_2017_03_01', max_api='2017-03-01', supports_no_wait=True, validator=process_ag_ssl_policy_set_namespace) - g.custom_command('show', 'show_ag_ssl_policy', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_ag_ssl_policy') with self.command_group('network application-gateway ssl-policy', network_ag_sdk, min_api='2017-06-01') as g: g.command('list-options', 'list_available_ssl_options') @@ -294,7 +293,7 @@ def _make_singular(value): with self.command_group('network application-gateway waf-config') as g: g.custom_command('set', 'set_ag_waf_config_2017_03_01', min_api='2017-03-01', supports_no_wait=True) g.custom_command('set', 'set_ag_waf_config_2016_09_01', max_api='2016-09-01', supports_no_wait=True) - g.custom_command('show', 'show_ag_waf_config', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_ag_waf_config') g.custom_command('list-rule-sets', 'list_ag_waf_rule_sets', min_api='2017-03-01', client_factory=cf_application_gateways, table_transformer=transform_waf_rule_sets_table_output) # endregion @@ -302,7 +301,7 @@ def _make_singular(value): # region ApplicationSecurityGroups with self.command_group('network asg', network_asg_sdk, client_factory=cf_application_security_groups, min_api='2017-09-01') as g: g.custom_command('create', 'create_asg') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_all') g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='update_asg') @@ -314,7 +313,7 @@ def _make_singular(value): g.custom_command('create', 'create_ddos_plan') g.command('delete', 'delete') g.custom_command('list', 'list_ddos_plans') - g.command('show', 'get') + g.show_command('show', 'get') g.generic_update_command('update', custom_func_name='update_ddos_plan') # endregion @@ -322,7 +321,7 @@ def _make_singular(value): # region DNS with self.command_group('network dns zone', network_dns_zone_sdk) as g: g.command('delete', 'delete', confirmation=True) - g.command('show', 'get', table_transformer=transform_dns_zone_table_output, exception_handler=empty_on_404) + g.show_command('show', 'get', table_transformer=transform_dns_zone_table_output) g.custom_command('list', 'list_dns_zones', table_transformer=transform_dns_zone_table_output) g.custom_command('import', 'import_zone') g.custom_command('export', 'export_zone') @@ -334,7 +333,7 @@ def _make_singular(value): for record in ['a', 'aaaa', 'mx', 'ns', 'ptr', 'srv', 'txt', 'caa']: with self.command_group('network dns record-set {}'.format(record), network_dns_record_set_sdk) as g: - g.command('show', 'get', transform=transform_dns_record_set_output, exception_handler=empty_on_404) + g.show_command('show', 'get', transform=transform_dns_record_set_output) g.command('delete', 'delete', confirmation=True) g.custom_command('list', 'list_dns_record_set', client_factory=cf_dns_mgmt_record_sets, transform=transform_dns_record_set_output, table_transformer=transform_dns_record_set_table_output) g.custom_command('create', 'create_dns_record_set', transform=transform_dns_record_set_output, doc_string_source='azure.mgmt.dns.operations#RecordSetsOperations.create_or_update') @@ -343,11 +342,11 @@ def _make_singular(value): g.generic_update_command('update', custom_func_name='update_dns_record_set', transform=transform_dns_record_set_output) with self.command_group('network dns record-set soa', network_dns_record_set_sdk) as g: - g.command('show', 'get', transform=transform_dns_record_set_output, exception_handler=empty_on_404) + g.show_command('show', 'get', transform=transform_dns_record_set_output) g.custom_command('update', 'update_dns_soa_record', transform=transform_dns_record_set_output) with self.command_group('network dns record-set cname', network_dns_record_set_sdk) as g: - g.command('show', 'get', transform=transform_dns_record_set_output, exception_handler=empty_on_404) + g.show_command('show', 'get', transform=transform_dns_record_set_output) g.command('delete', 'delete') g.custom_command('list', 'list_dns_record_set', client_factory=cf_dns_mgmt_record_sets, transform=transform_dns_record_set_output, table_transformer=transform_dns_record_set_table_output) g.custom_command('create', 'create_dns_record_set', transform=transform_dns_record_set_output, doc_string_source='azure.mgmt.dns.operations#RecordSetsOperations.create_or_update') @@ -359,7 +358,7 @@ def _make_singular(value): # region ExpressRoutes with self.command_group('network express-route', network_er_sdk) as g: g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('get-stats', 'get_stats') g.command('list-arp-tables', 'list_arp_table') g.command('list-route-tables', 'list_routes_table') @@ -367,18 +366,18 @@ def _make_singular(value): g.custom_command('list', 'list_express_route_circuits') g.command('list-service-providers', 'list', command_type=network_ersp_sdk) g.generic_update_command('update', custom_func_name='update_express_route', supports_no_wait=True) - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('network express-route auth', network_erca_sdk) as g: g.command('create', 'create_or_update', validator=process_auth_create_namespace) g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') with self.command_group('network express-route peering', network_er_peering_sdk) as g: g.custom_command('create', 'create_express_route_peering', client_factory=cf_express_route_circuit_peerings) g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') g.generic_update_command('update', setter_arg_name='peering_parameters', custom_func_name='update_express_route_peering') @@ -386,7 +385,7 @@ def _make_singular(value): # region LoadBalancers with self.command_group('network lb', network_lb_sdk) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('create', 'create_load_balancer', transform=DeploymentOutputLongRunningOperation(self.cli_ctx), supports_no_wait=True, table_transformer=deployment_validate_table_format, validator=process_lb_create_namespace, exception_handler=handle_template_based_exception) g.command('delete', 'delete') g.custom_command('list', 'list_lbs') @@ -403,7 +402,7 @@ def _make_singular(value): for subresource, alias in property_map.items(): with self.command_group('network lb {}'.format(alias), network_util) as g: g.command('list', list_network_resource_property('load_balancers', subresource)) - g.command('show', get_network_resource_property_entry('load_balancers', subresource), exception_handler=empty_on_404) + g.show_command('show', get_network_resource_property_entry('load_balancers', subresource)) g.command('delete', delete_network_resource_property_entry('load_balancers', subresource)) with self.command_group('network lb frontend-ip', network_lb_sdk) as g: @@ -440,11 +439,11 @@ def _make_singular(value): # region LocalGateways with self.command_group('network local-gateway', network_lgw_sdk) as g: g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list', table_transformer=transform_local_gateway_table_output) g.custom_command('create', 'create_local_gateway', supports_no_wait=True, validator=process_local_gateway_create_namespace) g.generic_update_command('update', custom_func_name='update_local_gateway', supports_no_wait=True) - g.generic_wait_command('wait') + g.wait_command('wait') # endregion @@ -453,12 +452,12 @@ def _make_singular(value): with self.command_group('network nic', network_nic_sdk) as g: g.custom_command('create', 'create_nic', transform=transform_nic_create_output, validator=process_nic_create_namespace, supports_no_wait=True) g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_nics') g.command('show-effective-route-table', 'get_effective_route_table', min_api='2016-09-01') g.command('list-effective-nsg', 'list_effective_network_security_groups', min_api='2016-09-01') g.generic_update_command('update', custom_func_name='update_nic', supports_no_wait=True) - g.generic_wait_command('wait') + g.wait_command('wait') resource = 'network_interfaces' subresource = 'ip_configurations' @@ -468,7 +467,7 @@ def _make_singular(value): child_collection_prop_name='ip_configurations', child_arg_name='ip_config_name', custom_func_name='set_nic_ip_config') g.command('list', list_network_resource_property(resource, subresource), command_type=network_util) - g.command('show', get_network_resource_property_entry(resource, subresource), command_type=network_util, exception_handler=empty_on_404) + g.show_command('show', get_network_resource_property_entry(resource, subresource), command_type=network_util) g.command('delete', delete_network_resource_property_entry(resource, subresource), command_type=network_util) with self.command_group('network nic ip-config address-pool') as g: @@ -484,14 +483,14 @@ def _make_singular(value): # region NetworkSecurityGroups with self.command_group('network nsg', network_nsg_sdk) as g: g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_nsgs') g.custom_command('create', 'create_nsg', transform=transform_nsg_create_output) g.generic_update_command('update') with self.command_group('network nsg rule', network_nsg_rule_sdk) as g: g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404, table_transformer=transform_nsg_rule_table_output) + g.show_command('show', 'get', table_transformer=transform_nsg_rule_table_output) g.command('list', 'list', table_transformer=lambda x: [transform_nsg_rule_table_output(i) for i in x]) g.custom_command('create', 'create_nsg_rule_2017_06_01', min_api='2017-06-01') g.generic_update_command('update', setter_arg_name='security_rule_parameters', min_api='2017-06-01', @@ -514,7 +513,7 @@ def _make_singular(value): with self.command_group('network watcher connection-monitor', network_watcher_cm_sdk, client_factory=cf_connection_monitor, min_api='2018-01-01') as g: g.custom_command('create', 'create_nw_connection_monitor', validator=process_nw_cm_create_namespace) g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('stop', 'stop') g.command('start', 'start') g.command('query', 'query') @@ -522,7 +521,7 @@ def _make_singular(value): with self.command_group('network watcher packet-capture', network_watcher_pc_sdk, min_api='2016-09-01') as g: g.custom_command('create', 'create_nw_packet_capture', client_factory=cf_packet_capture, validator=process_nw_packet_capture_create_namespace) - g.command('show', 'get') + g.show_command('show', 'get') g.command('show-status', 'get_status') g.command('delete', 'delete') g.command('stop', 'stop') @@ -530,11 +529,11 @@ def _make_singular(value): with self.command_group('network watcher flow-log', client_factory=cf_network_watcher, min_api='2016-09-01') as g: g.custom_command('configure', 'set_nsg_flow_logging', validator=process_nw_flow_log_set_namespace) - g.custom_command('show', 'show_nsg_flow_logging', validator=process_nw_flow_log_show_namespace) + g.custom_show_command('show', 'show_nsg_flow_logging', validator=process_nw_flow_log_show_namespace) with self.command_group('network watcher troubleshooting', client_factory=cf_network_watcher, min_api='2016-09-01') as g: g.custom_command('start', 'start_nw_troubleshooting', supports_no_wait=True, validator=process_nw_troubleshooting_start_namespace) - g.custom_command('show', 'show_nw_troubleshooting_result', validator=process_nw_troubleshooting_show_namespace) + g.custom_show_command('show', 'show_nw_troubleshooting_result', validator=process_nw_troubleshooting_show_namespace) # endregion # region PublicIPAddresses @@ -544,7 +543,7 @@ def _make_singular(value): with self.command_group('network public-ip', network_public_ip_sdk) as g: g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404, table_transformer=public_ip_show_table_transform) + g.show_command('show', 'get', table_transformer=public_ip_show_table_transform) g.custom_command('list', 'list_public_ips', table_transformer='[].' + public_ip_show_table_transform) g.custom_command('create', 'create_public_ip', transform=transform_public_ip_create_output, validator=process_public_ip_create_namespace) g.generic_update_command('update', custom_func_name='update_public_ip') @@ -555,14 +554,14 @@ def _make_singular(value): with self.command_group('network route-filter', network_rf_sdk, min_api='2016-12-01') as g: g.custom_command('create', 'create_route_filter', client_factory=cf_route_filters) g.custom_command('list', 'list_route_filters', client_factory=cf_route_filters) - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.generic_update_command('update', setter_arg_name='route_filter_parameters') with self.command_group('network route-filter rule', network_rfr_sdk, min_api='2016-12-01') as g: g.custom_command('create', 'create_route_filter_rule', client_factory=cf_route_filter_rules) g.command('list', 'list_by_route_filter') - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.generic_update_command('update', setter_arg_name='route_filter_rule_parameters') sc_path = 'azure.mgmt.network.operations#BgpServiceCommunitiesOperations.{}' @@ -574,7 +573,7 @@ def _make_singular(value): with self.command_group('network route-table', network_rt_sdk) as g: g.custom_command('create', 'create_route_table', validator=process_route_table_create_namespace) g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_route_tables') g.generic_update_command('update', custom_func_name='update_route_table') @@ -585,7 +584,7 @@ def _make_singular(value): with self.command_group('network route-table route', network_rtr_sdk) as g: g.custom_command('create', 'create_route') g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') g.generic_update_command('update', setter_arg_name='route_parameters', custom_func_name='update_route') @@ -594,14 +593,14 @@ def _make_singular(value): # region TrafficManagers with self.command_group('network traffic-manager profile', network_tmp_sdk) as g: g.command('check-dns', 'check_traffic_manager_relative_dns_name_availability') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('delete', 'delete') g.custom_command('list', 'list_traffic_manager_profiles') g.custom_command('create', 'create_traffic_manager_profile', transform=transform_traffic_manager_create_output) g.generic_update_command('update', custom_func_name='update_traffic_manager_profile') with self.command_group('network traffic-manager endpoint', network_tme_sdk) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('delete', 'delete') g.custom_command('create', 'create_traffic_manager_endpoint', validator=process_tm_endpoint_create_namespace) g.custom_command('list', 'list_traffic_manager_endpoints') @@ -615,7 +614,7 @@ def _make_singular(value): # region VirtualNetworks with self.command_group('network vnet', network_vnet_sdk) as g: g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_vnet') g.command('check-ip-address', 'check_ip_address_availability', min_api='2016-09-01') g.custom_command('create', 'create_vnet', transform=transform_vnet_create_output, validator=process_vnet_create_namespace) @@ -624,14 +623,14 @@ def _make_singular(value): with self.command_group('network vnet peering', network_vnet_peering_sdk, min_api='2016-09-01') as g: g.custom_command('create', 'create_vnet_peering') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') g.command('delete', 'delete') g.generic_update_command('update', setter_name='update_vnet_peering', setter_type=network_custom) with self.command_group('network vnet subnet', network_subnet_sdk) as g: g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') g.custom_command('create', 'create_subnet') g.generic_update_command('update', setter_arg_name='subnet_parameters', @@ -644,9 +643,9 @@ def _make_singular(value): with self.command_group('network vnet-gateway', network_vgw_sdk, min_api='2016-09-01') as g: g.custom_command('create', 'create_vnet_gateway', supports_no_wait=True, transform=transform_vnet_gateway_create_output, validator=process_vnet_gateway_create_namespace) g.generic_update_command('update', custom_func_name='update_vnet_gateway', supports_no_wait=True, validator=process_vnet_gateway_update_namespace) - g.generic_wait_command('wait') + g.wait_command('wait') g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list') g.command('reset', 'reset') g.command('list-bgp-peer-status', 'get_bgp_peer_status') @@ -671,12 +670,12 @@ def _make_singular(value): with self.command_group('network vpn-connection', network_vpn_sdk) as g: g.custom_command('create', 'create_vpn_connection', transform=DeploymentOutputLongRunningOperation(self.cli_ctx), table_transformer=deployment_validate_table_format, validator=process_vpn_connection_create_namespace, exception_handler=handle_template_based_exception) g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404, transform=transform_vpn_connection) + g.show_command('show', 'get', transform=transform_vpn_connection) g.command('list', 'list', transform=transform_vpn_connection_list) g.generic_update_command('update', custom_func_name='update_vpn_connection') with self.command_group('network vpn-connection shared-key', network_vpn_sdk) as g: - g.command('show', 'get_shared_key', exception_handler=empty_on_404) + g.show_command('show', 'get_shared_key') g.command('reset', 'reset_shared_key') g.generic_update_command('update', setter_name='set_shared_key') diff --git a/src/command_modules/azure-cli-network/azure/cli/command_modules/network/tests/latest/test_dns_commands.py b/src/command_modules/azure-cli-network/azure/cli/command_modules/network/tests/latest/test_dns_commands.py index bde8f37f3ae..c01f867087b 100644 --- a/src/command_modules/azure-cli-network/azure/cli/command_modules/network/tests/latest/test_dns_commands.py +++ b/src/command_modules/azure-cli-network/azure/cli/command_modules/network/tests/latest/test_dns_commands.py @@ -150,11 +150,9 @@ def test_dns(self, resource_group): self.cmd('network dns record-set a remove-record -g {rg} --zone-name {zone} --record-set-name myrsa --ipv4-address 10.0.0.11') - self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', - checks=self.is_empty()) + self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', expect_failure=True) self.cmd('network dns record-set a delete -n myrsa -g {rg} --zone-name {zone} -y') - self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}') self.cmd('network dns zone delete -g {rg} -n {zone} -y', checks=self.is_empty()) @@ -231,11 +229,10 @@ def test_private_dns(self, resource_group): self.cmd('network dns record-set a remove-record -g {rg} --zone-name {zone} --record-set-name myrsa --ipv4-address 10.0.0.11') - self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', - checks=self.is_empty()) + self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', expect_failure=True) self.cmd('network dns record-set a delete -n myrsa -g {rg} --zone-name {zone} -y') - self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}') + self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', expect_failure=True) self.cmd('network dns zone delete -g {rg} -n {zone} -y', checks=self.is_empty()) diff --git a/src/command_modules/azure-cli-network/setup.py b/src/command_modules/azure-cli-network/setup.py index 41df69af19d..abd3e184a02 100644 --- a/src/command_modules/azure-cli-network/setup.py +++ b/src/command_modules/azure-cli-network/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.1.6" +VERSION = "2.2.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-profile/HISTORY.rst b/src/command_modules/azure-cli-profile/HISTORY.rst index b1c9ea36a7b..b3bec7515e0 100644 --- a/src/command_modules/azure-cli-profile/HISTORY.rst +++ b/src/command_modules/azure-cli-profile/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -2.0.28 +2.1.0 ++++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 2.0.27 ++++++ diff --git a/src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/__init__.py b/src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/__init__.py index b3662e3df4c..d3b1918c935 100644 --- a/src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/__init__.py +++ b/src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/__init__.py @@ -29,7 +29,7 @@ def load_command_table(self, args): with self.command_group('account', profile_custom) as g: g.command('list', 'list_subscriptions', table_transformer=transform_account_list) g.command('set', 'set_active_subscription') - g.command('show', 'show_subscription') + g.show_command('show', 'show_subscription') g.command('clear', 'account_clear') g.command('list-locations', 'list_locations') g.command('get-access-token', 'get_access_token') diff --git a/src/command_modules/azure-cli-profile/setup.py b/src/command_modules/azure-cli-profile/setup.py index 1b2d6438b77..f5ac45ffb54 100644 --- a/src/command_modules/azure-cli-profile/setup.py +++ b/src/command_modules/azure-cli-profile/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.28" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-rdbms/HISTORY.rst b/src/command_modules/azure-cli-rdbms/HISTORY.rst index e3c19444927..f7232ba3c5e 100644 --- a/src/command_modules/azure-cli-rdbms/HISTORY.rst +++ b/src/command_modules/azure-cli-rdbms/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.2.6 +0.3.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.2.5 +++++ diff --git a/src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/commands.py b/src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/commands.py index eb715512556..f2940404dde 100644 --- a/src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/commands.py +++ b/src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/commands.py @@ -90,31 +90,31 @@ def load_command_table(self, _): g.custom_command('restore', '_server_restore', supports_no_wait=True) g.custom_command('georestore', '_server_georestore', supports_no_wait=True) g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('list', '_server_list_custom_func') g.generic_update_command('update', getter_name='_server_update_get', getter_type=rdbms_custom, setter_name='_server_update_set', setter_type=rdbms_custom, setter_arg_name='parameters', custom_func_name='_server_update_custom_func') - g.generic_wait_command('wait', getter_name='_server_mysql_get', getter_type=rdbms_custom) + g.custom_wait_command('wait', '_server_mysql_get') with self.command_group('postgres server', postgres_servers_sdk, client_factory=cf_postgres_servers) as g: g.custom_command('create', '_server_create') g.custom_command('restore', '_server_restore', supports_no_wait=True) g.custom_command('georestore', '_server_georestore', supports_no_wait=True) g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('list', '_server_list_custom_func') g.generic_update_command('update', getter_name='_server_update_get', getter_type=rdbms_custom, setter_name='_server_update_set', setter_type=rdbms_custom, setter_arg_name='parameters', custom_func_name='_server_update_custom_func') - g.generic_wait_command('wait', getter_name='_server_postgresql_get', getter_type=rdbms_custom) + g.custom_wait_command('wait', '_server_postgresql_get') with self.command_group('mysql server firewall-rule', mysql_firewall_rule_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') g.generic_update_command('update', getter_name='_firewall_rule_custom_getter', getter_type=rdbms_custom, @@ -124,7 +124,7 @@ def load_command_table(self, _): with self.command_group('postgres server firewall-rule', postgres_firewall_rule_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') g.generic_update_command('update', getter_name='_firewall_rule_custom_getter', getter_type=rdbms_custom, @@ -134,25 +134,25 @@ def load_command_table(self, _): with self.command_group('mysql server vnet-rule', mysql_vnet_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') g.generic_update_command('update') with self.command_group('postgres server vnet-rule', postgres_vnet_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') g.generic_update_command('update') with self.command_group('mysql server configuration', mysql_config_sdk) as g: g.command('set', 'create_or_update') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') with self.command_group('postgres server configuration', postgres_config_sdk) as g: g.command('set', 'create_or_update') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') with self.command_group('mysql server-logs', mysql_log_sdk, client_factory=cf_mysql_log) as g: @@ -166,11 +166,11 @@ def load_command_table(self, _): with self.command_group('mysql db', mysql_db_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') with self.command_group('postgres db', postgres_db_sdk) as g: g.command('create', 'create_or_update') g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') diff --git a/src/command_modules/azure-cli-rdbms/setup.py b/src/command_modules/azure-cli-rdbms/setup.py index f90f79a8af4..7d4ddde887c 100644 --- a/src/command_modules/azure-cli-rdbms/setup.py +++ b/src/command_modules/azure-cli-rdbms/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.6" +VERSION = "0.3.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-redis/HISTORY.rst b/src/command_modules/azure-cli-redis/HISTORY.rst index dfc44d434df..f01784b1547 100644 --- a/src/command_modules/azure-cli-redis/HISTORY.rst +++ b/src/command_modules/azure-cli-redis/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.2.15 -++++++ -* Minor fixes +0.3.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.2.14 ++++++ diff --git a/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/commands.py b/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/commands.py index 0aa79ec0cd8..1201ba69848 100644 --- a/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/commands.py +++ b/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/commands.py @@ -32,7 +32,7 @@ def load_command_table(self, _): g.command('list-all', 'list', deprecate_info=g.deprecate(redirect='redis list', hide='2.0.34')) g.command('list-keys', 'list_keys') g.command('regenerate-keys', 'regenerate_key') - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('update-settings', 'cli_redis_update_settings', deprecate_info=g.deprecate(redirect='redis update', hide='2.0.34')) g.generic_update_command('update', exception_handler=wrong_vmsize_argument_exception_handler, @@ -41,4 +41,4 @@ def load_command_table(self, _): with self.command_group('redis patch-schedule', redis_patch) as g: g.command('set', 'create_or_update') g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') diff --git a/src/command_modules/azure-cli-redis/setup.py b/src/command_modules/azure-cli-redis/setup.py index 6048aad1164..c6543fa2b05 100644 --- a/src/command_modules/azure-cli-redis/setup.py +++ b/src/command_modules/azure-cli-redis/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.15" +VERSION = "0.3.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-reservations/HISTORY.rst b/src/command_modules/azure-cli-reservations/HISTORY.rst index 2c0eb18aa3f..3d76eaa9619 100644 --- a/src/command_modules/azure-cli-reservations/HISTORY.rst +++ b/src/command_modules/azure-cli-reservations/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.2.2 +0.3.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.2.1 +++++ diff --git a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/commands.py b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/commands.py index 07be4ab6aed..d1405d1ae8f 100644 --- a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/commands.py +++ b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/commands.py @@ -32,11 +32,11 @@ def reservations_type(*args, **kwargs): with self.command_group('reservations reservation-order', reservations_order_sdk) as g: g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') with self.command_group('reservations reservation', reservations_sdk) as g: g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') g.command('list-history', 'list_revisions') g.custom_command('update', 'cli_reservation_update_reservation') g.custom_command('split', 'cli_reservation_split_reservation') @@ -46,4 +46,4 @@ def reservations_type(*args, **kwargs): g.command('list', 'get_applied_reservation_list') with self.command_group('reservations catalog', reservations_client_sdk) as g: - g.command('show', 'get_catalog') + g.show_command('show', 'get_catalog') diff --git a/src/command_modules/azure-cli-reservations/setup.py b/src/command_modules/azure-cli-reservations/setup.py index 000e043fdd0..0b391b5bc25 100644 --- a/src/command_modules/azure-cli-reservations/setup.py +++ b/src/command_modules/azure-cli-reservations/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.2" +VERSION = "0.3.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-resource/HISTORY.rst b/src/command_modules/azure-cli-resource/HISTORY.rst index 290bb803039..349db6275cc 100644 --- a/src/command_modules/azure-cli-resource/HISTORY.rst +++ b/src/command_modules/azure-cli-resource/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -2.0.33 -++++++ +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * `group deployment delete`: Add `--no-wait` support. * `deployment delete`: Add `--no-wait` support. * Added `deployment wait` command. diff --git a/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/commands.py b/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/commands.py index 4b5ce77fafd..661421454d0 100644 --- a/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/commands.py +++ b/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/commands.py @@ -143,30 +143,30 @@ def load_command_table(self, _): g.custom_command('create', 'create_lock') g.custom_command('delete', 'delete_lock') g.custom_command('list', 'list_locks') - g.custom_command('show', 'get_lock', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_lock') g.custom_command('update', 'update_lock') with self.command_group('group', resource_group_sdk, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.command('delete', 'delete', supports_no_wait=True, confirmation=True) - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('exists', 'check_existence') g.custom_command('list', 'list_resource_groups', table_transformer=transform_resource_group_list) g.custom_command('create', 'create_resource_group') g.custom_command('export', 'export_group_as_template') g.generic_update_command('update', custom_func_name='update_resource_group', custom_func_type=resource_custom) - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('group lock', resource_type=ResourceType.MGMT_RESOURCE_LOCKS) as g: g.custom_command('create', 'create_lock') g.custom_command('delete', 'delete_lock') g.custom_command('list', 'list_locks') - g.custom_command('show', 'get_lock', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_lock') g.custom_command('update', 'update_lock') with self.command_group('resource', resource_custom, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.custom_command('create', 'create_resource') g.custom_command('delete', 'delete_resource') - g.custom_command('show', 'show_resource', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_resource') g.custom_command('list', 'list_resources', table_transformer=transform_resource_list) g.custom_command('tag', 'tag_resource') g.custom_command('move', 'move_resource') @@ -178,13 +178,13 @@ def load_command_table(self, _): g.custom_command('create', 'create_lock') g.custom_command('delete', 'delete_lock') g.custom_command('list', 'list_locks') - g.custom_command('show', 'get_lock', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_lock') g.custom_command('update', 'update_lock') # Resource provider commands with self.command_group('provider', resource_provider_sdk, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.command('list', 'list') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('register', 'register_provider') g.custom_command('unregister', 'unregister_provider') g.custom_command('operation list', 'list_provider_operations') @@ -194,7 +194,7 @@ def load_command_table(self, _): with self.command_group('feature', resource_feature_sdk, client_factory=cf_features, resource_type=ResourceType.MGMT_RESOURCE_FEATURES) as g: feature_table_transform = '{Name:name, RegistrationState:properties.state}' g.custom_command('list', 'list_features', table_transformer='[].' + feature_table_transform) - g.command('show', 'get', exception_handler=empty_on_404, table_transformer=feature_table_transform) + g.show_command('show', 'get', table_transformer=feature_table_transform) g.custom_command('register', 'register_feature') # Tag commands @@ -209,78 +209,78 @@ def load_command_table(self, _): g.custom_command('create', 'deploy_arm_template', supports_no_wait=True, validator=process_deployment_create_namespace, exception_handler=handle_template_based_exception) g.command('list', 'list_by_resource_group', table_transformer=transform_deployments_list, min_api='2017-05-10') g.command('list', 'list', table_transformer=transform_deployments_list, max_api='2016-09-01') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('delete', 'delete', supports_no_wait=True) g.custom_command('validate', 'validate_arm_template', table_transformer=deployment_validate_table_format, exception_handler=handle_template_based_exception) g.custom_command('export', 'export_deployment_as_template') - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('group deployment operation', resource_deployment_operation_sdk) as g: g.command('list', 'list') - g.custom_command('show', 'get_deployment_operations', client_factory=cf_deployment_operations, exception_handler=empty_on_404) + g.custom_show_command('show', 'get_deployment_operations', client_factory=cf_deployment_operations) with self.command_group('deployment', resource_deployment_sdk, min_api='2018-05-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.command('list', 'list_at_subscription_scope', table_transformer=transform_deployments_list) - g.command('show', 'get_at_subscription_scope', exception_handler=empty_on_404) + g.show_command('show', 'get_at_subscription_scope') g.command('delete', 'delete_at_subscription_scope', supports_no_wait=True) g.custom_command('validate', 'validate_arm_template_at_subscription_scope', table_transformer=deployment_validate_table_format, exception_handler=handle_template_based_exception) g.custom_command('create', 'deploy_arm_template_at_subscription_scope', supports_no_wait=True, validator=process_deployment_create_namespace, exception_handler=handle_template_based_exception) g.custom_command('export', 'export_subscription_deployment_template') - g.generic_wait_command('wait', getter_name='get_at_subscription_scope') + g.wait_command('wait', getter_name='get_at_subscription_scope') with self.command_group('deployment operation', resource_deployment_operation_sdk, min_api='2018-05-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.command('list', 'list_at_subscription_scope') - g.custom_command('show', 'get_deployment_operations_at_subscription_scope', client_factory=cf_deployment_operations, exception_handler=empty_on_404) + g.custom_show_command('show', 'get_deployment_operations_at_subscription_scope', client_factory=cf_deployment_operations) with self.command_group('policy assignment', resource_type=ResourceType.MGMT_RESOURCE_POLICY) as g: g.custom_command('create', 'create_policy_assignment') g.custom_command('delete', 'delete_policy_assignment') g.custom_command('list', 'list_policy_assignment') - g.custom_command('show', 'show_policy_assignment', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_policy_assignment') with self.command_group('policy definition', resource_policy_definitions_sdk, resource_type=ResourceType.MGMT_RESOURCE_POLICY) as g: g.custom_command('create', 'create_policy_definition') g.command('delete', 'delete') g.command('list', 'list') - g.custom_command('show', 'get_policy_definition', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_policy_definition') g.generic_update_command('update', custom_func_name='update_policy_definition', custom_func_type=resource_custom) with self.command_group('policy set-definition', resource_policy_set_definitions_sdk, resource_type=ResourceType.MGMT_RESOURCE_POLICY, min_api='2017-06-01-preview') as g: g.custom_command('create', 'create_policy_setdefinition') g.command('delete', 'delete') g.command('list', 'list') - g.custom_command('show', 'get_policy_setdefinition', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_policy_setdefinition') g.custom_command('update', 'update_policy_setdefinition') with self.command_group('lock', resource_type=ResourceType.MGMT_RESOURCE_LOCKS) as g: g.custom_command('create', 'create_lock') g.custom_command('delete', 'delete_lock') g.custom_command('list', 'list_locks') - g.custom_command('show', 'get_lock', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_lock') g.custom_command('update', 'update_lock') with self.command_group('resource link', resource_link_sdk, resource_type=ResourceType.MGMT_RESOURCE_LINKS) as g: g.custom_command('create', 'create_resource_link') g.command('delete', 'delete') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_resource_links') g.custom_command('update', 'update_resource_link') with self.command_group('managedapp', resource_managedapp_sdk, min_api='2017-05-10', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.custom_command('create', 'create_application') g.command('delete', 'delete') - g.custom_command('show', 'show_application', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_application') g.custom_command('list', 'list_applications') with self.command_group('managedapp definition', resource_managedapp_def_sdk, min_api='2017-05-10', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.custom_command('create', 'create_applicationdefinition') g.command('delete', 'delete') - g.custom_command('show', 'show_applicationdefinition') + g.custom_show_command('show', 'show_applicationdefinition') g.command('list', 'list_by_resource_group', exception_handler=empty_on_404) with self.command_group('account management-group', resource_managementgroups_sdk, client_factory=cf_management_groups) as g: g.custom_command('list', 'cli_managementgroups_group_list') - g.custom_command('show', 'cli_managementgroups_group_show') + g.custom_show_command('show', 'cli_managementgroups_group_show') g.custom_command('create', 'cli_managementgroups_group_create') g.custom_command('delete', 'cli_managementgroups_group_delete') g.generic_update_command( diff --git a/src/command_modules/azure-cli-resource/setup.py b/src/command_modules/azure-cli-resource/setup.py index bde3a05ecc2..23fafee84ef 100644 --- a/src/command_modules/azure-cli-resource/setup.py +++ b/src/command_modules/azure-cli-resource/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.33" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', diff --git a/src/command_modules/azure-cli-role/HISTORY.rst b/src/command_modules/azure-cli-role/HISTORY.rst index 29954c92fe2..9ed0d12f1d5 100644 --- a/src/command_modules/azure-cli-role/HISTORY.rst +++ b/src/command_modules/azure-cli-role/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -2.0.28 -++++++ -* Minor fixes +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 2.0.27 ++++++ diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py index 350b8ff4fe5..1e33f6eead0 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py @@ -88,7 +88,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_application') g.custom_command('delete', 'delete_application') g.custom_command('list', 'list_apps') - g.custom_command('show', 'show_application') + g.custom_show_command('show', 'show_application') g.generic_update_command('update', setter_name='patch_application', setter_type=role_custom, getter_name='show_application', getter_type=role_custom, custom_func_name='update_application', custom_func_type=role_custom) @@ -97,7 +97,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_service_principal') g.custom_command('delete', 'delete_service_principal') g.custom_command('list', 'list_sps', client_factory=get_graph_client_service_principals) - g.custom_command('show', 'show_service_principal', client_factory=get_graph_client_service_principals) + g.custom_show_command('show', 'show_service_principal', client_factory=get_graph_client_service_principals) # RBAC related with self.command_group('ad sp', exception_handler=graph_err_handler) as g: @@ -108,14 +108,14 @@ def load_command_table(self, _): with self.command_group('ad user', role_users_sdk, exception_handler=graph_err_handler) as g: g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('list', 'list_users', client_factory=get_graph_client_users) g.custom_command('create', 'create_user', client_factory=get_graph_client_users, doc_string_source='azure.graphrbac.models#UserCreateParameters') with self.command_group('ad group', role_group_sdk, exception_handler=graph_err_handler) as g: g.custom_command('create', 'create_group', client_factory=get_graph_client_groups) g.command('delete', 'delete') - g.command('show', 'get') + g.show_command('show', 'get') g.command('get-member-groups', 'get_member_groups') g.custom_command('list', 'list_groups', client_factory=get_graph_client_groups) diff --git a/src/command_modules/azure-cli-role/setup.py b/src/command_modules/azure-cli-role/setup.py index ecf3887e458..cb3d92c4fce 100644 --- a/src/command_modules/azure-cli-role/setup.py +++ b/src/command_modules/azure-cli-role/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.28" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-servicebus/HISTORY.rst b/src/command_modules/azure-cli-servicebus/HISTORY.rst index 33ea437367b..0563380fd81 100644 --- a/src/command_modules/azure-cli-servicebus/HISTORY.rst +++ b/src/command_modules/azure-cli-servicebus/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -0.1.4 +0.2.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.1.3 ++++++ diff --git a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/commands.py b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/commands.py index 14a968a4ed1..2cd78282c93 100644 --- a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/commands.py +++ b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/commands.py @@ -50,7 +50,7 @@ def load_command_table(self, _): servicebus_custom = CliCommandType(operations_tmpl=custom_tmpl) with self.command_group('servicebus namespace', sb_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: g.custom_command('create', 'cli_namespace_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'cli_namespace_list', exception_handler=empty_on_404) g.command('delete', 'delete') g.command('exists', 'check_name_availability_method') @@ -58,7 +58,7 @@ def load_command_table(self, _): with self.command_group('servicebus namespace authorization-rule', sb_namespace_util, client_factory=namespaces_mgmt_client_factory) as g: g.command('create', 'create_or_update_authorization_rule',) - g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.show_command('show', 'get_authorization_rule') g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) g.command('keys list', 'list_keys') g.command('keys renew', 'regenerate_keys') @@ -68,14 +68,14 @@ def load_command_table(self, _): # Queue Region with self.command_group('servicebus queue', sb_queue_util, client_factory=queues_mgmt_client_factory) as g: g.custom_command('create', 'cli_sbqueue_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_namespace', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='cli_sbqueue_update') with self.command_group('servicebus queue authorization-rule', sb_queue_util, client_factory=queues_mgmt_client_factory) as g: g.command('create', 'create_or_update_authorization_rule',) - g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.show_command('show', 'get_authorization_rule') g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) g.command('keys list', 'list_keys') g.command('keys renew', 'regenerate_keys') @@ -85,14 +85,14 @@ def load_command_table(self, _): # Topic Region with self.command_group('servicebus topic', sb_topic_util, client_factory=topics_mgmt_client_factory) as g: g.custom_command('create', 'cli_sbtopic_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_namespace', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='cli_sbtopic_update') with self.command_group('servicebus topic authorization-rule', sb_topic_util, client_factory=topics_mgmt_client_factory) as g: g.command('create', 'create_or_update_authorization_rule') - g.command('show', 'get_authorization_rule', exception_handler=empty_on_404) + g.show_command('show', 'get_authorization_rule') g.command('list', 'list_authorization_rules', exception_handler=empty_on_404) g.command('keys list', 'list_keys') g.command('keys renew', 'regenerate_keys') @@ -102,7 +102,7 @@ def load_command_table(self, _): # Subscription Region with self.command_group('servicebus topic subscription', sb_subscriptions_util, client_factory=subscriptions_mgmt_client_factory) as g: g.custom_command('create', 'cli_sbsubscription_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_topic', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='cli_sbsubscription_update') @@ -110,7 +110,7 @@ def load_command_table(self, _): # Rules Region with self.command_group('servicebus topic subscription rule', sb_rule_util, client_factory=rules_mgmt_client_factory) as g: g.custom_command('create', 'cli_rules_create') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list_by_subscriptions', exception_handler=empty_on_404) g.command('delete', 'delete') g.generic_update_command('update', custom_func_name='cli_rules_update') @@ -118,7 +118,7 @@ def load_command_table(self, _): # DisasterRecoveryConfigs Region with self.command_group('servicebus georecovery-alias', sb_geodr_util, client_factory=disaster_recovery_mgmt_client_factory) as g: g.command('set', 'create_or_update') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list', 'list', exception_handler=empty_on_404) g.command('break-pair', 'break_pairing') g.command('fail-over', 'fail_over') @@ -128,5 +128,5 @@ def load_command_table(self, _): # DisasterRecoveryConfigs Authorization Region with self.command_group('servicebus georecovery-alias authorization-rule', sb_geodr_util, client_factory=disaster_recovery_mgmt_client_factory) as g: g.command('list', 'list_authorization_rules') - g.command('show', 'get_authorization_rule') + g.show_command('show', 'get_authorization_rule') g.command('keys list', 'list_keys') diff --git a/src/command_modules/azure-cli-servicebus/setup.py b/src/command_modules/azure-cli-servicebus/setup.py index 6c7a31f2d87..8dec55a974d 100644 --- a/src/command_modules/azure-cli-servicebus/setup.py +++ b/src/command_modules/azure-cli-servicebus/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.4" +VERSION = "0.2.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-servicefabric/HISTORY.rst b/src/command_modules/azure-cli-servicefabric/HISTORY.rst index b8f27617bc2..ace29f4c470 100644 --- a/src/command_modules/azure-cli-servicefabric/HISTORY.rst +++ b/src/command_modules/azure-cli-servicefabric/HISTORY.rst @@ -2,13 +2,10 @@ Release History =============== -0.0.13 -++++++ -* Minor fixes. 0.1.0 +++++ -* Minor fixes +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 0.0.13 ++++++ diff --git a/src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/commands.py b/src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/commands.py index d4f99ed9f88..de5dc52513a 100644 --- a/src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/commands.py +++ b/src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/commands.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.core.util import empty_on_404 from ._client_factory import servicefabric_fabric_client_factory @@ -16,7 +15,7 @@ def load_command_table(self, _): ) with self.command_group('sf cluster', cluster_mgmt_util, client_factory=servicefabric_fabric_client_factory) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.custom_command('list', 'list_cluster') g.custom_command('create', 'new_cluster') g.custom_command('certificate add', 'add_cluster_cert') diff --git a/src/command_modules/azure-cli-sql/HISTORY.rst b/src/command_modules/azure-cli-sql/HISTORY.rst index dea837fa5c9..60ef4f92d99 100644 --- a/src/command_modules/azure-cli-sql/HISTORY.rst +++ b/src/command_modules/azure-cli-sql/HISTORY.rst @@ -3,8 +3,9 @@ Release History =============== -2.0.29 -++++++ +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * Fixed 'The provided resource group name ... did not match the name in the Url' error when specifying elastic pool name for `sql db copy` and `sql db replica create` commands. * Allow configuring default sql server by executing `az configure --defaults sql-server=`. * Implemented table formatters for 'sql server', 'sql server firewall-rule', 'sql list-usages', and 'sql show-usage' commands. Use '-o table' to format output as a table. diff --git a/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/commands.py b/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/commands.py index ca14ebbdfd2..df083829f77 100644 --- a/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/commands.py +++ b/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/commands.py @@ -106,9 +106,9 @@ def load_command_table(self, _): g.custom_command('rename', 'db_rename', transform=database_lro_transform, table_transformer=db_table_format) - g.command('show', 'get', - transform=db_transform, - table_transformer=db_table_format) + g.show_command('show', 'get', + transform=db_transform, + table_transformer=db_table_format) g.custom_command('list', 'db_list', transform=db_list_transform, table_transformer=db_table_format) @@ -152,8 +152,8 @@ def load_command_table(self, _): g.custom_command('create', 'dw_create', supports_no_wait=True, transform=database_lro_transform) - g.command('show', 'get', - transform=db_transform) + g.show_command('show', 'get', + transform=db_transform) g.custom_command('list', 'dw_list', transform=db_list_transform) g.command('delete', 'delete', @@ -182,7 +182,7 @@ def load_command_table(self, _): with self.command_group('sql db tde', transparent_data_encryptions_operations) as g: g.command('set', 'create_or_update') - g.command('show', 'get') + g.show_command('show', 'get') transparent_data_encryption_activities_operations = CliCommandType( operations_tmpl='azure.mgmt.sql.operations.transparent_data_encryption_activities_operations#TransparentDataEncryptionActivitiesOperations.{}', @@ -221,7 +221,7 @@ def load_command_table(self, _): database_blob_auditing_policies_operations, client_factory=get_sql_database_blob_auditing_policies_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.generic_update_command('update', custom_func_name='db_audit_policy_update') @@ -233,7 +233,7 @@ def load_command_table(self, _): database_threat_detection_policies_operations, client_factory=get_sql_database_threat_detection_policies_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.generic_update_command('update', custom_func_name='db_threat_detection_policy_update') @@ -266,9 +266,9 @@ def load_command_table(self, _): table_transformer=elastic_pool_table_format) g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', - transform=elastic_pool_transform, - table_transformer=elastic_pool_table_format) + g.show_command('show', 'get', + transform=elastic_pool_transform, + table_transformer=elastic_pool_table_format) g.command('list', 'list_by_server', transform=elastic_pool_list_transform, table_transformer=elastic_pool_table_format) @@ -318,8 +318,8 @@ def load_command_table(self, _): table_transformer=server_table_format) g.command('delete', 'delete', confirmation=True) - g.command('show', 'get', - table_transformer=server_table_format) + g.show_command('show', 'get', + table_transformer=server_table_format) g.custom_command('list', 'server_list', table_transformer=server_table_format) g.generic_update_command('update', @@ -330,7 +330,6 @@ def load_command_table(self, _): client_factory=get_sql_server_usages_operations) with self.command_group('sql server', server_usages_operations) as g: - g.command('list-usages', 'list_by_server') firewall_rules_operations = CliCommandType( @@ -346,8 +345,8 @@ def load_command_table(self, _): g.custom_command('update', 'firewall_rule_update', table_transformer=firewall_rule_table_format) g.command('delete', 'delete') - g.command('show', 'get', - table_transformer=firewall_rule_table_format) + g.show_command('show', 'get', + table_transformer=firewall_rule_table_format) g.command('list', 'list_by_server', table_transformer=firewall_rule_table_format) @@ -375,7 +374,7 @@ def load_command_table(self, _): g.custom_command('create', 'server_key_create') g.custom_command('delete', 'server_key_delete') - g.custom_command('show', 'server_key_get') + g.custom_show_command('show', 'server_key_get') g.command('list', 'list_by_server') encryption_protectors_operations = CliCommandType( @@ -386,7 +385,7 @@ def load_command_table(self, _): encryption_protectors_operations, client_factory=get_sql_encryption_protectors_operations) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('set', 'encryption_protector_update') virtual_network_rules_operations = CliCommandType( @@ -399,7 +398,7 @@ def load_command_table(self, _): g.command('create', 'create_or_update', validator=validate_subnet) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_server') g.command('delete', 'delete') g.generic_update_command('update') @@ -412,7 +411,7 @@ def load_command_table(self, _): server_connection_policies_operations, client_factory=get_sql_server_connection_policies_operations) as c: - c.command('show', 'get') + c.show_command('show', 'get') c.generic_update_command('update') server_dns_aliases_operations = CliCommandType( @@ -423,7 +422,7 @@ def load_command_table(self, _): server_dns_aliases_operations, client_factory=get_sql_server_dns_aliases_operations) as c: - c.command('show', 'get') + c.show_command('show', 'get') c.command('list', 'list_by_server') c.command('create', 'create_or_update') c.command('delete', 'delete') @@ -443,7 +442,7 @@ def load_command_table(self, _): g.custom_command('create', 'managed_instance_create', supports_no_wait=True) g.command('delete', 'delete', confirmation=True, supports_no_wait=True) - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('list', 'managed_instance_list') g.generic_update_command('update', custom_func_name='managed_instance_update', supports_no_wait=True) @@ -461,6 +460,6 @@ def load_command_table(self, _): g.custom_command('create', 'managed_db_create', supports_no_wait=True) g.custom_command('restore', 'managed_db_restore', supports_no_wait=True) - g.command('show', 'get') + g.show_command('show', 'get') g.command('list', 'list_by_instance') g.command('delete', 'delete', confirmation=True, supports_no_wait=True) diff --git a/src/command_modules/azure-cli-sql/setup.py b/src/command_modules/azure-cli-sql/setup.py index deb22fa01e4..3b735e37b1a 100644 --- a/src/command_modules/azure-cli-sql/setup.py +++ b/src/command_modules/azure-cli-sql/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.29" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 4 - Beta', diff --git a/src/command_modules/azure-cli-storage/HISTORY.rst b/src/command_modules/azure-cli-storage/HISTORY.rst index 16ece287ae8..8225d9bc9f7 100644 --- a/src/command_modules/azure-cli-storage/HISTORY.rst +++ b/src/command_modules/azure-cli-storage/HISTORY.rst @@ -3,9 +3,9 @@ Release History =============== -2.0.37 -++++++ -* Minor fixes +2.1.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 2.0.36 ++++++ diff --git a/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/commands.py b/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/commands.py index 3e6b28c47c7..27d9f1dfe71 100644 --- a/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/commands.py +++ b/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/commands.py @@ -44,7 +44,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT g.command('check-name', 'check_name_availability') g.custom_command('create', 'create_storage_account', min_api='2016-01-01') g.command('delete', 'delete', confirmation=True) - g.generic_show_command('show', 'get_properties') + g.show_command('show', 'get_properties') g.custom_command('list', 'list_storage_accounts') g.custom_command('show-usage', 'show_storage_account_usage') g.custom_command('show-connection-string', 'show_storage_account_connection_string') diff --git a/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/operations/table.py b/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/operations/table.py index fa4f5878f68..d4420cd7ee4 100644 --- a/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/operations/table.py +++ b/src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/operations/table.py @@ -11,6 +11,5 @@ def insert_table_entity(client, table_name, entity, if_exists='fail', timeout=No return client.insert_or_merge_entity(table_name, entity, timeout) elif if_exists == 'replace': return client.insert_or_replace_entity(table_name, entity, timeout) - else: - from knack.util import CLIError - raise CLIError("Unrecognized value '{}' for --if-exists".format(if_exists)) + from knack.util import CLIError + raise CLIError("Unrecognized value '{}' for --if-exists".format(if_exists)) diff --git a/src/command_modules/azure-cli-storage/setup.py b/src/command_modules/azure-cli-storage/setup.py index 05aa3bcc308..7e9ff1e2c8c 100644 --- a/src/command_modules/azure-cli-storage/setup.py +++ b/src/command_modules/azure-cli-storage/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.37" +VERSION = "2.1.0" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-vm/HISTORY.rst b/src/command_modules/azure-cli-vm/HISTORY.rst index 8edcabdc05e..94d043d443b 100644 --- a/src/command_modules/azure-cli-vm/HISTORY.rst +++ b/src/command_modules/azure-cli-vm/HISTORY.rst @@ -6,6 +6,7 @@ Release History 2.1.0 ++++++ * BREAKING CHANGE: update `vmss create` to use `Standard_DS1_v2` as the default instance size +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. * `vm/vmss extension set/delete`: Added `--no-wait` support. * Added `vm extension wait`. diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/commands.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/commands.py index 7aa69e8c8a3..ce231ae291b 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/commands.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/commands.py @@ -23,7 +23,6 @@ from azure.cli.core.commands import DeploymentOutputLongRunningOperation, CliCommandType from azure.cli.core.commands.arm import deployment_validate_table_format, handle_template_based_exception -from azure.cli.core.util import empty_on_404 # pylint: disable=line-too-long, too-many-statements @@ -131,14 +130,14 @@ def load_command_table(self, _): g.custom_command('grant-access', 'grant_disk_access') g.custom_command('list', 'list_managed_disks', table_transformer='[].' + transform_disk_show_table_output) g.command('revoke-access', 'revoke_access') - g.command('show', 'get', exception_handler=empty_on_404, table_transformer=transform_disk_show_table_output) + g.show_command('show', 'get', table_transformer=transform_disk_show_table_output) g.generic_update_command('update', custom_func_name='update_managed_disk', setter_arg_name='disk', supports_no_wait=True) - g.generic_wait_command('wait') + g.wait_command('wait') # TODO move to its own command module https://github.com/Azure/azure-cli/issues/5105 with self.command_group('identity', compute_identity_sdk, min_api='2017-12-01') as g: g.command('create', 'create_or_update', validator=process_msi_namespace) - g.command('show', 'get') + g.show_command('show', 'get') g.command('delete', 'delete') g.custom_command('list', 'list_user_assigned_identities') g.command('list-operations', 'list', operations_tmpl='azure.mgmt.msi.operations.operations#Operations.{}', client_factory=cf_msi_operations_operations) @@ -146,7 +145,7 @@ def load_command_table(self, _): with self.command_group('image', compute_image_sdk, min_api='2016-04-30-preview') as g: g.custom_command('create', 'create_image', validator=process_image_create_namespace) g.custom_command('list', 'list_images') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('delete', 'delete') with self.command_group('snapshot', compute_snapshot_sdk, operation_group='snapshots', min_api='2016-04-30-preview') as g: @@ -155,7 +154,7 @@ def load_command_table(self, _): g.custom_command('grant-access', 'grant_snapshot_access') g.custom_command('list', 'list_snapshots') g.command('revoke-access', 'revoke_access') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.generic_update_command('update', custom_func_name='update_snapshot', setter_arg_name='snapshot') with self.command_group('vm', compute_vm_sdk) as g: @@ -181,11 +180,11 @@ def load_command_table(self, _): g.command('redeploy', 'redeploy', supports_no_wait=True) g.custom_command('resize', 'resize_vm', supports_no_wait=True) g.command('restart', 'restart', supports_no_wait=True) - g.custom_command('show', 'show_vm', table_transformer=transform_vm, exception_handler=empty_on_404) + g.custom_show_command('show', 'show_vm', table_transformer=transform_vm) g.command('start', 'start', supports_no_wait=True) g.command('stop', 'power_off', supports_no_wait=True) g.generic_update_command('update', setter_name='update_vm', setter_type=compute_custom, supports_no_wait=True) - g.generic_wait_command('wait', getter_name='get_instance_view', getter_type=compute_custom) + g.wait_command('wait', getter_name='get_instance_view', getter_type=compute_custom) with self.command_group('vm availability-set', compute_availset_sdk) as g: g.custom_command('convert', 'convert_av_set_to_managed_disk', min_api='2016-04-30-preview') @@ -193,7 +192,7 @@ def load_command_table(self, _): g.command('delete', 'delete') g.command('list', 'list') g.command('list-sizes', 'list_available_sizes') - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.generic_update_command('update') with self.command_group('vm boot-diagnostics', compute_vm_sdk) as g: @@ -212,17 +211,17 @@ def load_command_table(self, _): with self.command_group('vm encryption', custom_command_type=compute_disk_encryption_custom) as g: g.custom_command('enable', 'encrypt_vm', validator=process_disk_encryption_namespace) g.custom_command('disable', 'decrypt_vm') - g.custom_command('show', 'show_vm_encryption_status', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_vm_encryption_status') with self.command_group('vm extension', compute_vm_extension_sdk) as g: g.command('delete', 'delete', supports_no_wait=True) - g.command('show', 'get', exception_handler=empty_on_404, table_transformer=transform_extension_show_table_output) + g.show_command('show', 'get', table_transformer=transform_extension_show_table_output) g.custom_command('set', 'set_extension', supports_no_wait=True) g.custom_command('list', 'list_extensions', table_transformer='[].' + transform_extension_show_table_output) - g.generic_wait_command('wait') + g.wait_command('wait') with self.command_group('vm extension image', compute_vm_extension_image_sdk) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list-names', 'list_types') g.command('list-versions', 'list_versions') g.custom_command('list', 'list_vm_extension_images') @@ -233,19 +232,19 @@ def load_command_table(self, _): g.command('list-skus', 'list_skus') g.custom_command('list', 'list_vm_images') g.custom_command('accept-terms', 'accept_market_ordering_terms') - g.custom_command('show', 'show_vm_image', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_vm_image') with self.command_group('vm nic', compute_vm_sdk) as g: g.custom_command('add', 'add_vm_nic') g.custom_command('remove', 'remove_vm_nic') g.custom_command('set', 'set_vm_nic') - g.custom_command('show', 'show_vm_nic', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_vm_nic') g.custom_command('list', 'list_vm_nics') with self.command_group('vm run-command', compute_vm_run_sdk, operation_group='virtual_machine_run_commands') as g: g.custom_command('invoke', 'run_command_invoke') g.command('list', 'list') - g.command('show', 'get') + g.show_command('show', 'get') with self.command_group('vm secret', compute_vm_sdk) as g: g.custom_command('format', 'get_vm_format_secret', validator=process_vm_secret_format) @@ -281,12 +280,12 @@ def load_command_table(self, _): g.command('perform-maintenance', 'perform_maintenance', min_api='2017-12-01') g.custom_command('restart', 'restart_vmss', supports_no_wait=True) g.custom_command('scale', 'scale_vmss', supports_no_wait=True) - g.custom_command('show', 'show_vmss', exception_handler=empty_on_404, table_transformer=get_vmss_table_output_transformer(self, False)) + g.custom_show_command('show', 'show_vmss', table_transformer=get_vmss_table_output_transformer(self, False)) g.custom_command('start', 'start_vmss', supports_no_wait=True) g.custom_command('stop', 'stop_vmss', supports_no_wait=True) g.generic_update_command('update', getter_name='get_vmss', setter_name='update_vmss', supports_no_wait=True, command_type=compute_custom) g.custom_command('update-instances', 'update_vmss_instances', supports_no_wait=True) - g.generic_wait_command('wait', getter_name='get_vmss', getter_type=compute_custom) + g.wait_command('wait', getter_name='get_vmss', getter_type=compute_custom) with self.command_group('vmss diagnostics', compute_vmss_sdk) as g: g.custom_command('set', 'set_vmss_diagnostics_extension') @@ -299,16 +298,16 @@ def load_command_table(self, _): with self.command_group('vmss encryption', custom_command_type=compute_disk_encryption_custom, min_api='2017-03-30') as g: g.custom_command('enable', 'encrypt_vmss', validator=process_disk_encryption_namespace) g.custom_command('disable', 'decrypt_vmss') - g.custom_command('show', 'show_vmss_encryption_status', exception_handler=empty_on_404) + g.custom_show_command('show', 'show_vmss_encryption_status') with self.command_group('vmss extension', compute_vmss_sdk) as g: g.custom_command('delete', 'delete_vmss_extension', supports_no_wait=True) - g.custom_command('show', 'get_vmss_extension', exception_handler=empty_on_404) + g.custom_show_command('show', 'get_vmss_extension') g.custom_command('set', 'set_vmss_extension', supports_no_wait=True) g.custom_command('list', 'list_vmss_extensions') with self.command_group('vmss extension image', compute_vm_extension_image_sdk) as g: - g.command('show', 'get', exception_handler=empty_on_404) + g.show_command('show', 'get') g.command('list-names', 'list_types') g.command('list-versions', 'list_versions') g.custom_command('list', 'list_vm_extension_images') @@ -316,7 +315,7 @@ def load_command_table(self, _): with self.command_group('vmss nic', network_nic_sdk) as g: g.command('list', 'list_virtual_machine_scale_set_network_interfaces') g.command('list-vm-nics', 'list_virtual_machine_scale_set_vm_network_interfaces') - g.command('show', 'get_virtual_machine_scale_set_network_interface', exception_handler=empty_on_404) + g.show_command('show', 'get_virtual_machine_scale_set_network_interface') with self.command_group('vmss rolling-upgrade', compute_vmss_rolling_upgrade_sdk, min_api='2017-03-30') as g: g.command('cancel', 'cancel') diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index 69bbfb392bc..e889b712091 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -997,8 +997,7 @@ def test_vm_create_none_options(self, resource_group): self.check('length(tags)', 0), self.check('location', '{loc}') ]) - self.cmd('network public-ip show -n {vm}PublicIP -g {rg}', - checks=self.is_empty()) + self.cmd('network public-ip show -n {vm}PublicIP -g {rg}', expect_failure=True) class VMBootDiagnostics(ScenarioTest): @@ -1513,8 +1512,7 @@ def test_vmss_create_none_options(self, resource_group): ]) self.cmd('vmss update -g {rg} -n {vmss} --set tags.test=success', checks=self.check('tags.test', 'success')) - self.cmd('network public-ip show -n {vmss}PublicIP -g {rg}', - checks=self.is_empty()) + self.cmd('network public-ip show -n {vmss}PublicIP -g {rg}', expect_failure=True) @ResourceGroupPreparer(name_prefix='cli_test_vmss_create_w_ag') def test_vmss_create_with_app_gateway(self, resource_group):