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
Extend Datasets getDownloadSize API endpoint to support file search criteria and deaccessioned datasets #10014
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
curl "https://demo.dataverse.org/api/datasets/24/versions/1.0/downloadsize?tabularTagName=Survey" | ||
|
||
Content type filtering is also optionally supported. To return the size of all files available for download matching the requested content type. | ||
|
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.
Does it make sense to list some or all of the possible content types here?
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.
There are many different content types (https://github.com/IQSS/dataverse/blob/develop/src/main/java/propertyFiles/MimeTypeFacets.properties).
Being something so extensive and variable, I'm not sure if it would be really useful.
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.
Looks good overall. Just a question about adding more to the doc and a reminder to get the latest from dev
@GPortas @don I'm seeing build error on Jenkins: |
I don't see any errors in actions or my localhost. It seems more like a problem with how the directories are configured in Jenkins (?) Since it tries to access the file in the /tmp directory and cannot find it. Also, the component under test is not related to the changes in this PR. |
@GPortas @donsizemore It's building now, thanks. |
What this PR does / why we need it:
Extended the getDownloadSize endpoint (/api/datasets/{id}/versions/{versionId}/downloadsize), including the following new features:
The endpoint now accepts a new boolean optional query parameter "includeDeaccessioned", which, if enabled, causes the endpoint to consider deaccessioned dataset versions when searching for versions to obtain the file total download size.
The endpoint now supports filtering by criteria. In particular, it accepts the following optional criteria query parameters:
Which issue(s) this PR closes:
Closes #9995
Special notes for your reviewer:
This extension is required for the SPA to display deaccessioned dataset versions.
Suggestions on how to test this:
Create a dataset.
Upload files to the dataset and test the endpoint via curl.
This is a call which already worked before this PR. For ignoring the tabular original sizes:
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "http://localhost:8080/api/datasets/24/versions/1.0/downloadsize?mode=Archival"
Add one of the new criteria options, for example "contentType".
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "http://localhost:8080/api/datasets/24/versions/1.0/downloadsize?mode=Archival&contentType=image/png"
Here we are using contentType=image/png. Replace the value with the kind of content type you are looking for.
Deaccession the dataset and ensure you can obtain the same information as before when sending an API key linked to a user with permissions and specifying includeDeaccessioned=true.
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "http://localhost:8080/api/datasets/24/versions/1.0/downloadsize?mode=Archival&contentType=image/png&includeDeaccessioned=true"
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