The libraryVersionDeploy Web API Method

Deploy a new library version to the server or cluster. This process is asynchronous – the initial request will wait until the library is uploaded and verified, and the initial response will show information about the library being deployed – however the staging and activation process will proceed after the response is returned. The user is expected to continue checking the library version status using the libraryVersionGetStatus method until the deployment process is complete.

When the last library version from some library is removed the library itself is removed also.

Version: 1.5

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

libPackage

File

Yes

Library package file. Content type for the file must be library/vnd.zend.librarypackage’.

ignoreFailures

Boolean

No

Ignore failures during removing library versions if only some servers reported 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.

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

Response Type: libraryStatus

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

400

invalidParameter

A value provided for a parameter is invalid.

Example

Usage Example

Request

POST /ZendServer/Api/libraryVersionDeploy
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=”libPackage”;
filename=”myLibrary.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>libraryVersionDeploy</method>
	</requestData>
 
	<responseData>
		<libraryInfo>
			<libraryId>1</libraryId>
			<libraryName>Zend Framework</libraryName>
			<status>removing</status>
			<libraryVersions>
				<libraryVersion>
					<libraryVersionId>1</libraryVersionId>
					<version>1.12.1</version>
					<default>true</default>
					<status>staging</status>
					<installedLocation><![CDATA[/path/to/lib]]></installedLocation>
					<isDefinedLibrary>false</isDefinedLibrary>
					<creationTime>1970-01-01T02:00:00+02:00</creationTime>
					<lastUsed>1970-01-01T02:00:00+02:00</lastUsed>
					<servers>
						<libraryServer>
							<serverId>1</serverId>
							<status>OK</status>
						</libraryServer>
						<libraryServer>
							<serverId>4</serverId>
							<status>OK</status>
						</libraryServer>
						<libraryServer>
							<serverId>8</serverId>
							<status>OK</status>
						</libraryServer>
					</servers>
				</libraryVersion>
			<libraryVersions>
		<libraryInfo>
	</responseData>
</zendServerAPIResponse>