Scope
- The JobScheduler REST Web Services can be used by any client program or job that has to access JobScheduler objects for operations such as adding an order to a job chain.
- The REST Web Services are a replacement for the XML Interface. and require authentication and authorization.
A system administrator would then integrate the permissions necessary to carry out the operations required in the authorization system used by the Web Services API. More information about how this can be done is available in the Authentication and Authorization - Configuration article.
Usage
- The REST Web Services are called by using an HTTP client.
- The following REST web service requests are supported:
- The first operation of a client should be call to the
joc/api/security/login
URL.- A valid account and password have to be provided by the client. The account and permissions for the command(s) to be executed are configured with the
shiro.ini
configuration file. See the Authentication and Authorization - Configuration article and the exampleapi_user
configuration for further information. - Use the
joc/api/security/joc_cockpit_permissions
URL to retrieve the permissions for the current user.
- A valid account and password have to be provided by the client. The account and permissions for the command(s) to be executed are configured with the
- Subsequent commands can be sent by use of the
joc/api/jobscheduler/command
URL. - The last operation of a client should be a call to the
joc/api/security/logout
URL.
- The first operation of a client should be call to the
Complete List of Permissions
The following table shows all the permissions that can be set to allow an API user to address the JobScheduler Web Services API.
Note that while this list is similar to the JOC Cockpit user permissions there are significant differences between the two permission sets.
Permission | Reference to XML Interface | Description |
---|---|---|
sos:products:commands:jobscheduler_master:view:status | <show_state/> | Retrieves status information about a JobScheduler Master |
sos:products:commands:jobscheduler_master:view:parameter | Shows parameters from ./config/ scheduler.xml | |
sos:products:commands:jobscheduler_master:execute:restart:terminate | <terminate restart="yes"/> | Terminates and restarts a JobScheduler Master |
sos:products:commands:jobscheduler_master:execute:restart:abort | <modify_spooler cmd="abort_immediately_and_restart"/> | Aborts and restarts a JobScheduler Master |
sos:products:commands:jobscheduler_master:execute:pause | <modify_spooler cmd="pause"/> | Pauses a JobScheduler Master |
sos:products:commands:jobscheduler_master:execute:continue | <modify_spooler cmd="continue"/> | Continues operation of the JobScheduler Master after pausing |
sos:products:commands:jobscheduler_master:execute:terminate | <terminate/> | Terminates a JobScheduler Master |
sos:products:commands:jobscheduler_master:execute:abort | <modify_spooler cmd="abort_immediately"/> | Aborts a JobScheduler Master |
sos:products:commands:jobscheduler_master:execute:stop | <modify_spooler cmd="stop"/> | Stops any running tasks in a JobScheduler Master |
sos:products:commands:jobscheduler_master:manage_categories | <scheduler_log.log_categories.set/> <scheduler_log.log_categories.reset/> | Activates, retrieves and resets log categories |
sos:products:commands:jobscheduler_master_cluster:execute:terminate_fail_safe | Terminates the active JobScheduler cluster member and activates a passive cluster member for fail-over | |
sos:products:commands:jobscheduler_master_cluster:execute:restart | <terminate restart="yes" all_schedulers="yes"/> | Terminates and restarts all JobScheduler cluster members |
sos:products:commands:jobscheduler_master_cluster:execute:terminate | <terminate all_schedulers="yes"/> | Terminates all JobScheduler cluster members |
sos:products:commands:history:view | <show_history/> | Retrieve the JobScheduler history |
sos:products:commands:order:view:status | <show_order/> | Retrieve order status information |
sos:products:commands:order:change:start_and_end_node | <modify_order state="..." end_state="..."/> | Modifies the starting and ending states of an order |
sos:products:commands:order:change:time_for_adhoc_orders | <modify_order><run_time/></modify_order> | Modifies the run-time of a temporary ad hoc order |
sos:products:commands:order:change:parameter | <modify_order><params><param name="..." value="..."/></params></modify_order> | Modifies order parameters |
sos:products:commands:order:change:run_time | <modify_order><run_time/></modify_order> | Modifies the run-time of a permanent order |
sos:products:commands:order:change:state | <modify_order state="..."/> | Modifies an order's state |
sos:products:commands:order:change:other | <modify_order/> | Modifies any remaining order attributes not covered by other permissions |
sos:products:commands:order:change:hot_folder | <modify_hot_folder><order/></modify_hot_folder > | Updates an order in the JobScheduler Master ./config/live directory |
sos:products:commands:order:execute:start | <modfiy_order at="now"/> | Causes an immediate start of the order |
sos:products:commands:order:execute:update | <modify_order/> | Updates order attributes |
sos:products:commands:order:execute:suspend | <modify_order suspended="yes"/> | Suspends an order |
sos:products:commands:order:execute:resume | <modify_order suspended="no"/> | Continues a previously suspended order |
sos:products:commands:order:execute:reset | <modify_order action="reset"/> | Resets an order |
sos:products:commands:order:execute:remove_setback | <modify_order setback="no"/> | Removes a setback setting for an order |
sos:products:commands:order:delete | <remove_order/> | Removes a temporary ad hoc order from the JobScheduler Master |
sos:products:commands:job_chain:view:status | <show_state/> | Retrieves status information about a job chain |
sos:products:commands:job_chain:execute:stop | <job_chain.modify state="stopped"/> | Stops a job chain |
sos:products:commands:job_chain:execute:unstop | <job_chain.modify state="running"/> | Continues a previously stopped job chain |
sos:products:commands:job_chain:execute:add_order | <add_order/> | Add a temporary ad hoc order to a job chain |
sos:products:commands:job_chain:execute:skip_jobchain_node | <job_chain_node.modify action="next_state"/> | Skips a job chain node |
sos:products:commands:job_chain:execute:process_jobchain_node | <job_chain_node.modify action="process"/> | Continues processing of a job chain node that has previously been skipped or stopped |
sos:products:commands:job_chain:execute:stop_jobchain_node | <job_chain_node.modify action="stop"/> | Stops a job chain node |
sos:products:commands:job_chain:change:hot_folder | <modify_hot_folder><job_chain/></modify_hot_folder > | Updates a job chain in the JobScheduler Master ./config/live directory |
sos:products:commands:job:view:status | <show_job/> | Retrieves status information about a job |
sos:products:commands:job:change:run_time | <modify_order><run_time/></modify_order> | Modifies the run-time of a job |
sos:products:commands:job:change:hot_folder | <modify_hot_folder><job/></modify_hot_folder > | Updates a job in the JobScheduler Master ./config/live directory |
sos:products:commands:job:execute:start | <start_job/> | Starts a job |
sos:products:commands:job:execute:stop | <modify_job cmd="stop"/> | Stops a job |
sos:products:commands:job:execute:unstop | <modify_job cmd="unstop"/> | Unstops a previously stopped job |
sos:products:commands:job:execute:terminate | <modify_job cmd="end"/> | Terminates a job |
sos:products:commands:job:execute:kill | <kill_task/> | Kills a task that is running for the job |
sos:products:commands:job:execute:end_all_tasks | <kill_task immediately="yes" timeout="never"/> | Sends all running tasks for a job a SIGTERM signal |
sos:products:commands:job:execute:suspend_all_tasks | <modify_job cmd="suspend"/> | Suspends all running tasks for a job |
sos:products:commands:job:execute:continue_all_tasks | <modify_job cmd="continue"/> | Continues all previously suspended tasks for a job |
sos:products:commands:process_class:view:status | <show_state/> | Retrieves status information about process classes |
sos:products:commands:process_class:edit:change | <process_class/> | Modifies a process class |
sos:products:commands:process_class:edit:remove | <process_class.remove/> | Removes a process class |
sos:products:commands:process_class:modify_hot_folder | <modify_hot_folder><process_class/></modify_hot_folder > | Updates a process class in the JobScheduler Master ./config/live directory |
sos:products:commands:schedule:view:status | <show_state/> | Retrieves status information about schedules |
sos:products:commands:schedule:add_substitute | <modify_hot_folder><schedule substitute="..."/></modify_hot_folder > | Assigns a substitute schedule to an existing schedule |
sos:products:commands:schedule:remove | <schedule.remove/> | Removes a schedule |
sos:products:commands:schedule:modify_hot_folder | <modify_hot_folder><schedule/></modify_hot_folder > | Updates a schedule in the JobScheduler Master ./config/live directory |
sos:products:commands:lock:view:status | <show_state/> | Retrieves status information about locks |
sos:products:commands:lock:edit:change | <lock/> | Modifies a lock |
sos:products:commands:lock:remove | <lock.remove/> | Removes a lock |
Examples
Allow orders to be viewed and executed
Allow all order operations except changing and removing orders
Retrieve permissions for the current user
The answer to the joc/api/security/joc_cockpit_permissions
request is a JSON object.
The valueOf(permission)
function will be evaluated to true/false
indicating if the permission is granted.
If the user is assigned a role that includes the permissions specified in brackets then the permission will be granted.
References