-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added multiple file download API #2962
base: develop
Are you sure you want to change the base?
Conversation
@istfer can you test and review the API |
} | ||
else { | ||
file_names <- list() | ||
file_names <- list.files(paste0(Sys.getenv("DATA_DIR", "/data/"), "workflows/PEcAn_", id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're querying the database to see if a workflow exists, why are you then making very strong (and often false) assumptions about where the workflow folder is rather than just looking at the folder that's stored in BETY?
full_files <- vector(mode = "character", length = length(filenames)) | ||
for (i in 1:length(filenames)) { | ||
|
||
# Check if the requested file exists on the host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're doing this check both here and in the last function then it seems like a good place to create a function that does the check. That way you only need to fix errors in one place? This code has the same filepath error as the previous and neither seems to be checkin whether the workflow being queried is on the local machine or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure sir, Ill try to have a single function for both of them!
parameters: | ||
- in: query | ||
name: pft_id | ||
description: If provided, returns all posteriors for the provided model_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo between pft_id and model_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sir Ill fix this typo
@koolgax99 checking to see if you had plans to address the requested changes at some point |
Yes @mdietze! I'll start fixing them, was caught up with other issues. |
@koolgax99 just pinging you again about finishing up this PR |
@koolgax99 checking back in about this PR. Would be good to wrap this and your other open PRs up |
Description
Added a REST API to download multiple file of a workflow.
The endpoint for the api is
/api/workflows/{id}/file-multiple/
the file list is provided in the request body injson
format and it is aPOST
request.Sample body:
{ "files": [ "pecan.xml", "workflow.R" ] }
Screenshot of the API:
Motivation and Context
This comes in handy for various researchers to download multiple files from a workflow. Earlier =, a researcher could only download a single file at a time via the
/api/workflows/{id}/file/{filename}
The issue created for this feature is #2940
Review Time Estimate
Types of changes
Checklist: