The clusterGetServerStatus Web API Method

Use this method to get the list of servers in the cluster and the status of each one. On a Zend Server with no valid license, this operation fails. This operation causes Zend Server to check the status of servers and return fresh, non-cached information. This is different from the Manage Servers tab in the GUI, which may present cached information. Users interested in reducing load by caching this information should do it in their own code.

Version: 1.0

Required Permissions: read

HTTP method: GET

Supported by Editions: Zend Server

Request Parameters:

Parameter

 Type

Required

Description

servers

Array

No

A list of server IDs. If specified, the status is returned for these servers only. If not specified, the status of all the servers is returned.

tasks

Array

No

List of tasks to be checked.

order

String

No

Field by which to sort the list. If not specified, it is sorted by the "NODE_NAME" field.

direction

String

No

Sorting direction. If not specified, it is ascending (ASC).

Expected Response Code: 200 OK

Response Type: serversList

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

 noSuchServer

One or more of the provided server IDs does not exist in the cluster.

405

notImplementedByEdition

This method is only available on Zend Server Professional and Enterprise editions.

500

serverNotLicensed

Zend Server is not licensed.

Example

Usage Example

Request (URI broken for readability)

GET /ZendServer/Api/clusterGetServerStatus?

servers%5B0%5D=12&servers%5B1%5D=15

Response

<?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.0">
<requestData>
<apiKeyName>angel.eyes</apiKeyName>
<method>clusterGetServersStatus</method>
</requestData>
<responseData>
 <serversList>
      <serverInfo>
        <id>12</id>
        <name>www-01</name>
        <address>https://www-01.local:10082/ZendServer</address>
        <status>OK</status>

<debugModeEnabled>true</debugModeEnabled>
        <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>

<debugModeEnabled>true</debugModeEnabled>
      </serverInfo>
   </serversList>
</responseData>
</zendServerAPIResponse>

 

Important Note:

For Zend Server on Linux, this action is also available via the command line using CLI tools. For more information, see ZendServerSDK.