Let's say, we have a use case which is deployed in Integration Cloud and that involves number of applications.
There can be a PHP/Web application which user interact, ESB which provide integration with number of systems and DSS to manipulate database.
So let's say we want to start/stop these 3 applications as a group. But at the moment, Integration Cloud does not provide any grouping. So you have to login to the Integration Cloud and go to each and every application and start/stop those.
To make this little easier, we can use Integration Cloud REST API and write our own script.
This is the script to start the all applications as a group. You need to provide username, password, organization name and file which contains application list with versions
How to execute this script
./startProject.sh <username> <password> <orgnaizationName> wso2Project.txt
wso2Project.txt file content should be like this. There you should provide applicationName and version separated with [ | ] pipe character
As shown above you can keep number of project files and start using startProject.sh script.
There can be a PHP/Web application which user interact, ESB which provide integration with number of systems and DSS to manipulate database.
So let's say we want to start/stop these 3 applications as a group. But at the moment, Integration Cloud does not provide any grouping. So you have to login to the Integration Cloud and go to each and every application and start/stop those.
To make this little easier, we can use Integration Cloud REST API and write our own script.
This is the script to start the all applications as a group. You need to provide username, password, organization name and file which contains application list with versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=$1 | |
PASSWORD=$2 | |
TENANT=$3 | |
echo "----------------------------------------" | |
echo "login to integration cloud" | |
curl -c cookies -v -k -X POST -k https://integration.cloud.wso2.com/appmgt/site/blocks/user/login/ajax/login.jag -d 'action=login&userName='$USERNAME'@'$TENANT'&password='$PASSWORD | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
APPNAME=`echo $line | cut -d \| -f 1` | |
VERSION=`echo $line | cut -d \| -f 2` | |
echo "-----------------------------------------" | |
echo "Redeploying application : "$APPNAME" version : "$VERSION | |
curl -v -b cookies -X POST https://integration.cloud.wso2.com/appmgt/site/blocks/application/application.jag -d 'action=redeployApplication&applicationName='$APPNAME'&applicationRevision='$VERSION | |
done < "$4" | |
echo "DONE" |
./startProject.sh <username> <password> <orgnaizationName> wso2Project.txt
wso2Project.txt file content should be like this. There you should provide applicationName and version separated with [ | ] pipe character
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phpsample1|v1.0.0 | |
esbService|v2.0.0 | |
dssService|v3.1.0 |
Comments