diff --git a/distributedcloud-client/dcmanagerclient/api/v1/sw_deploy_manager.py b/distributedcloud-client/dcmanagerclient/api/v1/sw_deploy_manager.py index aec55aac..45168417 100644 --- a/distributedcloud-client/dcmanagerclient/api/v1/sw_deploy_manager.py +++ b/distributedcloud-client/dcmanagerclient/api/v1/sw_deploy_manager.py @@ -6,7 +6,7 @@ from dcmanagerclient.api.v1.sw_update_manager import SwUpdateManager -SW_UPDATE_TYPE_USM = "software" +SW_UPDATE_TYPE_USM = "sw-deploy" class SwDeployManager(SwUpdateManager): diff --git a/distributedcloud-client/dcmanagerclient/commands/v1/sw_deploy_manager.py b/distributedcloud-client/dcmanagerclient/commands/v1/sw_deploy_manager.py index 73d01a3b..d047ad4c 100644 --- a/distributedcloud-client/dcmanagerclient/commands/v1/sw_deploy_manager.py +++ b/distributedcloud-client/dcmanagerclient/commands/v1/sw_deploy_manager.py @@ -19,7 +19,7 @@ class SwDeployManagerMixin: columns, data = original_fmt_func(sw_update_strategy) release_id = "" if sw_update_strategy and sw_update_strategy.extra_args: - release_id = sw_update_strategy.extra_args.get("release_id") + release_id = sw_update_strategy.extra_args.get("release") # Find the index of 'stop on failure' in the tuple failure_status_index = columns.index("stop on failure") @@ -58,16 +58,15 @@ class CreateSwDeployStrategy( parser = super().get_parser(prog_name) parser.add_argument( - "--release-id", - required=True, - help="The release to be deployed.", + "release", + help="The release ID to be deployed.", ) return parser def process_custom_params(self, parsed_args, kwargs_dict): """Updates kwargs dictionary from parsed_args for patching""" - kwargs_dict["release_id"] = parsed_args.release_id + kwargs_dict["release"] = parsed_args.release # override validate_force_params defined in CreateSwUpdateStrategy def validate_force_params(self, parsed_args): diff --git a/distributedcloud-client/dcmanagerclient/shell.py b/distributedcloud-client/dcmanagerclient/shell.py index 0b2ffdca..d462e41b 100644 --- a/distributedcloud-client/dcmanagerclient/shell.py +++ b/distributedcloud-client/dcmanagerclient/shell.py @@ -580,11 +580,6 @@ class DCManagerShell(app.App): "prestage-strategy create": spr.CreateSwPrestageStrategy, "prestage-strategy delete": spr.DeleteSwPrestageStrategy, "prestage-strategy show": spr.ShowSwPrestageStrategy, - "software-deploy-strategy abort": swdm.AbortSwDeployStrategy, - "software-deploy-strategy apply": swdm.ApplySwDeployStrategy, - "software-deploy-strategy create": swdm.CreateSwDeployStrategy, - "software-deploy-strategy delete": swdm.DeleteSwDeployStrategy, - "software-deploy-strategy show": swdm.ShowSwDeployStrategy, "strategy-step list": swum.ListSwUpdateStrategyStep, "strategy-step show": swum.ShowSwUpdateStrategyStep, "strategy-config delete": suom.DeleteSwUpdateOptions, @@ -634,6 +629,11 @@ class DCManagerShell(app.App): "subcloud-peer-group show": pm.ShowSubcloudPeerGroup, "subcloud-peer-group status": pm.StatusSubcloudPeerGroup, "subcloud-peer-group update": pm.UpdateSubcloudPeerGroup, + "sw-deploy-strategy abort": swdm.AbortSwDeployStrategy, + "sw-deploy-strategy apply": swdm.ApplySwDeployStrategy, + "sw-deploy-strategy create": swdm.CreateSwDeployStrategy, + "sw-deploy-strategy delete": swdm.DeleteSwDeployStrategy, + "sw-deploy-strategy show": swdm.ShowSwDeployStrategy, "system-peer add": sp.AddSystemPeer, "system-peer delete": sp.DeleteSystemPeer, "system-peer list": sp.ListSystemPeer, diff --git a/distributedcloud-client/dcmanagerclient/tests/v1/test_sw_deploy_manager.py b/distributedcloud-client/dcmanagerclient/tests/v1/test_sw_deploy_manager.py index 8793cf1b..be921717 100644 --- a/distributedcloud-client/dcmanagerclient/tests/v1/test_sw_deploy_manager.py +++ b/distributedcloud-client/dcmanagerclient/tests/v1/test_sw_deploy_manager.py @@ -26,7 +26,7 @@ class TestSwDeployStrategy(UpdateStrategyMixin, base.BaseCommandTest): self.abort_command = cli_cmd.AbortSwDeployStrategy def test_create_strategy(self): - """Test deploy strategy should be created with --release-id""" + """Test deploy strategy should be created with release""" # prepare mixin attributes manager_to_test = self.sw_update_manager @@ -35,7 +35,7 @@ class TestSwDeployStrategy(UpdateStrategyMixin, base.BaseCommandTest): # mock the result of the API call strategy = utils.make_strategy( strategy_type=expected_strategy_type, - extra_args={"release_id": "stx-24.09.1"}, + extra_args={"release": "stx-24.09.1"}, ) # mock that there is no pre-existing strategy @@ -44,7 +44,7 @@ class TestSwDeployStrategy(UpdateStrategyMixin, base.BaseCommandTest): # invoke the backend method for the CLI. # Returns a tuple of field descriptions, and a second tuple of values fields, results = self.call( - self.create_command, ["--release-id", "stx-24.09.1"] + self.create_command, ["stx-24.09.1"] ) # results is a tuple of expected length @@ -64,7 +64,7 @@ class TestSwDeployStrategy(UpdateStrategyMixin, base.BaseCommandTest): self.assertEqual(results[failure_index + 1], "stx-24.09.1") def test_create_strategy_without_release_id(self): - """Test deploy strategy should not be created without --release-id""" + """Test deploy strategy should not be created without release""" # prepare mixin attributes manager_to_test = self.sw_update_manager