You can deploy an application using the CLI tool, REST API or the Private PaaS console (UI) PPaaS Console as shown below:
Localtabgroup |
---|
Localtab |
---|
| Deploying an application via the CLIOverviewCLI command | deploy-application | Description | Deploy 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 definitionShort option | Long option | Description | Required | Example value |
---|
-a | --application-id
| Unique ID of the application | Yes | wso2am-190-application | -ap
| --application-policy-id
| Unique ID of the application policy. | Yes | application-policy-1 |
ExampleDeploy 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 |
---|
| Deploying an application via the REST APIOverviewDescription | Deploy an application. | Resource Path | /applications/{applicationId}/deploy/{applicationPolicyId} | HTTP Method | POST | Request/Response Format | application/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.
|
|
ExampleDeploy 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. |
|
|
...