How to control the batch server

Introduction

The batch server is now managed by the Syracuse platform. This means that you can access services in http or https mode, with a set of URLs that
controls it.
Any tool can be used with different syntaxes.

There are several ways of doing this, you can:

1. List the batch servers and then call an API to access them

2. Use a direct access to the batch server via its code name

3. Use the batch server dispatcher

1. List the batch servers and then call an API to access them

Get the list of batch servers, if they are several.

With myserv:port being the server host name or address and the TCP port used for the Syracuse web server, the URL will be:

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers?representation=batchServer.$query

Note

In the URL above, the /api1/ segment can be used from an http client that transmits the authentication such as curl or postman. It manages the session as a web service. When authenticated through the web client, /api1/ can be replaced by /sdata/.

The result of the request looks like this feed. In this case, the $resource array contains the list of batch servers identified by the $key value. The status is also indicated in the feed.
{"$url": "http:…","$descriptor": "batchServers","$startIndex": 1,"$itemsPerPage": 20,"$totalResults": 1,"$ui": "…","$resources": [{"$uuid": "d11235c9-90db-4951-b2bc-7fbf198e9650","$key": "d11235c9-90db-4951-b2bc-7fbf198e9650","$etag": 1,"$creUser": "admin","$creDate": "2016-11-08T16:44:42.852Z","$updUser": "admin","$updDate": "2018-02-21T07:29:15.185Z","$properties": {"maxDelay": {"$isDisabled": true},"killOverTime": {"$isDisabled": true},"execInterval": {"$isDisabled": true}},"$url": "…","$shortUrl": "…","status": "running","maxDelay": 0,"killOverTime": 30,"execInterval": 30,"auto": true,"code": "X3ERPV11","runtimes": [ …],…}

Usefull POST requests

The $key associated to a batch server identifies the instance. It replaces the word KEY in the following URLs.

Start the batch server identified by KEY

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers('KEY')/$service/start?representation=batchServer.$query

Stop the batch server identified by KEY

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers('KEY')/$service/stop?representation=batchServer.$query

Stop the batch server identified by KEY and all its running tasks

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers('KEY')/$service/stopAll?representation=batchServer.$query

2. Use a direct access to the batch server via its code name

This method is more direct. It has been developed for the Cloud and will work only in the latest version 11 and in version 12, because the resource status is only available in Cloud and V12.

It uses POST on the following APIs, with myserv:port being the server and service, and bcode being the code associated to the batch server.

Start the batch server identified by bcode

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers(codeeq"bcode")/$service/start

Stop the batch server identified by bcode

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers(codeeq"bcode")/$service/stop

Stop the batch server identified by bcode and all the running tasks

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers(codeeq"bcode")/$service/stopAll

Get the status for the batch server identified by bcode

http://myserv:port/api1/syracuse/collaboration/syracuse/batchServers(codeeq"bcode")/$service/status

The returned payload looks like this:

{"$uuid": "26739880-48a9-4e86-a8af-3aa1fa350c98",… additional global properties, followed by an array including all theerror/warning/info messages that have been sent since the batch serverstarted, from most recent to the last one, such as:"$diagnoses": [{"$severity": "error""$message": "2018-3-26 17:42:13: Cannot start the batch server"},{"$severity": "info","$message": "The batch controller X3ORAV1101 is running on host PO400126 (pid:15436) and can handle 7 queries."},{"$severity": "info","$message": "The server batch is running"}],…additional information about the batch server…}

3. Use the batch server dispatcher

In this case, the URL will be GET. With myserv:port being the server and service, and bcode being the code associated to the batch server.

It has been developed for the Cloud and will work only in the latest version 11 and in version 12, because the resource status is only available in Cloud and V12.

Start the batch server identified by bcode

http://myserv:port/batch/start?code=bcode

Stop the batch server identified by bcode

http://myserv:port/batch/stop?code=bcode

Stop the batch server identified by bcode and all the running tasks

http://myserv:port/batch/stopAll?code=bcode

Get the status for the batch server identified by bcode

http://myserv:port/batch/status?code=bcode

The payload will then only include a status array.

Note

In the examples above, you can replace http by https if necessary.