Upload And Deploy An Application
/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
- multipart/form-data
-
version(required): string
The version of the WebLogic REST interface.
-
Prefer: string
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.
-
X-Requested-By(required): string
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'.
-
model(required): string
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)." }, "bundle": { "type": "object", "title": "Application Bundle", "properties": { "altDescriptorPath": { "x-weblogic-legalNull": true, "type": "string", "description": "Optional relative path to the selected alternate standard application descriptor. Omit or use JSON null for none.Constraints
legal null" }, "altWlsDescriptorPath": { "x-weblogic-legalNull": true, "type": "string", "description": "Optional relative path to an alternate weblogic-application.xml for an EAR application (archived or exploded). This selector is not supported for standalone modules, including WAR applications; use a deployment plan for their external WebLogic descriptors. Omit or use JSON null for none.Constraints
legal null" }, "applicationPath": { "type": "string", "description": "Required relative path selecting exactly one application. Arbitrary version-directory depth is allowed. Preserve the original application basename, for example v2/app/orders.war. Directory names do not specify deployment versions.For exploded bundles, a single dot selects the ZIP root; that root must contain recognizable application descriptors. Otherwise select a named application directory, including its original suffix where applicable." }, "layout": { "type": "string", "description": "Required: exploded or installation. exploded selects an application directory; installation selects an archive or directory from an installation tree." }, "planPath": { "x-weblogic-legalNull": true, "type": "string", "description": "Required: the relative path to the selected deployment plan file, or JSON null to explicitly deploy without a plan. No plan or version is selected automatically. Multiple plans may coexist in the bundle.Keep external descriptors and AppFileOverrides with the selected plan. The supplied plan and its config-root are not rewritten.Constraints
legal null" } }, "required": [ "applicationPath", "layout", "planPath" ], "description": "Explicit selectors for a sourceBundle upload. Required with sourceBundle; not used with sourcePath." }, "legacyEmptyBeansXmlDiscovery": { "type": "boolean", "description": "Controls discovery for qualifying empty beans.xml descriptors.true enables legacy discovery of all beans; false uses Jakarta CDI annotated discovery. If omitted, the deployment retains the unset or inherited default." }, "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)." }, "stageMode": { "type": "string", "description": "Optional for sourceBundle only: stage, nostage, or external_stage. If omitted, use the normal deployment staging default. With external_stage, the caller must prepare the application and plan resources in each target server's staging directory." }, "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." }, "validatePersistenceXmlSchema": { "type": "boolean", "description": "Controls XML Schema validation for META-INF/persistence.xmltrue validates the descriptor against its Jakarta Persistence schema; false skips only XSD validation. If omitted, the deployment retains the unset or inherited default of true" } }, "required": [ "name" ] } -
planPath: file
The deployment plan to upload (optional).
-
sourceBundle: file
A ZIP transport bundle containing an exploded application or an Application Installation Directory. Requires model.bundle and cannot be combined with sourcePath or a separate planPath part.
The server extracts only the outer ZIP into a new request-owned directory under the configured upload directory, using normal filesystem permissions and inherited access controls as with weblogic.Deployer uploads. It preserves selected application basenames, directories, embedded archives, and supplied plan bytes. Paths in model.bundle are relative to the ZIP root, not to the client or server filesystem. Use forward slashes on every platform; absolute paths, backslashes, and parent-directory segments are not accepted.
Invalid bundle requests are rejected with HTTP 400; resource-limit violations use HTTP 413. Symbolic links, encrypted entries, unsafe paths, duplicate entries, and conflicting file/directory entries are not supported.
-
sourcePath: file
The application archive to upload. Specify exactly one of sourcePath and sourceBundle. sourcePath retains archive-upload behavior; its contents are not extracted as a directory bundle.
-
Admin: basic
Type:
basicDescription:A user in the Admin security role. -
Deployer: basic
Type:
basicDescription:A user in the Deployer security role.
Response
201 Response
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 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 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