...
- The REST Web Service is called by using an HTTP client.
- The following REST Web Service requests are supported:
- URL
joc/api/security/login
- The first operation of a client should be call to this URL in order to authenticate and to retrieve an access token.
- A valid account and password have to be provided by the client for HTTP authentication. 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.
- URL
joc/api/jobscheduler/
commandcommands
- Subsequent XML Commands can be sent by use of this URL.
- The XML command is added to the body of the web service request.
- The JobScheduler REST Web Service will return the respective XML Response.
- URL
joc/api/security/logout
- The last operation of a client should be a call to this URL in order to logout from the web service.
- URL
- Requirements
- All REST Web Service requests should use an HTTP POST operation.
- Should an idle timeout of 15 minutes between two web service requests be exceeded then the current session is invalidated and a login has to be performed.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
POST /joc/api/jobscheduler/commandcommands HTTP/1.1 Host: localhost:4446 access_token: c96a8563-5910-4d76-bc2a-4bc969a88d05 Content-Type: application/xml Cache-Control: no-cache <jobscheduler_commands jobschedulerId='scheduler111'><show_state/></jobscheduler_commands> |
...
- The JobScheduler REST Web Service (and the JOC Cockpit) are operated on the
localhost
with port4446
. - The URL in use is
http://localhost:4446/joc/api/jobscheduler/commandcommands
- The value for the
access_token
has been retrieved from a previous authentication request. - Consider use of the
Content-Type
headerapplication/xml
. - The body contains the effective XML commands wrapped in a
<jobscheduler_commands jobschedulerId="..."/>
element wherejobschedulerId
is the JobScheduler ID of the respective JobScheduler Master.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
POST /joc/api/jobscheduler/commandcommands HTTP/1.1 Host: localhost:4446 access_token: ce31fb8f-9f5a-4e3e-805d-72c71d0547ce Content-Type: application/xml Cache-Control: no-cache Postman-Token: 88bd687a-586d-fd93-d203-bcd7e71a6a85 <jobscheduler_commands jobschedulerId='scheduler111'><add_order job_chain="/some_folder/some_chain"><params><param name="first" value="1st"/><params name="second" value="2nd"/></params></add_order></jobscheduler_commands> |
...
- The JobScheduler REST Web Service (and the JOC Cockpit) are operated on the
localhost
with port4446
. - The URL in use is
http://localhost:4446/joc/api/jobscheduler/commandcommands
- The value for the
access_token
has been retrieved from a previous authentication request. - Consider use of the
Content-Type
headerapplication/xml
. - The body contains the effective XML commands wrapped in a
<jobscheduler_commands jobschedulerId="..."/>
element wherejobschedulerId
is the JobScheduler ID of the respective JobScheduler Master. The effective XML Command<add_order/>
is used to to add a temporary order to a job chain and optionally to add parameters to the order.
...