Ability to upload multiple files when creating an event
Description of feature request
It would be useful to have the ability to upload multiple files when creating a G event.
Use cases
CBC searches currently upload a LIGOLW XML file at event creation, followed by two JSON files containing the EM-bright and p_astro information. At least some of the searches also upload a few other files, for example diagnostic plots.
Benefits
The first benefit is convenience: GraceDB products are uploaded with a smaller number of REST/API calls, ideally just one, making the code simpler.
I suspect there would be two other benefits, though I do not know enough about the server code to judge if they are realistic or not:
- Robustness: reducing the number of HTTP requests might reduce the probability of a failure (e.g. due to a network glitch) and make the event creation more "atomic", in the sense of guaranteeing that if an event is created, it will have all the necessary files.
- Latency: currently each file upload adds order 1 s of latency, and occasionally much more. Transferring everything in a single request might help with that.
Drawbacks
Apart from the obvious implementation burden, I cannot see any at the moment.
I suppose an alternative to an API change would be to design a file format which could actually communicate all the search information in a single file. There has been discussion in the past about storing the p_astro information in the LIGOLW file, for example, though that idea appears to have been shelved. Given how complicated it is to change established file formats, though, I think this feature request is still reasonable.
Suggested solutions
I forget at the moment if HTTP requests support multiple files. If so, the feature seems easy to implement. Otherwise, one could come up with a simple data structure (e.g. JSON) that encodes the list of (file name, file content) pairs, and upload that as a file, though that may require some post-processing to "expand" the JSON back into the list of individual files on the server side.