Interrupt REST Application Sample¶
A command line console application to interrupt one or more REST application instances that are currently running on Aculab cloud via the Aculab Cloud Web Services API.
Usage¶
python interrupt_rest_application.py [--wsserver <cloudWebServerAddress>] <cloudId> <username> <apiAccessKey> <applicationInstanceId>|<applicationInstanceIdsFileName> [<redirectPage> [<redirectMethod>]]
Arguments¶
cloudWebServerAddress
The address of the cloud web server. By default the wrappers call web services on
https://ws-<cloudId>.aculabcloud.net
. In certain circumstances you may need to use a different address which you can set here.
cloudId
Cloud region id (e.g. 1-2-0)
username
Cloud account username
apiAccessKey
Cloud API Access key
applicationInstanceId
The unique id relating to a single REST Application instance.
applicationInstanceIdsFileName
The name of a file containing 1 or more REST application instance ids, comma separated.
redirectPage
An optional page to which the application will be redirected by the interrupt. If no redirectPage is specified then following the interrupt the REST application will call the final page and end.
redirectMethod
The method used to access the redirectPage, GET or POST. Default is GET.
Note
For users running Python 2 under Windows, this tool does not support command line arguments containing non-ASCII characters. If you wish to specify command line arguments containing non-ASCII characters, please use Python 3.
Examples¶
Interrupt an application
python interrupt_rest_application.py 1-2-0 bob@acompany.com bobspswd 040880760a891abc.797
This interrupts the application instance 040880760a891abc.797 on cloud 1-2-0 on account bob@acompany.com.
Interrupt multiple applications
python interrupt_rest_application.py 1-2-0 bob@acompany.com bobspswd appInstances.csv
This interrupts the three specified REST application instances on cloud 1-2-0 on account bob@acompany.com.
Note
The "appInstances.csv" file contains 3, comma-separated application instance IDs: 040880760a891abc.797,040880761b891bcd.798,040880762c891cde.799
Interrupt an application specifying a redirect page
python interrupt_rest_application.py 1-2-0 bob@acompany.com bobspswd 040880760a891abc.797 http://rest.acompany.com/AppInterruptHandler.aspx
This interrupts the application instance 040880760a891abc.797 on cloud 1-2-0 on account bob@acompany.com. The application will be redirected to the specified page following the interrupt.