Skip to content

Commit

Permalink
FISS v0.16.37 (#186)
Browse files Browse the repository at this point in the history
api.py
* get_workflow_metadata updated to include the arguments include_key, exclude_key, and expand_sub_workflows.
  • Loading branch information
dheiman authored Mar 19, 2024
1 parent e973cbd commit 66e6b64
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Change Log for FISSFC: the (Fi)recloud (S)ervice (S)elector
================================================================================
Terms used below: HL = high level interface, LL = low level interface

v0.16.37 - LL: enhanced get_workflow_metadata to include the arguments
include_key, exclude_key, and expand_sub_workflows to match the API.

v0.16.36 - Hotfix: the old billing API is being removed, HL and LL updated to
use the new one; Makefile updated to ensure image is built for
linux/amd64; Dockerfile updated to use latest Python-3.10.
Expand Down
2 changes: 1 addition & 1 deletion firecloud/__about__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Package version
__version__ = "0.16.36"
__version__ = "0.16.37"
25 changes: 22 additions & 3 deletions firecloud/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,21 +1293,38 @@ def get_submission(namespace, workspace, submission_id):
workspace, submission_id)
return __get(uri)

def get_workflow_metadata(namespace, workspace, submission_id, workflow_id):
def get_workflow_metadata(namespace, workspace, submission_id, workflow_id,
include_key=None, exclude_key=None,
expand_sub_workflows=False):
"""Request the metadata for a workflow in a submission.
Args:
namespace (str): project to which workspace belongs
workspace (str): Workspace name
submission_id (str): Submission's unique identifier
workflow_id (str): Workflow's unique identifier.
include_key (array[str]): When specified, return only these keys in the
response. Matches any key in the response, including within nested
blocks. May not be used with exclude_key.
exclude_key (array[str]): When specified, omit these keys from the
response. Matches any key in the response, including within nested
blocks. May not be used with include_key.
expand_sub_workflows (bool): When true, metadata for sub workflows will
be fetched and inserted automatically in the metadata response.
Swagger:
https://api.firecloud.org/#!/Submissions/workflowMetadata
"""
uri = "workspaces/{0}/{1}/submissions/{2}/workflows/{3}".format(namespace,
workspace, submission_id, workflow_id)
return __get(uri)
params = {}
if include_key is not None:
params["includeKey"] = include_key
if exclude_key is not None:
params["excludeKey"] = exclude_key
if expand_sub_workflows:
params["expandSubWorkflows"] = expand_sub_workflows
return __get(uri, params=params)

def get_workflow_outputs(namespace, workspace, submission_id, workflow_id):
"""Request the outputs for a workflow in a submission.
Expand Down Expand Up @@ -1514,7 +1531,7 @@ def update_workspace_acl(namespace, workspace, acl_updates, invite_users_not_fou
return __SESSION.patch(uri, headers=headers, data=json.dumps(acl_updates))

def clone_workspace(from_namespace, from_workspace, to_namespace, to_workspace,
authorizationDomain="", copyFilesWithPrefix=None):
authorizationDomain="", copyFilesWithPrefix=None, bucketLocation=None):
"""Clone a FireCloud workspace.
A clone is a shallow copy of a FireCloud workspace, enabling
Expand Down Expand Up @@ -1549,6 +1566,8 @@ def clone_workspace(from_namespace, from_workspace, to_namespace, to_workspace,

if copyFilesWithPrefix is not None:
body["copyFilesWithPrefix"] = copyFilesWithPrefix
if bucketLocation is not None:
body["bucketLocation"] = bucketLocation

uri = "workspaces/{0}/{1}/clone".format(from_namespace, from_workspace)
return __post(uri, json=body)
Expand Down

0 comments on commit 66e6b64

Please sign in to comment.