The clusterEnableServer Web API Method

This method is used to re-enable a cluster member. This process may be asynchronous if Session Clustering is used. If this is the case, the initial operation will return an HTTP 202 response. This action is idempotent, and running it on an enabled server will result in a 200 OK response with no consequences. On a Zend Server with no valid license this operation fails.

Version: 1.0

Required Permissions: full

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:

Parameter

 Type

Required

Description

serverId

String

Yes

The server ID

Expected Response Code:

  • 200 OK - The server was enabled successfully. This status appears if the server is not re-joining the cluster after performing a graceful shutdown and has no sessions to reclaim.
  • 202 Accepted - The process started but has not completed yet. You can check the server status within a few seconds using the clusterGetServerStatus method to verify that the operation is complete.

Response Type: serverInfo with the status of the server being enabled.  Status is expected to be either startingUp if the server is in the process of re-joining the cluster, or any other active status (OK, pendingRestart, misconfigured, extensionMismatch, daemonMismatch, notResponding) if the process was completed.

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

noSuchServer

There is no server with the provided server ID.

500

cantConnectToServer

Zend Server is unable to connect to the specified server.

500

invalidServerResponse

An invalid or unexpected response from the server.

503

temporarilyLocked

The server cannot be disabled because another server in the cluster is performing a graceful startup/shutdown.

405

notImplementedByEdition

The method is not implemented by this edition of Zend Server.

500

serverNotLicensed

Zend Server is not licensed.

Example

Usage Example

Request (headers removed for clarity)

POST /ZendServer/Api/clusterEnableServer

serverId=5

Response

HTTP/1.0 200 OK

<?xml version="1.0" encoding="UTF-8"?>

<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.0">

<requestData>

<apiKeyName>angel.eyes</apiKeyName>

<method>clusterEnableServer</method>

</requestData>

<responseData>

<serverInfo>

<id>5</id>

<name>www-02</name>

<address>www-02.local</address>

<status>pendingRestart</status>

<messageList />

<debugModeEnabled>true</debugModeEnabled>

</serverInfo>

</responseData>

</zendServerAPIResponse>

Important Note:

For Zend Serveron Linux, this action is also available via the command line using CLI Tools. For more information see CLI Tools.