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.
The start script makes use of a Java class that implements the HTTP client.
Status Information
- JS-1410Getting issue details... STATUS
The Universal Agent provides status information via web services.
Information about Running Jobs
- JS-1412Getting issue details... STATUS
The JobScheduler Universal Agent delivers additional information in the webservice /jobscheduler/agent/tasks
:
- a task overview:
- called using:
jobscheduler/agent/api/task
(without an end forward slash)
- called using:
- a list of all tasks:
- called using:
jobscheduler/agent/api/task/
(with an end forward slash)
- called using:
In addition, the following information is available per task:
- internal information:
- process ID (debug info)
- JobScheduler Master IP address
- public information per task:
- started at
- task id
- this information is called using:
jobscheduler/agent/api/tasks
(without an end forward slash)
Termination
- JS-1400Getting issue details... STATUS
- JS-1401Getting issue details... STATUS
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.
Commands to terminate an Agent are sent by use of an HTTP POST request.
See also
Change Management References - Web Service