Running the Universal Agent as a REST Web Service
The Universal Agent comes with a REST web service client that allows it to be controlled from the command line. The service supports the following operations:
- sending commands and
- showing information.
Commands can be sent to an Agent:
- via any client application that sends the command with an HTTP request (JSON)
- via the start script of the Agent.
Termination
The JobScheduler Universal Agent should be terminated by the following actions:
- abort immediately:
- the Agent will kill all running tasks and will terminate immediately
- the client sends:
{ "$TYPE": "AbortImmediately" }
- this corresponds to the command that is used for a Master:
- <modify_spooler cmd='abort_immediately'/>
- terminate:
- the Agent will not start new tasks, existing tasks can continue and the Agent will terminate after all tasks have completed
- optionally a SIGTERM can be sent to the tasks
- the client sends:
{ "$TYPE": "Terminate", "sigtermProcesses": false }
- this corresponds to the command that is used for a Master:
- <modify_spooler cmd='terminate'/>
- terminate with timeout:
- the Agent sends all tasks a SIGTERM command and will wait for the specified timeout.
Should any task not terminate within the specified timeout then it will be killed with a SIGKILL signal. - the client sends:
{ "$TYPE": "Terminate", "sigtermProcesses": false, "sigkillProcessesAfter": 15 }
- this corresponds to the command that is used for a Master:
- <modify_spooler cmd='terminate' timeout='15'/>
- the Agent sends all tasks a SIGTERM command and will wait for the specified timeout.
See also
Change Management References - Web Service