diff --git a/changelog.txt b/changelog.txt index 7ca3086..577c1df 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,12 @@ Change Log for FISSFC: the (Fi)recloud (S)ervice (S)elector ======================================================================= Terms used below: HL = high level interface, LL = low level interface +v0.16.26 - LL: added copyFilesWithPrefix parameter to clone_workspace, + create_submission no longer includes entity name and type in its + payload when they are not set; HL: added copyFilesWithPrefix + parameter to space_clone, config_start no longer requires entity to + be set in order to enable running non-data model configs. + v0.16.25 - HL: multiple enhancements to mop; only delete unreferenced files generated by workflows, ignore more files generated by the execution engine (e.g. rc, script, stdout, stderr), report file sizes, allow diff --git a/firecloud/__about__.py b/firecloud/__about__.py index 3e0150e..549abea 100644 --- a/firecloud/__about__.py +++ b/firecloud/__about__.py @@ -1,2 +1,2 @@ # Package version -__version__ = "0.16.25" +__version__ = "0.16.26" diff --git a/firecloud/api.py b/firecloud/api.py index 9dea4bd..c6244e3 100755 --- a/firecloud/api.py +++ b/firecloud/api.py @@ -1034,7 +1034,7 @@ def list_submissions(namespace, workspace): return __get(uri) def create_submission(wnamespace, workspace, cnamespace, config, - entity, etype, expression=None, use_callcache=True): + entity=None, etype=None, expression=None, use_callcache=True): """Submit job in FireCloud workspace. Args: @@ -1058,11 +1058,15 @@ def create_submission(wnamespace, workspace, cnamespace, config, body = { "methodConfigurationNamespace" : cnamespace, "methodConfigurationName" : config, - "entityType" : etype, - "entityName" : entity, "useCallCache" : use_callcache } + if etype: + body['entityType'] = etype + + if entity: + body['entityName'] = entity + if expression: body['expression'] = expression @@ -1246,7 +1250,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=""): + authorizationDomain="", copyFilesWithPrefix=None): """Clone a FireCloud workspace. A clone is a shallow copy of a FireCloud workspace, enabling @@ -1258,6 +1262,7 @@ def clone_workspace(from_namespace, from_workspace, to_namespace, to_workspace, to_namespace (str): project to which target workspace belongs to_workspace (str): Target workspace's name authorizationDomain: (str) required authorization domains + copyFilesWithPrefix: (str) prefix of bucket objects to copy to the destination workspace Swagger: https://api.firecloud.org/#!/Workspaces/cloneWorkspace @@ -1277,6 +1282,9 @@ def clone_workspace(from_namespace, from_workspace, to_namespace, to_workspace, "attributes": dict(), "authorizationDomain": authDomain, } + + if copyFilesWithPrefix is not None: + body["copyFilesWithPrefix"] = copyFilesWithPrefix uri = "workspaces/{0}/{1}/clone".format(from_namespace, from_workspace) return __post(uri, json=body) diff --git a/firecloud/fiss.py b/firecloud/fiss.py index fbce666..f78a74f 100644 --- a/firecloud/fiss.py +++ b/firecloud/fiss.py @@ -147,7 +147,7 @@ def space_clone(args): return 1 r = fapi.clone_workspace(args.project, args.workspace, args.to_project, - args.to_workspace) + args.to_workspace, args.copyFilesWithPrefix) fapi._check_response_code(r, 201) if fcconfig.verbosity: @@ -567,6 +567,10 @@ def config_start(args): args.namespace = fcconfig.method_ns if not args.namespace: raise RuntimeError("namespace not provided, or configured by default") + + # If no entity name is given, unset entity_type + if args.entity is None: + args.entity_type = None r = fapi.create_submission(args.project, args.workspace,args.namespace, args.config, args.entity, args.entity_type, @@ -2100,6 +2104,8 @@ def main(argv=None): 'be different from the workspace being cloned' subp = subparsers.add_parser('space_clone', description=clone_desc, parents=[workspace_parent, dest_space_parent]) + subp.add_argument('-f', '--copyFilesWithPrefix', help='Specify a prefix ' + + 'of bucket objects to copy to the destination workspace') subp.set_defaults(func=space_clone) # Import data into a workspace @@ -2495,12 +2501,14 @@ def main(argv=None): # Invoke a method configuration subp = subparsers.add_parser('config_start', description='Start running workflow in a given space', - parents=[workspace_parent, conf_parent, entity_parent]) + parents=[workspace_parent, conf_parent]) + subp.add_argument('-e', '--entity', help="Entity name (required if " + + "executing on an entity)") # Duplicate entity type here since we want sample_set to be default subp.add_argument('-t', '--entity-type', default='sample_set', choices=etype_choices, - help='Entity type to assign null values, if attribute ' + - 'is missing. Default: %(default)s') + help='Entity type of specified entity. Not used if no ' + + 'entity is named. Default: %(default)s') expr_help = "(optional) Entity expression to use when entity type " \ "doesn't match the method configuration." \ "Example: 'this.samples'"