Upload And Deploy An Application

post

/management/weblogic/{version}/edit/appDeployments

Upload an application from the client to the server and then deploy it.

This method supports both asynchronous and best effort synchronous invocations. The behavior is controlled by the 'Prefer' header.

Request

Supported Media Types
Path Parameters
Header Parameters
  • The 'Prefer' header parameter can be used to specify the preference on how this method runs. A value of 'respond-async' specifies a preference to submit the request and return immediately without waiting for completion. Alternatively a value of 'wait=#seconds' specifies a preference to wait for #seconds for method completion before returning. If the Prefer header is not specified or invalid, then a 300 second wait will be used.
  • The 'X-Requested-By' header is used to protect against Cross-Site Request Forgery (CSRF) attacks. The value is an arbitrary name such as 'MyClient'.
Form Parameters
  • Contains the rest of the deployment information.

    This string parameter must contain a JSON object matching the following schema:

    {
        "type": "object",
        "properties": {
            "archiveVersion": {
                "type": "string",
                "description": "The archive version (optional)."
            },
            "name": {
                "type": "string",
                "description": "The user-specified name of this deployment.This name is included as one of the key properties in the MBean's javax.management.ObjectNameName=user-specified-name"
            },
            "planVersion": {
                "type": "string",
                "description": "The deployment plan's version (optional)."
            },
            "targets": {
                "title": "Target References",
                "type": "array",
                "items": {
                    "title": "Target Reference",
                    "type": "object",
                    "properties": {
                        "identity": {
                            "title": "Identity",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "description": ""
                            },
                            "description": "DOC TEAM TBD - describe an identity - it's a reference to another WLS REST resource."
                        }
                    },
                    "description": "Contains the target reference."
                },
                "description": "Contains the array of target references. The clusters and/or servers on which this application will be deployed.The deployment will only occur once if the targets overlap."
            }
        },
        "required": [
            "name"
        ]
    }
  • The deployment plan to upload (optional).

  • The application to upload.

Security
Back to Top

Response

201 Response

Back to Top

Examples

Synchronously create a new app deployment.

This example uses the POST method to synchronously create a new app deployment in this collection.

Example Request
curl -v \
--user admin:admin123 \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
  name: 'myapp',
  targets: [ { identity: [ 'servers', 'AdminServer' ] } ]
}" \
-F "sourcePath=@/deployments/MyApp/app/MyApp.ear" \
-X POST http://localhost:7001/management/weblogic/latest/edit/appDeployments?links=job,abort&fields=completed,progress,error,state,operationType,applicationName
Example Response
HTTP/1.1 100 Continue HTTP/1.1 201 Created

Location: http://localhost:7001/management/weblogic/latest/edit/appDeployments/myapp

Response Body:
{
    "links": [{
        "rel": "job",
        "href": "http:\//localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp"
    }],
    "operationType": 3,
    "state": "STATE_COMPLETED",
    "applicationName": "myapp",
    "progress": "success",
    "completed": true
}

Asynchronously create a new app deployment.

This example uses the POST method to asynchronously create a new app deployment in this collection.

Example Request
curl -v \
--user admin:admin123 \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
  name: 'myapp',
  targets: [ { identity: [ 'servers', 'AdminServer' ] } ]
}" \
-F "sourcePath=@/deployments/MyApp/app/MyApp.ear" \
-H "Prefer:respond-async" \
-X POST http://localhost:7001/management/weblogic/latest/edit/appDeployments?links=job,abort&fields=completed,progress,error,state,operationType,applicationName
Example Response
HTTP/1.1 100 Continue HTTP/1.1 202 Accepted

Location: http://localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp

Response Body:
{
    "links": [{
        "rel": "job",
        "href": "http:\//localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp"
    }],
    "operationType": 3,
    "state": "STATE_RUNNING",
    "applicationName": "myapp",
    "progress": "processing",
    "completed": false
}
Back to Top