expose StoredWorkflowId in invocation API

This commit is contained in:
Simon Bray
2021-04-20 17:42:51 +02:00
parent d50579d37f
commit 8791f7e7e2
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -5559,6 +5559,7 @@ class WorkflowInvocation(UsesCreateAndUpdateTime, Dictifiable, RepresentById):
def to_dict(self, view='collection', value_mapper=None, step_details=False, legacy_job_state=False):
rval = super().to_dict(view=view, value_mapper=value_mapper)
rval['stored_workflow_id'] = self.workflow.stored_workflow.id
if view == 'element':
steps = []
for step in self.steps:
+6 -2
View File
@@ -827,7 +827,7 @@ class WorkflowsAPIController(BaseGalaxyAPIController, UsesStoredWorkflowMixin, U
:raises: exceptions.MessageException, exceptions.RequestParameterInvalidException
"""
# Get workflow + accessibility check.
stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id)
stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id, instance=kwd.get('instance', False))
workflow = stored_workflow.latest_workflow
run_configs = build_workflow_run_configs(trans, workflow, payload)
is_batch = payload.get('batch')
@@ -876,6 +876,10 @@ class WorkflowsAPIController(BaseGalaxyAPIController, UsesStoredWorkflowMixin, U
:param workflow_id: an encoded stored workflow id to restrict query to
:type workflow_id: str
:param instance: true if fetch by Workflow ID instead of StoredWorkflow id, false
by default.
:type instance: boolean
:param history_id: an encoded history id to restrict query to
:type history_id: str
@@ -891,7 +895,7 @@ class WorkflowsAPIController(BaseGalaxyAPIController, UsesStoredWorkflowMixin, U
:raises: exceptions.MessageException, exceptions.ObjectNotFound
"""
if workflow_id is not None:
stored_workflow_id = self.__get_stored_workflow(trans, workflow_id).id
stored_workflow_id = self.__get_stored_workflow(trans, workflow_id, instance=kwd.get('instance', False)).id
else:
stored_workflow_id = None