Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can deploy an application using the CLI tool, REST API or the Private PaaS console (UI) PPaaS Console as shown below:

 

Localtabgroup
Localtab
activetrue
titleCLI

Deploying an application via the CLI

Overview
CLI commanddeploy-application
DescriptionDeploy an application.
Command format
Code Block
deploy-application -a <APPLICATION_ID> -ap <APPLICATION_POLICY_ID>
  • The ID of the application in the application JSON file added previously needs to be defined as the <APPLICATION_ID> value.
  • The ID of the application policy in the application policy JSON file added previously needs to be defined as the <APPLICATION_POLICY_ID> value.
Parameter definition
Short optionLong optionDescriptionRequiredExample value
-a

--application-id

Unique ID of the applicationYes

wso2am-190-application

-ap

--application-policy-id

Unique ID of the application policy.Yes

application-policy-1

Example

Deploy an application with the application ID: wso2am-190-application.

Code Block
deploy-application -a wso2am-190-application -ap application-policy-1
Sample output
Code Block
Application deployed successfully: [application] wso2am-190-application
Localtab
titleREST API

Deploying an application via the REST API

Overview
DescriptionDeploy an application.
Resource Path/applications/{applicationId}/deploy/{applicationPolicyId}
HTTP MethodPOST
Request/Response Formatapplication/json
Command format
Code Block
curl -X POST -H "Content-Type: application/json" -k -v -u <USERNAME>:<PASSWORD> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>//api/applications/{applicationId}/deploy/{applicationPolicyId}
Info
  • By default, <USERNAME>:<PASSWORD> is admin:admin.
  • By default, <PRIVATE_PAAS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
  • By default, <PRIVATE_PAAS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.
  • The ID of the application in the application JSON file added previously needs to be defined as the {applicationId} value.
  • The ID of the application policy in the application policy JSON file added previously needs to be defined as the  {applicationPolicyId} value.
Example

Deploy an application with the application ID: wso2am-190-application.

Code Block
cd <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples
curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/applications/wso2am-190-application/deploy/application-policy-1
Sample output
Code Block
> POST /api/applications/wso2am-190-application/deploy/application-policy-1 HTTP/1.1
> Host: localhost:9443
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> 
< HTTP/1.1 202 Accepted
< Date: Mon, 12 Oct 2015 06:05:01 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: WSO2 Carbon Server
< 
{"status":"success","message":"Application deployed successfully: [application] wso2am-190-application"}

You will come across the following HTTP status codes while deploying an application:

HTTP status code

202, 400, 409, 500

See the descriptions of the HTTP status codes here.

Localtab
titlePrivate PaaS consolePPaaS Console

Deploying an application via the

Private PaaS console

PPaaS Console

Follow the instructions below to deploy an application:

  1. Click Applications on the home page.
    Image Added
  2. Hover your mouse pointer over the application that you wish to deploy for the Deploy button to appear and click Deploy.
    Image Added
  3. Select the application policy from the Select Policy drop-down menu.
    Image Added 
  4. Click Deploy Application.

 

...