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) 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
 

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 console

Deploying an application via the Private PaaS console

 

...