Versions Compared

Key

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

...

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"}Shavindris-MacBook-Air:samples shavindridissanayake$ 

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

...