Skip to main content

Create Application in WSO2 App Cloud via REST API

This blog post gives you some examples on how to use createApplication REST API correctly in WSO2 App Cloud https://docs.wso2.com/display/AppCloud/Published+APIs

Before invoke createApplication API, you need to login to the WSO2 App Cloud and get the session cookie.
curl -c cookies -v -k -X POST -k https://apps.cloud.wso2.com/appmgt/site/blocks/user/login/ajax/login.jag -d 'action=login&userName=amalka.wso2.com@<tenant>&password=<password>’

This are some basic example to create applications in WSO2 App Cloud.

Create application via upload from file system

curl -v -k -b cookies -X POST https://apps.cloud.wso2.com/appmgt/site/blocks/application/application.jag -F action=createApplication -F applicationName=SampleFile -F applicationDescription=desc -F runtime=1 -F appTypeName=war -F applicationRevision=1.0.0 -F uploadedFileName=sample.war -F runtimeProperties=[] -F tags=[]  -F fileupload=@/home/amalka/Downloads/sample.war -F isFileAttached=true -F conSpec=3 -F isNewVersion=false -F appCreationMethod=default

Create a version of the application created above

curl -v -k -b cookies -X POST https://apps.cloud.wso2.com/appmgt/site/blocks/application/application.jag -F action=createApplication -F applicationName=SampleFile -F applicationDescription=desc -F runtime=1 -F appTypeName=war -F applicationRevision=2.0.0 -F uploadedFileName=sample.war -F runtimeProperties=[] -F tags=[]  -F fileupload=@/home/amalka/Downloads/sample.war -F isFileAttached=true -F conSpec=3 -F isNewVersion=true -F appCreationMethod=default

Create application via upload from url

curl -v -k -b cookies -X POST https://apps.cloud.wso2.com/appmgt/site/blocks/application/application.jag -F action=createApplication -F applicationName=SampleURL -F applicationDescription=desc -F runtime=1 -F appTypeName=war -F applicationRevision=1.0.0 -F uploadedFileName=war_sample.war -F runtimeProperties=[] -F tags=[]  -F artifactUrl=https://github.com/wso2/app-cloud/raw/master/samples/artifacts/war_sample.war -F conSpec=3 -F isNewVersion=false -F appCreationMethod=url

Create application via clone GitHub repository

curl -v -k -b cookies -X POST https://apps.cloud.wso2.com/appmgt/site/blocks/application/application.jag -F action=createApplication -F applicationName=SampleGitHub -F applicationDescription=desc -F runtime=5 -F appTypeName=jaggery -F applicationRevision=1.0.0 -F runtimeProperties=[] -F tags=[]  -F conSpec=3 -F isNewVersion=false -F appCreationMethod=github -F gitRepoUrl=https://github.com/SabraO/DSSample.git -F gitRepoBranch=master -F projectRoot=/JaggerySample



action=createApplication
The action we are calling
applicationName=
Valid characters a-z A-Z 0-9 -
Space are not allowed
Numbers only names not allowed
Not case sensitive
applicationDescription=
Give a description for the application
appTypeName=
values [war, mss, php, jaggery, wso2dataservice]
runtime=
values [1, 2, 3, 4, 5, 6, 7]
applicationRevision=
format major.minor.patch
uploadedFileName=
Name of the file uploading
runtimeProperties=
Define runtime properties
[{"key":"enableAnalytics","value":"true"}]
tags=
Define tags
[{"key":"lifecycle","value":"development"}]
fileupload=
should starts with @
isFileAttached=
values [true, false]
conSpec=
values [1, 2, 3, 4, 5, 6, 7, 8]
isNewVersion=
values [true, false]
appCreationMethod=
values [default, url, github]
artifactUrl=
Specify url to download the artifact
gitRepoUrl=
Specify GitHub repository url
gitRepoBranch=
Specify GitHub repository branch
projectRoot=
Specify project root
applicationContext=
Specify application context.


