The applicationDeploy Web API Method

Deploy a new application to the server or cluster. This process is asynchronous, meaning the initial request will wait until the application is uploaded and verified, and  the initial response will show information about the application being deployed. However, the staging and activation process will proceed after the response is returned. You must continue checking the application status using the applicationGetStatus method until the deployment process is complete.

This action implicitly restarts your Web server as part of the deployment process.

Version: 1.2

Required Permissions: Full

HTTP method: POST

Supported by Editions:Zend Server

Request Parameters:

Because this method is expected to contain a file upload, parameters are expected to be encoded using the ‘multipart/form-data’ content type.

Parameter

 Type

Required

Description

appPackage

File

Yes

The application package file. The content type for the file must be ‘application/vnd.zend.applicationpackage’.

baseUrl

String

Yes

The base URL to which the application will be deployed. This must be an HTTP URL.

createVhost

Boolean

No

Deprecated in 1.6

Create a virtual host based on the base URL (if the virtual host wasn't already created by Zend Server).

You may only create a simple virtual host using this parameter, not an SSL virtual host.

The default value is FALSE.

defaultServer

Boolean

No

Deploy the application on the default server. The provided base URL will be ignored and replaced with '<default-server>'.  

If this parameter and createVhost are both used, createVhost will be ignored.

The default value is FALSE.

userAppName

String

No

Free text for a user defined application identifier. If not specified, the baseUrl parameter will be used.

ignoreFailures

Boolean

No

Ignore failures during staging if only some servers report failures. If all servers report failures the operation will fail in any case.
The default value is FALSE, meaning any failure will return an error.

userParams

Hashmap

No

Set values for user parameters defined in the package. Depending on package definitions, this parameter may be required.
Each user parameter defined in the package must be provided as a key for this parameter.

Expected Response Code: 202 Accepted - For more information see Response Format.

Response Type: applicationInfo

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

409

baseUrlConflict

The provided base URL is already in use.

400

missingParameter

A required parameter is missing.

400

invalidParameter

A value provided for a parameter is invalid.

400

missingVirtualHost

The virtual host in the base URL does not exist. Use the createVhost parameter to create it.

Example

Usage Example

Request

POST /ZendServer/Api/applicationDeploy
Content-type: multipart/form-data, boundary=--bla-bla-bla--
----bla-bla-bla--
Content-disposition: form-data; name=baseUrl

http://example.com/
----bla-bla-bla--
Content-disposition: form-data; name=”appPackage”;
filename=”myApplication.zpk”
Content-type: application/vnd.zend.applicationpackage

[...binary data follows...]
----bla-bla-bla--
Content-disposition: form-data; name=userParams%5Bdbhost%5D

database.example.lan
----bla-bla-bla--
Content-disposition: form-data; name=userParams%5Bdbname%5D

database_schema
----bla-bla-bla----

Response

?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.3">
	<requestData>
		<apiKeyName>angel.eyes</apiKeyName>
		<method>applicationDeploy</method>
	</requestData>
	<responseData>
		<applicationInfo>
			<id>2</id>
			<baseUrl>http://oapp.example.com:8080/</baseUrl>
			<appName>Blog 2.0</appName>
			<userAppName>Wolfgang's Blog</userAppName>
			<installedLocation>/usr/local/somewhere</installedLocation>
			<status>staging</status>
			<servers>
				<applicationServer>
					<id>1</id>
					<deployedVersion>1.6</deployedVersion>
					<status>staging</status>
				</applicationServer>
				<applicationServer>
					<id>4</id>
					<deployedVersion>1.6</deployedVersion>
					<status>staging</status>
				</applicationServer>
				<applicationServer>
					<id>8</id>
					<deployedVersion>1.6</deployedVersion>
					<status>staging</status>
				</applicationServer>
			</servers>
			<deployedVersions>
				<deployedVersion>1.6</deployedVersion>
				<deployedVersion>1.5</deployedVersion>
			</deployedVersions>
		<messageList />
			<creationTime>1970-01-01T02:00:00+02:00</creationTime>
			<lastUsed>1970-01-01T02:00:00+02:00</lastUsed>
		</applicationInfo>
	</responseData>
</zendServerAPIResponse>
For Zend Server on Linux, this action is also available via the command line using CLI tools. For more information, see ZendServerSDK.