The applicationUpdate Web API Method

This method allows you to update an existing application. The package you provide must contain the same application. Additionally, any new parameters or new values for existing parameters must be provided. This process is asynchronous, meaning the initial request will wait until the package is uploaded and verified, and the initial response will show information about the new version 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.

Version: 1.2

Required Permissions: Full

HTTP method: POST

Supported by Editions:Zend Server

Request Parameters:

Because this method contains a file upload, parameters must be encoded using the ‘multipart/form-data’ content type.

Parameter

 Type

Required

Description

appId

Integer

Yes

The application ID you would like to update.

appPackage

File

Yes

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

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 that are defined in the package.
Any required parameters that were not defined in a previous deployment of the same application will be required. Any parameters with already defined values are not required, but may be specified again if you would like to set a new value.

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

Response Type: applicationInfo

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

noSuchApplication

The provided application ID does not exist.

409

applicationConflict

The provided application package includes a different application, instead of a different version of the existing application.

400

missingParamater

A required parameter is missing.

400

invalidParameter

A value provided for a parameter is invalid.

Example

Usage Example

Request

POST /ZendServer/Api/applicationUpdate
Content-type: multipart/form-data, boundary=--bla-bla-bla--

----bla-bla-bla--
Content-disposition: form-data; name=appId

2
----bla-bla-bla--
Content-disposition: form-data; name=”appPackage”;
filename=”myApplication-v1.1.zpk”
Content-type: application/vnd.zend.applicationpackage

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

someValueForNewParam
----bla-bla-bla--
Content-disposition: form-data; name=userParams%5BOldParamRedone%5D

some new value for a parameter that was previously defined
----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>applicationUpdate</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.