Currently, WSO2 App Cloud supports number of app types, runtimes and container specifications. Following tables will help you to identify relevant runtimes, container specifications, supported app creation methods per app types.

Supported runtimes and app creation methods per app types


App type
Supported Runtime
Supported App creation method
1
war
1, 6
default, url
2
mss
2, 8
default, url
3
php
3
default, url, github
4
jaggery
5
default, url, github
5
wso2dataservice
7
default, url

Supported container specifications per runtimes


Runtimes
Supported Container specs
1
Apache Tomcat 8.0.28 / WSO2 Application Server 6.0.0-M1
3, 4
2
OpenJDK 8 + WSO2 MSF4J 1.0.0
2, 3, 4
3
Apache 2.4.10  
1, 2, 3
4
Carbon 4.2.0      

5
Jaggery 0.11.0
3, 4
6
Apache Tomcat 8.0.28 / WSO2 Application Server 6.0.0-M2
3, 4
7
WSO2 Data Services Server - 3.5.0
3, 4
8
OpenJDK 8 + WSO2 MSF4J 2.0.0
2, 3, 4

Container Specifications

Spec Id
Spec Name
CPU
Memory
1
128MB RAM and 0.1x vCPU
100
128
2
256MB RAM and 0.2x vCPU
200
256
3
512MB RAM and 0.3x vCPU
300
512
4
1024MB RAM and 0.5x vCPU
500
1024



Comments

Popular posts from this blog

How to generate random unique number in SOAP UI request

eg 1: ${=System.currentTimeMillis() + ((int)(Math.random()*10000))} eg 2: ${=java.util.UUID.randomUUID()} ${=java.util.UUID.randomUUID()} ${=System.currentTimeMillis() + ((int)(Math.random()*10000))} - See more at: http://tryitnw.blogspot.com/2014/03/generating-random-unique-number-in-soap.html#sthash.m2S4tUFu.dpuf ${=System.currentTimeMillis() + ((int)(Math.random()*10000))} - See more at: http://tryitnw.blogspot.com/2014/03/generating-random-unique-number-in-soap.html#sthash.m2S4tUFu.dpuf ${=System.currentTimeMillis() + ((int)(Math.random()*10000))} - See more at: http://tryitnw.blogspot.com/2014/03/generating-random-unique-number-in-soap.html#sthash.m2S4tUFu.dpuf

Tips on using environment variables in WSO2 Integration Cloud

Environment variables allow you to change an application's internal configuration without changing its source code. Let’s say you want to deploy the same application in development, testing  and production environments. Then database related configs and some other internal configurations may change from one environment to another. If we can define these configurations as an environment variables we can easily set those without changing the source code of that application. When you deploy your application in WSO2 Integration Cloud, it lets you define environment variables via the UI. Whenever you change the values of environment variables, you just need to redeploy the application for the changes to take effect. Predefined environment variables Key Concepts - Environment Variables   provides you some predefined set of environment variables which will be useful when deploying applications in WSO2 Integration Cloud. Sample on how to use environment variables U se

VFS access SFTP with special character password

Learn WSO2 ESB VFS Transport https://docs.wso2.com/display/ESB481/VFS+Transport When we need to access the FTP server using SFTP, VFS connection-specific URL need to be given as : <parameter name="transport.vfs.FileURI">vfs:sftp://username:p@ssword@ftp.server.com/filePath?vfs.passive=true</parameter> When the password contains a special characters (eg: p@ssword), it gives the following error. 2015-03-27 13:06:03,766  [-]   [PassThroughMessageProcessor-5]  ERROR VFSTransportSender cannot resolve replyFile org.apache.commons.vfs2.FileSystemException: Invalid absolute URI "sftp://username:***@ftp.server.com/filePath?vfs.passive=true". Solution 1: Replace the special characters with the respective hex representation. <parameter name="transport.vfs.FileURI">vfs:sftp://username:p%40ssword@ftp.server.com/filePath?vfs.passive=true</parameter> Char Hex Code ------- -------- [space] %20 &