def get_uploaded_file(self, group_id: str, file_id: str) -> IO: """Get handle for file with given identifier that was uploaded to the workflow group. Currently we do allow downloads for non-submission members (i.e., the user identifier is optional). Parameters ---------- group_id: string Unique workflow group identifier file_id: string Unique file identifier Returns ------- io.BytesIO Raises ------ flowserv.error.UnauthorizedAccessError flowserv.error.UnknownFileError flowserv.error.UnknownWorkflowGroupError """ url = self.urls(route.FILES_DOWNLOAD, userGroupId=group_id, fileId=file_id) return download_file(url=url)
def get_result_archive(self, run_id: str) -> IO: """Get compressed tar-archive containing all result files that were generated by a given workflow run. If the run is not in sucess state a unknown resource error is raised. Raises an unauthorized access error if the user does not have read access to the run. Parameters ---------- run_id: string Unique run identifier Returns ------- io.BytesIO """ url = self.urls(route.RUNS_DOWNLOAD_ARCHIVE, runId=run_id) return download_file(url=url)
def get_result_file(self, run_id: str, file_id: str) -> IO: """Get file handle for a resource file that was generated as the result of a successful workflow run. Raises an unauthorized access error if the user does not have read access to the run. Parameters ---------- run_id: string Unique run identifier. file_id: string Unique result file identifier. Returns ------- flowserv.model.files.FileHandle """ url = self.urls(route.RUNS_DOWNLOAD_FILE, runId=run_id, fileId=file_id) return download_file(url=url)