You are currently viewing Zend Server 5.x documentation. Click here to view the latest Zend Server online documentation.
You are here: Web API Reference Guide > Available API Methods > Configuration Management Methods > The configurationImport Method

The configurationImport Method

Import a saved configuration snapshot into the server.

 

 

Required Permissions: full

HTTP method: POST

Supported by Editions: All

Request Parameters: Because this method contains a file upload, parameters are encoded using the ‘multipart/form-data’ content type.

Parameter

 Type

Required

Description

configFile

File

Yes

The 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, Zend Server version or operating system). The default value is FALSE.

 

Expected Response Code: 200 OK

Response Type: serversList with information about affected servers (one server in Zend Server, all cluster members in Zend Server Cluster Manager)

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

500

importFailed

Importing the configuration snapshot failed.

409

systemMismatch

The system type, PHP version or Zend Server 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.

 

Usage Example

Example:

Request (some headers removed for clarity):

POST /ZendServerManager/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:

<?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse
  xmlns="http://www.zend.com/server/api/1.0">
    
  <requestData>
    <apiKeyName>angel.eyes</apiKeyName>
    <method>configurationImport</method>
  </requestData>
  
  <responseData>
    <serversList>
      <serverInfo>
        <id>12</id>
        <name>www-01</name>
        <address>https://www-01.local:10082/ZendServer</address>
        <status>pendingRestart</status>
        <messageList>
          <warning>This server is waiting a PHP restart</warning>
        </messageList>
      </serverInfo>
      <serverInfo>
        <id>15</id>
        <name>www-02</name>
        <address>https://www-02.local:10082/ZendServer</address>
        <status>pendingRestart</status>
        <messageList>
          <warning>This server is waiting a PHP restart</warning>
        </messageList>
      </serverInfo>
    </serversList>
  </responseData>
</zendServerAPIResponse>

 

Important Note:

For Zend Server or Zend Server Cluster Manager on Mac or Linux, this action is also available via the command line using CLI Tools. For more information see CLI Tools.

 

 

 

Related Links

Related Links:

Configuration Management Methods

 

 

 

© 1999-2013 Zend Technologies, Ltd. All rights reserved.