Closed victor73 closed 3 years ago
Done. All endpoints now support an optional catalogId and all will return a 404 if the catalogId doesn't exist. If the catalog exists but the requested DCC is not present (for those endpoints that specify a DCC) a 404 will also be returned (as before), but the error message will differentiate the two. If no catalogId is specified then the default catalog id will be used. Currently both the DERIVA server name and default catalog id are specified by environment variables, namely DERIVA_SERVERNAME and DERIVA_DEFAULT_CATALOGID.
I've tested the new code manually against the cfde-deriva epic2_202101 branch, using the DERIVA instance on app-dev.nih-cfde.org. It would be good to add some automated testing, but it will have to be data-dependent.
In order to retrieve statistics from deriva about pending DCC submissions for display and review, the current API endpoints need to be changed to allow an additional parameter for the catalog ID to be specified. If the catalog ID is not provided, then the data for the currently approved (or default) submission is retrieved.