Closed kristinriebe closed 8 years ago
Instead of using
[...] --wait 30 --executing
etc. for the wait phase, we could also use
[...] --wait 30 --phase executing
etc.
This would have the advantage that we can give a more meaningful error message, if a wrong (non-active) phase is given (e.g. 'phase is not supported, only ... allowed').
A 'wrong' phase in this sense is any phase other than EXECUTING, QUEUED or PENDING. Currently, if e.g. --completed
is provided, argparse complains about an unrecognized argument. I tried to catch this by experimenting with argparse.REMAINDER, but it seemed buggy. Any opinions on that?
I'm fine with the phase keyword
if my small comments are addressed, you can consider this approved.
This includes the additional optional parameter "--wait" for
uws job show
that can be used when requesting job details from a UWS1.1 server. The server is expected to block and return if a) the job changed its phase b) the specified time is over c) the server times out or stops blocking for some other reason (e.g. too many blocking requests)If additionally a phase is given with "--executing", "--queued" or "--pending" (nothing else allowed), then server should return immediately, if the job is not in the specified phase. See section 2.2.1.2 Blocking Behaviour of the UWS standard.
Example:
uws job show [id] --wait 30 --executing
Waits for 30 seconds for the job with id [id], but returns immediately if phase of job is not executing.