Open mtbc opened 4 years ago
To #100 now pushed itemized disk usage reporting to ease any subsequent enforcement of usage limits.
When/if we update the Request for configurability, I assume we could also update the Response for returning size information.
Could be the response could somehow mirror the form in which the desired configuration is supplied.
The description of #100 suggests that subsequent PRs could include configurability for:
Expanding on that, the focus here is on
duplicateUnderlyingFiles
. It callsgetPath
which can tell if a file is inFiles/
,Pixels/
,Thumbnails/
,ManagedRepository/
,lib/scripts/
(throws) or elsewhere (throws). It also callsduplicateFile
which currently decides between hard-linking and copying and could conceivably soft-link. One can imagine extending omero::cmd::Duplicate with extra options that:Pixels/
,ManagedRepository/
, whatever) how to duplicate the underlying files, conceivably with a list of fallback options.Files.size
orOriginalFile.size
total whenever copying then throwing to cause rollback if some threshold is exceeded.For example, one could define enums for
FILES
,PIXELS
,THUMBS
,MANAGED
and forHARD_LINK
,SOFT_LINK
,COPY
then allow the client to pass a dictionary with the former as keys whose values are lists of the latter, the current default being:FILES
→ [COPY
]PIXELS
→ [COPY
]THUMBS
→ [COPY
]MANAGED
→ [HARD_LINK
,COPY
]Also allow passing a disk usage limit such that one gets an exception if
COPY
adds up to more. That too could usefully be a dictionary keyed on file location.Server configuration could specify constraints in similar terms for admins and normal users.