The configurationReset Web API Method

Import a saved configuration snapshot into the server.

Version: 1.3

Required Permissions:Full

HTTP method: POST

Supported by Editions: All

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

configFile

File

Yes

Configuration snapshot file to import. Content-type for the file must be ‘application/vnd.zend.serverconfig’

ignoreSystemMismatch

Boolean

No

If set to TRUE, configuration must be applied even if it was exported from a different system (other major PHP version, ZS version or operating system). Default is FALSE.

Expected Response Code: 200 OK. For more information see Response Format.

Response Format: serversList with information about affected servers

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

409

systemMismatch

The system type, PHP version or ZS version from which the configuration snapshot was exported does not match the current system. This error can be overridden if the ignoreSystemMismatch parameter is set to TRUE.

500

importFailed

Importing the configuration snapshot failed.

Example

Usage Example

Request (headers removed for clarity)

POST /ZendServer/Api/configurationImport
Content-type: multipart/form-data, boundary=--bla-bla-bla--
----bla-bla-bla--
Content-disposition: form-data; name=ignoreSystemMismatch
TRUE
----bla-bla-bla--
Content-disposition: form-data; name=”configFile”;
filename=”mySavedConfig.zcfg”
Content-type: application/vnd.zend.serverconfig
[...binary data follows...]
----bla-bla-bla----

Response (not all headers are shown)

<?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.0">
	<requestData>
		<apiKeyName>angel.eyes</apiKeyName>
		<method>configurationReset</method>
	</requestData>
	<responseData>
		<status>OK</status>
	</responseData>
</zendServerAPIResponse>
For Zend Server on Linux, this action is also available via the command line using CLI tools. For more information, see ZendServerSDK.