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
getVersionFileCounts API endpoints extended to support filtering by criteria #9985
Conversation
…taverse into 9907-file-counts-with-criteria
…nt (Pending IT to be added)
…tVersionFiles and getVersionFileCounts API endpoints
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
…unts-with-criteria
@GPortas
|
Thank you for your feedback.
These calls are working for me. |
@GPortas Thanks. Yes, I'd run into the quotes thing in some way with Jim. Exchanging single quotes for double some times works: curl 'http://localhost:8080/api/datasets/:persistentId/versions/:latest/nts?persistentId=doi:10.70122/FK2/IHEHUV&contentType=text/tab-separated-values' I thought I'd tried that here already but it must have been the other pr. OK, will merge, seeing that deaccession is addressed in the other pr but note there is a permissions issue around the endpoint in the other pr for deaccessioned datasets. |
What this PR does / why we need it:
Extended the getVersionFileCounts endpoint (/api/datasets/{id}/versions/{versionId}/files/counts) to support filtering by criteria.
In particular, the endpoint now accepts the following optional criteria query parameters:
This filtering criteria is the same as the one for the getVersionFiles endpoint.
Which issue(s) this PR closes:
Special notes for your reviewer:
IT case added for each of the supported query parameters, so a very extensive manual test is not necessary.
DatasetVersionFilesServiceBean has been refactored to make the filtering criteria logic reusable for multiple endpoints.
Suggestions on how to test this:
Create a dataset and upload files. Once you have uploaded the files, call the endpoint with the new criteria parameters to test that the returned counts are correct.
Example for content type:
curl http://localhost:8080/api/datasets/2/versions/:latest/files/counts?contentType=image/png
If the dataset is not public, you will need to add the API key to the call.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No
Is there a release notes update needed for this change?:
Yes
Additional documentation:
N/A