Add support to get execution's log
Change-Id: If5f62f5f86601cb8a0e11dec299d4ec1867143f9
This commit is contained in:
@@ -109,3 +109,17 @@ class Show(command.ShowOne):
|
|||||||
execution = client.function_executions.get(parsed_args.execution)
|
execution = client.function_executions.get(parsed_args.execution)
|
||||||
|
|
||||||
return self.columns, utils.get_item_properties(execution, self.columns)
|
return self.columns, utils.get_item_properties(execution, self.columns)
|
||||||
|
|
||||||
|
|
||||||
|
class LogShow(command.Command):
|
||||||
|
def get_parser(self, prog_name):
|
||||||
|
parser = super(LogShow, self).get_parser(prog_name)
|
||||||
|
parser.add_argument('execution', help='Execution ID.')
|
||||||
|
|
||||||
|
return parser
|
||||||
|
|
||||||
|
def take_action(self, parsed_args):
|
||||||
|
client = self.app.client_manager.function_engine
|
||||||
|
log = client.function_executions.get_log(parsed_args.execution)
|
||||||
|
|
||||||
|
self.app.stdout.write(log or "\n")
|
||||||
|
@@ -34,3 +34,6 @@ class ExecutionManager(base.Manager):
|
|||||||
|
|
||||||
def get(self, id):
|
def get(self, id):
|
||||||
return self._get('/v1/executions/%s' % id)
|
return self._get('/v1/executions/%s' % id)
|
||||||
|
|
||||||
|
def get_log(self, id):
|
||||||
|
return self._get('/v1/executions/%s/log' % id, return_raw=True)
|
||||||
|
@@ -48,6 +48,7 @@ openstack.function_engine.v1 =
|
|||||||
function_execution_create = qinlingclient.osc.v1.function_execution:Create
|
function_execution_create = qinlingclient.osc.v1.function_execution:Create
|
||||||
function_execution_delete = qinlingclient.osc.v1.function_execution:Delete
|
function_execution_delete = qinlingclient.osc.v1.function_execution:Delete
|
||||||
function_execution_show = qinlingclient.osc.v1.function_execution:Show
|
function_execution_show = qinlingclient.osc.v1.function_execution:Show
|
||||||
|
function_execution_log_show = qinlingclient.osc.v1.function_execution:LogShow
|
||||||
|
|
||||||
job_list = qinlingclient.osc.v1.job:List
|
job_list = qinlingclient.osc.v1.job:List
|
||||||
job_create = qinlingclient.osc.v1.job:Create
|
job_create = qinlingclient.osc.v1.job:Create
|
||||||
|
Reference in New Issue
Block a user