WebAPI Reference Guide > Available API Methods > Server and Cluster Management Methods > The clusterGetServerStatus Method

The clusterGetServerStatus 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 Servers List 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.

force

String

No

'true','false' - default

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


        <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 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:

Server and Cluster Management Methods

 

 

 

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