DownloadProcessArtifact endpoint
https://redmine.teklia.com/issues/7497
To make it easier for users to download the outputs of export processes, a new DownloadProcessArtifact
endpoint should be introduced at /api/v1/process/{id}/download/
. It works similarly to DownloadArtifact
: a GET request returns an HTTP 302 response redirecting to an S3 URL to download the artifact.
To find the one artifact of a process, this endpoint should look for an artifact:
- linked to a task on the specified process;
- from the last run of this process;
- that has not been restarted;
- that no other tasks depend on (maximum depth).
If there are no artifacts with this criteria, it returns HTTP 404. If there is more than one artifact, it also returns an HTTP 404, but with a different and explicit message. If the user does not have guest access on the process, it returns HTTP 404 too, without an explicit message, because that user is not supposed to know the process exists.
This endpoint works on processes of any mode, because the mode doesn't matter on the API side. The frontend will however only provide easy access to this endpoint for Export processes.