Check for online agents when submitting a job #423
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This implements a new server API to get a list of the agents listening on a queue. That's used by the CLI to figure out if any of them are online before submitting a job. If there are no agents listening on the specified queue, or if all of them are offline, then it uses a new parameter to the CLI to determine what to do:
--wait-for-available-agents
If that flag is used, then it will warn the user that no agents seem to be listening, and wait for the job to run anyway. Otherwise, the default behavior is to print an error and exit, failing to submit the job.
Resolved issues
CERTTF-338
Documentation
Added API documentation to the server README.rst and also extended the schema so that the /docs API reference is updated.
Web service API changes
This is detailed in the API reference (/docs path on the server) as well as in the README.rst for the server:
** [GET] /v1/queues/<queue_name>/agents** - Get the list of agents listening to a specified queue
Tests
Tested locally and with added unit tests