Changed argument names as per other python clients

Depends-On: I8ce55c0eb1cab7581ba719fbbb6be7b7dced27e0
Change-Id: I557cce021c3ee030aa5b06ea6a0eacc08d594beb
This commit is contained in:
hardik 2016-06-17 14:20:26 +05:30
parent 7f5eef036f
commit 13367f41b6
8 changed files with 41 additions and 30 deletions

View File

@ -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)."
)

View File

@ -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)."
)

View File

@ -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)."
)

View File

@ -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)."
)

View File

@ -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,
)

View File

@ -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)

View File

@ -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)."
)

View File

@ -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)."
)