Add support to get execution's log

Change-Id: If5f62f5f86601cb8a0e11dec299d4ec1867143f9
This commit is contained in:
Lingxian Kong
2017-08-14 10:27:44 +12:00
parent ca23fec3a3
commit 98f3df49b4
3 changed files with 18 additions and 0 deletions

View File

@@ -109,3 +109,17 @@ class Show(command.ShowOne):
execution = client.function_executions.get(parsed_args.execution)
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")

View File

@@ -34,3 +34,6 @@ class ExecutionManager(base.Manager):
def get(self, id):
return self._get('/v1/executions/%s' % id)
def get_log(self, id):
return self._get('/v1/executions/%s/log' % id, return_raw=True)

View File

@@ -48,6 +48,7 @@ openstack.function_engine.v1 =
function_execution_create = qinlingclient.osc.v1.function_execution:Create
function_execution_delete = qinlingclient.osc.v1.function_execution:Delete
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_create = qinlingclient.osc.v1.job:Create