I understand that (as per the docs) an archive can be generated by using a POST to /studies/{id}/archive. This would include the DICOMDIR of course.
I appreciate that performing the same archive on the /patients/{id}/archive but then that would (I assume) include all studies and I have the requirement to only zip up select studies.
Is it possible to create one archive of select studies? If so, what does the URL look like?
Ah ha! /tools/create-media
with a list of resources looks like exactly what I’m after, I believe?
Ok - thanks for bearing with me everyone! Last question (which I don’t think I can answer myself)…
When creating either an archive or media, I see that it can be downloaded using the job/{id}/archive > download.zip
format … but after downloading, I would like to then reclaim the disk space used, but I don’t see in the API the ability to DELETE the archive after a download.
I would imagine that I could use something like
curl --request DELETE --url http://localhost:8042/jobs/{id}/archive
but that’s not listed in the API documentation online. I tried it and it appears to have been accepted - I immediately tried downloading it (and that worked) but I also understand that there’s a configuration parameter that delays “delete” functionality so things aren’t removed immediately.
Am I going down the correct line here?
Hi Dave,
No there is no such DELETE request.
Right now, the deletion of archive is driven only by this configuration:
// Maximum number of ZIP/media archives that are maintained by
// Orthanc, as a response to the asynchronous creation of archives.
// The least recently used archives get deleted as new archives are
// generated. This option was introduced in Orthanc 1.5.0, and has
// no effect on the synchronous generation of archives.
"MediaArchiveSize" : 1,
HTH,
Alain
Alain,
Thanks - yes this certainly helps.
However, could I put a request in to have DELETE added to the API, please? I appreciate that the MediaArchiveSize certainly helps, but I can easily see instances where more than one archive should be kept on the server. Being able to programmatically remove one (upon a successful download for example) would be ultimately very beneficial.
Dave
Hi Dave,
I was hesitating to implement before you asked so here it is.
It will be available in the next release.
Best regards,
Alain.
1 Like