Select queue

This section documents how to switch between active job queues. By default the IP-address of the calling host is used to deduce the active job queue unless one is selected. The active queue is stored on client computer using the hostid cookie.

From web interface

Click on the clock in main tool bar from the web interface to open the queue select dialog. Type in the prefered queue name and apply by pressing swicth button.

Showing queue selecting from web interface

To revert back to default queue, use an empty name or press the revert button.

From web service

Both the SOAP and JSON service provides methods for switching between active queues. These two are functional equivalent, but for simplicity we restrict ourself to describing the JSON call using the curl command.

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/select -d '{"queue":"myqueue"}'
{"status":"success","result":"e47135de28d5c36dd5ed5a816cf61658"}

Appending the verbose flag reveals that HTTP response headers include a set cookie directive:

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/select -d '{"queue":"myqueue"}' -v
Set-Cookie: hostid=e47135de28d5c36dd5ed5a816cf61658; path=/

Enable a cookie store in the web service client should automatic set and send the cookie in future requests.

Custom HTTP header

Using a cookie store is not required, the hostid can also be provided by a custom HTTP header:

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/version \
-H 'X-Batchelor-Hostid: e47135de28d5c36dd5ed5a816cf61658' -v
X-Batchelor-Hostid: e47135de28d5c36dd5ed5a816cf61658

Using a custom HTTP header has the additional feature that your web client can easily interact with multiple job queues at same time. For example, output from one could be input for another.