This resource manages the applications that are deployed in this WLS domain.
The resource supports the following methods:
The GET method on this resource returns a listing of all the applications in this WLS domain.
This method supports optional query parameters which can be used to constrain the fields included in the response. Constraining the fields to only the information that you require may yield faster response times when interacting with large data sets.
(optional) Specifies that these values are not required and may be omitted in a response.
(optional) Specifies that these values are required and must be included in the response.
Include and exclude are mutually exclusive, and if neither is specified all available information is included.
The response body returned includes a collection of Application entities. It also contains links to their corresponding resources.
This method can return the following links:
uri=/management/wls/{version}/deployments rel=parent
uri=/management/wls/{version}/deployments/application/id/{application-name} rel=items.name title=name
This method returns one of the Standard HTTP Status Codes.
This example uses the GET method to list all the applications in this WLS domain.
Example Request
curl -v \ --user username:password \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -X GET http://localhost:7001/management/wls/latest/deployments/application
Example Response
HTTP/1.1 200 OK Response Body: { "links": [ { "rel": "parent", "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/deployments" }, { "rel": "items.name", "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/deployments\/application\/id\/fairShare", "title": "fairShare" } ], "items": [{ "name": "fairShare", "state": "active", "type": "application", "targets": [ "myserver", "Cluster-0" ], "servlets": [ { "servletName": "SimpleSlowServlet", "contextPath": "\/fairShare", "aggregateMetrics": { "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 }, "servletMetrics": [ { "serverName": "myserver", "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 } ] }, { "servletName": "SimpleFastServlet", "contextPath": "\/fairShare", "aggregateMetrics": { "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 }, "servletMetrics": [ { "serverName": "myserver", "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 } ] }, { "servletName": "JspServlet", "contextPath": "\/fairShare", "aggregateMetrics": { "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 }, "servletMetrics": [ { "serverName": "myserver", "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 } ] }, { "servletName": "FileServlet", "contextPath": "\/fairShare", "aggregateMetrics": { "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 }, "servletMetrics": [ { "serverName": "myserver", "executionTimeTotal": 0, "invocationTotalCount": 0, "reloadTotalCount": 0, "executionTimeHigh": 0, "executionTimeLow": 0 } ] } ], "displayName": "fairShare", "urls": [ "http:\/\/localhost:7001\/fairShare" ], "planPath": null, "applicationType": "war", "openSessionsCurrentCount": 0, "sessionsOpenedTotalCount": 0, "health": {"state": "ok"}, "deploymentPath": "\/deployments\/fairShare.war", "ejbs": [] }] }
The OPTIONS method on this resource returns a template entity that has been pre-populated with default values.
If you want to deploy an application, call this method to get the template, fill in values, such as the path to the application, then use it in the POST method to deploy the application.
The response body returned includes an Application template entity that can be customized and then used to deploy the application.
This method returns one of the Standard HTTP Status Codes.
The resource supports the following methods:
This POST method deploys a new application when the files you want to deploy are already on the Administration Server file system.
This resource launches a job to deploy the application.
(Optional) Specifies whether this method runs in detached (background) mode or synchronously.
If the __detached=true query parameter is specified (detached invocation), then this method returns immediately after launching the job. Otherwise, it waits for the job to complete, fail, or timeout (synchronous invocation).
The request body must include a fully populated Application entity that describes the new application. Read only parameter values are ignored.
If the method was invoked synchronously and successfully launched the job, the response body includes a DeploymentJob entity containing the state of the job (completed, failed, or still running in the case of a timeout) as well as a link to the job resource.
This method can return the following links:
uri=/wls/jobs/deployment/{job-id} rel=job title=id
If the method was invoked synchronously and the job successfully completed, the method returns a 201 Created status code and a Location header with a link to the new application resource. If the job timed out, the method returns a 202 Accepted status code and a Location header with a link to the expected new application resource.
If the method was invoked detached and successfully launched the job, the method returns a 202 Accepted status code, a link to the job resource, and a Location header with a link to the expected new application resource. In this case, the response does not include a DeploymentJob entity.
This example uses the POST method to deploy a new application.
Example Request
curl -v \ --user username:password \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -H Content-Type:application/json \ -d "{ name: 'BasicApp', deploymentPath: '/deployments/BasicApp/app/BasicApp.ear', targets: [ 'myserver' ] }" \ -X POST http://localhost:7001/management/wls/latest/deployments/application
Example Response
HTTP/1.1 201 Created Location: http://localhost:7001/management/wls/latest/deployments/application/id/BasicApp Response Body: { "messages": [{ "message": "Deployed the application 'BasicApp'.", "severity": "SUCCESS" }], "links": [{ "rel": "job", "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/0" }], "item": { "operation": "deploy", "status": "completed", "beginTime": 1390587114114, "endTime": 1390587115796, "name": "ADTR-0", "id": "0", "type": "deployment", "targets": [{ "errors": [], "status": "completed", "name": "myserver", "type": "server" }], "deploymentName": "BasicApp", "description": "[Deployer:149026]deploy application BasicApp on myserver." } }
This example uses the POST method to deploy a new application asynchronously.
Example Request
curl -v \ --user username:password \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -H Content-Type:application/json \ -d "{ name: 'fairShare', deploymentPath: '/deployments/fairShare.war' }" \ -X POST http://localhost:7001/management/wls/latest/deployments/application?__detached=true
Example Response
HTTP/1.1 202 Accepted Location: http://localhost:7001/management/wls/latest/deployments/application/id/fairShare Response Body: { "messages": [{ "message": "Deploying the application 'fairShare'.", "severity": "SUCCESS" }], "links": [{ "rel": "job", "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/31" }] }
This POST method deploys a new application when the files you want to deploy are not on the Administration Server file system. It uploads the files to deploy from the client's file system to the Administration Server file system and then deploys them.
Note: When using a multi-part form to create, you need to:
Specify the file to deploy via the deployment
form element.
Specify the plan to deploy via the plan
form element.
Send in the rest of the template via the model
form element.
This resource launches a job to upload and deploy the application.
(Optional) Specifies whether this method runs in detached (background) mode or synchronously.
If the __detached=true query parameter is specified (detached invocation), then this method returns immediately after launching the job. Otherwise, it waits for the job to complete, fail, or timeout (synchronous invocation).
The request body includes form data with a Content-Type header of multipart/form-data and the following form fields:
(Required) Specifies all the necessary information about the application to deploy except for the deployment archive and its corresponding deployment plan. The Content-Disposition header must have its name parameter set to model
. The Content-Type header must be application/json
and the content must be a JSON object containing an Application entity, excluding the deployment
and plan
fields.
(Required) Specifies the deployment archive to be uploaded. The Content-Disposition header must have its name parameter set to deployment
and must have a filename parameter set to the file name you want the uploaded deployment archive to have on the server. The Content-Type header must be application/octet-stream
and the content must be the deployment archive data.
(Optional) Specifies the deployment plan to be uploaded. The Content-Disposition header must have its name parameter set to plan
and must have a filename parameter set to the file name you want the uploaded deployment plan to have on the server. The Content-Type header must be application/octet-stream
and the content must be the deployment plan data.
If the method was invoked synchronously and successfully launched the job, the response body includes a DeploymentJob entity containing the state of the job (completed, failed, or still running in the case of a timeout) as well as a link to the job resource.
This method can return the following links:
uri=/wls/jobs/deployment/{job-id} rel=job title=id
If the method was invoked synchronously and the job successfully completed, the method returns a 201 Created status code and a Location header with a link to the new library resource. If the job timed out, the method returns a 202 Accepted status code and a Location header with a link to the expected new library resource.
If the method was invoked detached and successfully launched the job, the method returns a 202 Accepted status code, a link to the job resource, and a Location header with a link to the expected new library resource. In this case, the response does not include a DeploymentJob entity.
This example uses the POST method to upload a deployment archive and deploy it as a new application.
Example Request
curl -v \ --user username:password \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -H Content-Type:multipart/form-data \ -F "model={ name: 'myapp', targets: [ 'myserver', 'Cluster-0' ] }" \ -F "deployment=@/deployments/MyApp/app/MyApp.ear" \ -X POST http://localhost:7001/management/wls/latest/deployments/application
Example Response
HTTP/1.1 100 Continue HTTP/1.1 201 Created Location: http://localhost:7001/management/wls/latest/deployments/application/id/myapp Response Body: { "messages": [{ "message": "Deployed the application 'myapp'.", "severity": "SUCCESS" }], "links": [{ "rel": "job", "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/27" }], "item": { "operation": "deploy", "status": "completed", "beginTime": 1390587191114, "endTime": 1390587192047, "name": "ADTR-27", "id": "27", "type": "deployment", "targets": [ { "errors": [], "status": "completed", "name": "Cluster-0", "type": "cluster" }, { "errors": [], "status": "completed", "name": "myserver", "type": "server" } ], "deploymentName": "myapp", "description": "[Deployer:149026]deploy application myapp on Cluster-0,myserver." } }