diff --git a/reddwarfclient/management.py b/reddwarfclient/management.py index 0c824d0f..346999d8 100644 --- a/reddwarfclient/management.py +++ b/reddwarfclient/management.py @@ -124,3 +124,10 @@ class Management(base.ManagerWithFind): """ body = {'update': {}} self._action(instance_id, body) + + def reset_task_status(self, instance_id): + """ + Set the task status to NONE. + """ + body = {'reset-task-status': {}} + self._action(instance_id, body) diff --git a/reddwarfclient/mcli.py b/reddwarfclient/mcli.py index 37c28219..f89bfe7e 100644 --- a/reddwarfclient/mcli.py +++ b/reddwarfclient/mcli.py @@ -146,6 +146,11 @@ class InstanceCommands(common.AuthedCommandsBase): self._require('id') self._pretty_print(self.dbaas.management.migrate, self.id) + def reset_task_status(self): + """Set the instance's task status to NONE.""" + self._require('id') + self._pretty_print(self.dbaas.management.reset_task_status, self.id) + class StorageCommands(common.AuthedCommandsBase): """Commands to list devices info""" diff --git a/tests/test_management.py b/tests/test_management.py index c0b53360..ddbb38ca 100644 --- a/tests/test_management.py +++ b/tests/test_management.py @@ -129,3 +129,9 @@ class ManagementTest(TestCase): self.management.update(1) self.assertEqual(1, self.management._action.call_count) self.assertEqual({'update': {}}, self.body_) + + def test_reset_task_status(self): + self._mock_action() + self.management.reset_task_status(1) + self.assertEqual(1, self.management._action.call_count) + self.assertEqual({'reset-task-status': {}}, self.body_)