From 40cb1bf6fd2af3b407d40081c750f287c0eb1318 Mon Sep 17 00:00:00 2001 From: Victoria Litvinova <73560279+vilit1@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:12:27 -0800 Subject: [PATCH] refactor: hide onvif create and custom create AEP commands. (#479) * Also deprecate long form options in favor of shorter options. --- azext_edge/edge/command_map.py | 8 ++++++-- azext_edge/edge/providers/rpsaas/adr/params.py | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/azext_edge/edge/command_map.py b/azext_edge/edge/command_map.py index ba0738ecc..b31545467 100644 --- a/azext_edge/edge/command_map.py +++ b/azext_edge/edge/command_map.py @@ -163,8 +163,12 @@ def load_iotops_commands(self, _): "iot ops asset endpoint create", command_type=aep_resource_ops, ) as cmd_group: - cmd_group.command("custom", "create_custom_asset_endpoint_profile") - cmd_group.command("onvif", "create_onvif_asset_endpoint_profile", is_preview=True) + cmd_group.command( + "custom", "create_custom_asset_endpoint_profile", deprecate_info=cmd_group.deprecate(hide=True) + ) + cmd_group.command( + "onvif", "create_onvif_asset_endpoint_profile", deprecate_info=cmd_group.deprecate(hide=True) + ) cmd_group.command("opcua", "create_opcua_asset_endpoint_profile") with self.command_group( diff --git a/azext_edge/edge/providers/rpsaas/adr/params.py b/azext_edge/edge/providers/rpsaas/adr/params.py index bb87b95e6..f28a5aee2 100644 --- a/azext_edge/edge/providers/rpsaas/adr/params.py +++ b/azext_edge/edge/providers/rpsaas/adr/params.py @@ -438,20 +438,25 @@ def load_adr_arguments(self, _): ) context.argument( "certificate_reference", - options_list=["--certificate-ref", "--cert-ref", "--cr"], + options_list=["--certificate-ref", "--cert-ref", context.deprecate(target="--cr", redirect="--cert-ref")], help="Reference for the certificate used in authentication. This method of user authentication is not " "supported yet.", arg_group="Authentication", ) context.argument( "password_reference", - options_list=["--password-ref", "--pr"], + options_list=["--password-ref", "--pass-ref", context.deprecate(target="--pr", redirect="--pass-ref")], help="Reference for the password used in authentication.", arg_group="Authentication", ) context.argument( "username_reference", - options_list=["--username-reference", "--ur"], + options_list=[ + context.deprecate(target="--username-reference", redirect="--user-ref"), + "--username-ref", + "--user-ref", + context.deprecate(target="--ur", redirect="--user-ref") + ], help="Reference for the username used in authentication.", arg_group="Authentication", )