Interrupting a REST application
This describes the web service to interrupt an instance of a REST application running on Aculab Cloud.
It references the following web service:-
Rest Interrupt
This will interrupt one or more REST application instances that are running on Aculab Cloud. The current action will be stopped and any further actions in the current list will be skipped.
Authorisation
This API uses basic authentication, using your cloud account username and API Access Key.
Username : cloudID/username (e.g. 1-2-0/ bob@ example.com) Password : API Access key Request:
Url : https://ws.aculabcloud.net/ rest_interrupt Methods : GET, POST
Parameter Value Description application_instance_ids string a list of application instance IDs of the REST applications to interrupt, delimited by the character /. redirect_page string (optional) the page to which to send the result of the interrupt. redirect_method string (optional) the method (GET, POST) to use when accessing redirect_page The Redirect Page Request:
If redirect_page is defined it will receive a JSON object containing the result of the interrupt command. The JSON object will be the standard REST instance_info object which will include an action_result containing the result of the interrupt and, if available, the action that was interrupted. The redirect page can continue the application by returning a new action list to the application instance.
Note that if a redirect_page is not specified, the REST application's final page will be called and the application will end.
Returns:
A JSON object containing one or more JSON objects keyed on application instance Id. Each result object contains a string specifying the result of that interrupt. If the interrupt succeeds the action that was interrupted may also be supplied.
Parameter Availability Description result Always A string indicating the result of the interrupt.
Either:
interrupted - the application instance was interrupted successfully.
no such application - an application with the given instance ID does not exist. It may have completed some time ago.
application already completed - no action was interrupted because the application has recently completed.
failed - the interrupted failed for any other reason.
action Always A string indicating the action that was interrupted. May be empty depending on the result.
Examples:
https://ws.aculabcloud.net/
rest_interrupt? application_instance_ids= 06e122c3364cc74c.787379& redirect_page= my_interrupt_page& redirect_method=POST Response:
{ "06e122c3364cc74c.787379" : { "result" : "interrupted", "action" : "play" } }
https://ws.aculabcloud.net/
rest_interrupt? application_instance_ids= 06e122c3364cc74c.787945/ 06e122c3364cc74c.788624& redirect_page= my_interrupt_page Response:
{ "06e122c3364cc74c.787945" : { "result" : "interrupted", "action" : "record" }, "06e122c3364cc74c.788624" : { "result" : "application already completed", "action" : "" } }