From 13367f41b653c6932a9002d13cfaa74acb0bab2f Mon Sep 17 00:00:00 2001 From: hardik Date: Fri, 17 Jun 2016 14:20:26 +0530 Subject: [PATCH] Changed argument names as per other python clients Depends-On: I8ce55c0eb1cab7581ba719fbbb6be7b7dced27e0 Change-Id: I557cce021c3ee030aa5b06ea6a0eacc08d594beb --- mistralclient/commands/v2/action_executions.py | 10 ++++++---- mistralclient/commands/v2/cron_triggers.py | 13 +++++++++---- mistralclient/commands/v2/environments.py | 12 ++++++++---- mistralclient/commands/v2/executions.py | 8 ++++---- mistralclient/commands/v2/members.py | 8 ++++---- mistralclient/commands/v2/tasks.py | 4 ++-- mistralclient/commands/v2/workbooks.py | 8 ++++---- mistralclient/commands/v2/workflows.py | 8 ++++---- 8 files changed, 41 insertions(+), 30 deletions(-) diff --git a/mistralclient/commands/v2/action_executions.py b/mistralclient/commands/v2/action_executions.py index 5819f699..6c0e6d37 100644 --- a/mistralclient/commands/v2/action_executions.py +++ b/mistralclient/commands/v2/action_executions.py @@ -162,13 +162,15 @@ class Get(command.ShowOne): parser = super(Get, self).get_parser(prog_name) parser.add_argument( - 'id', + 'action_execution', help='Action execution ID.') return parser def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - execution = mistral_client.action_executions.get(parsed_args.id) + execution = mistral_client.action_executions.get( + parsed_args.action_execution + ) return format(execution) @@ -268,7 +270,7 @@ class Delete(command.Command): parser = super(Delete, self).get_parser(prog_name) parser.add_argument( - 'id', + 'action_execution', nargs='+', help='Id of action execution identifier(s).' ) @@ -280,7 +282,7 @@ class Delete(command.Command): utils.do_action_on_many( lambda s: mistral_client.action_executions.delete(s), - parsed_args.id, + parsed_args.action_execution, "Request to delete action execution %s has been accepted.", "Unable to delete the specified action execution(s)." ) diff --git a/mistralclient/commands/v2/cron_triggers.py b/mistralclient/commands/v2/cron_triggers.py index cb8ca29c..766ada18 100644 --- a/mistralclient/commands/v2/cron_triggers.py +++ b/mistralclient/commands/v2/cron_triggers.py @@ -87,14 +87,16 @@ class Get(command.ShowOne): def get_parser(self, prog_name): parser = super(Get, self).get_parser(prog_name) - parser.add_argument('name', help='Cron trigger name') + parser.add_argument('cron_trigger', help='Cron trigger name') return parser def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - return format(mistral_client.cron_triggers.get(parsed_args.name)) + return format(mistral_client.cron_triggers.get( + parsed_args.cron_trigger + )) class Create(command.ShowOne): @@ -173,7 +175,10 @@ class Delete(command.Command): def get_parser(self, prog_name): parser = super(Delete, self).get_parser(prog_name) - parser.add_argument('name', nargs='+', help='Name of cron trigger(s).') + parser.add_argument( + 'cron_trigger', + nargs='+', help='Name of cron trigger(s).' + ) return parser @@ -182,7 +187,7 @@ class Delete(command.Command): utils.do_action_on_many( lambda s: mistral_client.cron_triggers.delete(s), - parsed_args.name, + parsed_args.cron_trigger, "Request to delete cron trigger %s has been accepted.", "Unable to delete the specified cron trigger(s)." ) diff --git a/mistralclient/commands/v2/environments.py b/mistralclient/commands/v2/environments.py index 48e5fcf2..e616f6f0 100644 --- a/mistralclient/commands/v2/environments.py +++ b/mistralclient/commands/v2/environments.py @@ -105,7 +105,7 @@ class Get(command.ShowOne): parser = super(Get, self).get_parser(prog_name) parser.add_argument( - 'name', + 'environment', help='Environment name' ) @@ -113,7 +113,7 @@ class Get(command.ShowOne): def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - environment = mistral_client.environments.get(parsed_args.name) + environment = mistral_client.environments.get(parsed_args.environment) return format(environment) @@ -147,7 +147,11 @@ class Delete(command.Command): def get_parser(self, prog_name): parser = super(Delete, self).get_parser(prog_name) - parser.add_argument('name', nargs='+', help='Name of environment(s).') + parser.add_argument( + 'environment', + nargs='+', + help='Name of environment(s).' + ) return parser @@ -156,7 +160,7 @@ class Delete(command.Command): utils.do_action_on_many( lambda s: mistral_client.environments.delete(s), - parsed_args.name, + parsed_args.environment, "Request to delete environment %s has been accepted.", "Unable to delete the specified environment(s)." ) diff --git a/mistralclient/commands/v2/executions.py b/mistralclient/commands/v2/executions.py index be0d61cc..334c9528 100644 --- a/mistralclient/commands/v2/executions.py +++ b/mistralclient/commands/v2/executions.py @@ -124,13 +124,13 @@ class Get(command.ShowOne): def get_parser(self, prog_name): parser = super(Get, self).get_parser(prog_name) - parser.add_argument('id', help='Execution identifier') + parser.add_argument('execution', help='Execution identifier') return parser def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - execution = mistral_client.executions.get(parsed_args.id) + execution = mistral_client.executions.get(parsed_args.execution) return format(execution) @@ -202,7 +202,7 @@ class Delete(command.Command): parser = super(Delete, self).get_parser(prog_name) parser.add_argument( - 'id', + 'execution', nargs='+', help='Id of execution identifier(s).' ) @@ -214,7 +214,7 @@ class Delete(command.Command): utils.do_action_on_many( lambda s: mistral_client.executions.delete(s), - parsed_args.id, + parsed_args.execution, "Request to delete execution %s has been accepted.", "Unable to delete the specified execution(s)." ) diff --git a/mistralclient/commands/v2/members.py b/mistralclient/commands/v2/members.py index bdafd027..24bc4d65 100644 --- a/mistralclient/commands/v2/members.py +++ b/mistralclient/commands/v2/members.py @@ -89,7 +89,7 @@ class Get(command.ShowOne): parser = super(Get, self).get_parser(prog_name) parser.add_argument( - 'resource_id', + 'resource', help='Resource ID to be shared.' ) parser.add_argument( @@ -109,7 +109,7 @@ class Get(command.ShowOne): def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine member = mistral_client.members.get( - parsed_args.resource_id, + parsed_args.resource, parsed_args.resource_type, parsed_args.member_id, ) @@ -156,7 +156,7 @@ class Delete(command.Command): parser = super(Delete, self).get_parser(prog_name) parser.add_argument( - 'resource_id', + 'resource', help='Resource ID to be shared.' ) parser.add_argument( @@ -175,7 +175,7 @@ class Delete(command.Command): try: mistral_client.members.delete( - parsed_args.resource_id, + parsed_args.resource, parsed_args.resource_type, parsed_args.member_id, ) diff --git a/mistralclient/commands/v2/tasks.py b/mistralclient/commands/v2/tasks.py index 96d10df8..955598f9 100644 --- a/mistralclient/commands/v2/tasks.py +++ b/mistralclient/commands/v2/tasks.py @@ -85,13 +85,13 @@ class Get(command.ShowOne): def get_parser(self, prog_name): parser = super(Get, self).get_parser(prog_name) - parser.add_argument('id', help='Task identifier') + parser.add_argument('task', help='Task identifier') return parser def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - execution = mistral_client.tasks.get(parsed_args.id) + execution = mistral_client.tasks.get(parsed_args.task) return format(execution) diff --git a/mistralclient/commands/v2/workbooks.py b/mistralclient/commands/v2/workbooks.py index 8c8b57cf..16d0bdcc 100644 --- a/mistralclient/commands/v2/workbooks.py +++ b/mistralclient/commands/v2/workbooks.py @@ -69,7 +69,7 @@ class Get(command.ShowOne): parser = super(Get, self).get_parser(prog_name) parser.add_argument( - 'name', + 'workbook', help='Workbook name' ) @@ -77,7 +77,7 @@ class Get(command.ShowOne): def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - workbook = mistral_client.workbooks.get(parsed_args.name) + workbook = mistral_client.workbooks.get(parsed_args.workbook) return format(workbook) @@ -111,7 +111,7 @@ class Delete(command.Command): def get_parser(self, prog_name): parser = super(Delete, self).get_parser(prog_name) - parser.add_argument('name', nargs='+', help='Name of workbook(s).') + parser.add_argument('workbook', nargs='+', help='Name of workbook(s).') return parser @@ -119,7 +119,7 @@ class Delete(command.Command): mistral_client = self.app.client_manager.workflow_engine utils.do_action_on_many( lambda s: mistral_client.workbooks.delete(s), - parsed_args.name, + parsed_args.workbook, "Request to delete workbook %s has been accepted.", "Unable to delete the specified workbook(s)." ) diff --git a/mistralclient/commands/v2/workflows.py b/mistralclient/commands/v2/workflows.py index 1a5c3464..12f1437b 100644 --- a/mistralclient/commands/v2/workflows.py +++ b/mistralclient/commands/v2/workflows.py @@ -80,13 +80,13 @@ class Get(show.ShowOne): def get_parser(self, prog_name): parser = super(Get, self).get_parser(prog_name) - parser.add_argument('identifier', help='Workflow ID or name.') + parser.add_argument('workflow', help='Workflow ID or name.') return parser def take_action(self, parsed_args): mistral_client = self.app.client_manager.workflow_engine - wf = mistral_client.workflows.get(parsed_args.identifier) + wf = mistral_client.workflows.get(parsed_args.workflow) return format(wf) @@ -135,7 +135,7 @@ class Delete(command.Command): parser = super(Delete, self).get_parser(prog_name) parser.add_argument( - 'identifier', + 'workflow', nargs='+', help='Name or ID of workflow(s).' ) @@ -146,7 +146,7 @@ class Delete(command.Command): mistral_client = self.app.client_manager.workflow_engine utils.do_action_on_many( lambda s: mistral_client.workflows.delete(s), - parsed_args.identifier, + parsed_args.workflow, "Request to delete workflow %s has been accepted.", "Unable to delete the specified workflow(s)." )