Server and Cluster Management Methods

The following is a list of the available methods used to manage your server and/or cluster:

  • getSystemInfo
  • clusterGetServerStatus
  • clusterAddServer
  • clusterRemoveServer
  • clusterDisableServer
  • clusterEnableServer
  • clusterReconfigureServer
  • restartPHP
license New BSD License
link for the canonical source repository
author Ingo Walz
category Zend
package Zend_Service
subpackage ZendServerAPI

 Methods

Base constructor for all API-method implementations

__construct(string $name) 
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::__construct()

Parameters

$name

string

Name of the config

Check if connection is possible or not

canConnect() : bool
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::canConnect()

Returns

bool

<b>The clusterAddServer Method</b>

clusterAddServer(string $serverName, string $serverUrl, string $guiPassword, boolean $propagateSettings) : \ZendService\ZendServerAPI\DataTypes\ServerInfo
Add a new server to the cluster. On a Zend Server Cluster Manager
with no valid license, this operation fails.

Parameters

$serverName

string

The server name.

$serverUrl

string

The server address as a full HTTP/HTTPS URL.

$guiPassword

string

The server GUI password.

$propagateSettings

boolean

Propagate this server’s current settings to the rest of the cluster. The default value is "FALSE".

Returns

<b>The clusterDisableServer Method</b>

clusterDisableServer(int $serverId) : \ZendService\ZendServerAPI\DataTypes\ServerInfo
This method disables a cluster member. This process may be asynchronous
if Session Clustering is used. If this is the case, the initial operation
returns an HTTP 202 response. As long as the server is not fully disabled,
further calls to this method are idempotent. On a Zend Server Cluster Manager
with no valid license, this operation fails.

Parameters

$serverId

int

The server ID

Returns

<b>The clusterEnableServer Method</b>

clusterEnableServer(int $serverId) : \ZendService\ZendServerAPI\DataTypes\ServerInfo
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 Cluster Manager with no valid license
this operation fails.

Parameters

$serverId

int

The server ID

Returns

<b>The clusterGetServerStatus Method</b>

clusterGetServerStatus(array $parameters) : \ZendService\ZendServerAPI\DataTypes\ServersList
Use this method to get the list of servers in the cluster and the status of each one.
On a Zend Server Cluster Manager with no valid license, this operation fails.
This operation causes Zend Server Cluster Manager 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.

Parameters

$parameters

array

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.

Returns

<b>The clusterReconfigureServer Method</b>

clusterReconfigureServer(int $serverId, boolean $doRestart) : \ZendService\ZendServerAPI\DataTypes\ServerInfo
Re-configure a cluster member to match the cluster's profile.
This operation will fail on a Zend Server Cluster Manager with no valid license.

Parameters

$serverId

int

The server ID.

$doRestart

boolean

This parameter take no effect anymore Specify if the re-configured server should be restarted after the re-configure action. The default is FALSE.

Returns

<b>The clusterRemoveServer Method</b>

clusterRemoveServer(int $serverId, boolean $force) : \ZendService\ZendServerAPI\DataTypes\ServerInfo
This method removes a server from the cluster. The removal process
may be asynchronous if Session Clustering is used. If this is the case,
the initial operation will return an HTTP 202 response. As long as
the server is not fully removed, further calls to remove the same server
should be idempotent. On a Zend Server Cluster Manager with no valid license,
this operation fails.

Parameters

$serverId

int

The id of the server to remove

$force

boolean

Force-remove the server, skipping graceful shutdown process. Default is FALSE

Returns

Disables the logging

disableLogging() : void
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::disableLogging()

Enables the logging

enableLogging() : void
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::enableLogging()

Get the plugin manager

getPluginManager() : \Zend\ServiceManager\PluginManager
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::getPluginManager()

Returns

\Zend\ServiceManager\PluginManager

Returns the current request

getRequest() : \ZendService\ZendServerAPI\Request
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::getRequest()

Returns

<b>The getSystemInfo Method</b>

getSystemInfo() : \ZendService\ZendServerAPI\DataTypes\SystemInfo
Use this method to get information about the system, including the Zend Server edition and version, PHP
version, licensing information, etc. This method produces similar output on all Zend Server systems,
and is future compatible.

Returns

<b>The restartPHP Method</b>

restartPhp(array $serverIds, boolean $parallelRestart) : \ZendService\ZendServerAPI\DataTypes\ServersList
This method restarts PHP on all servers or on specified servers in the cluster.
A 202 response in this case does not always indicate a successful restart of all servers.
Use the clusterGetServerStatus command to check the server(s) status again after a few seconds.

Parameters

$serverIds

array

A list of server IDs to restart. If not specified, all servers in the cluster will be restarted. In a single Zend Server context this parameter is ignored.

$parallelRestart

boolean

Sends the restart command to all servers at the same time. The default value is "FALSE".

Returns

Set the client.

setClient(\Zend\Http\Client $client) : void
Inherited

Most likly for testing

inherited_from \ZendService\ZendServerAPI\BaseAPI::setClient()

Parameters

$client

\Zend\Http\Client

Set the config file.

setConfigFile(string $configFile) : void
Inherited

Proxy to the pluginmanager for initialization

inherited_from \ZendService\ZendServerAPI\BaseAPI::setConfigFile()

Parameters

$configFile

string

Set the request for the current context

setRequest(\ZendService\ZendServerAPI\Request $request) : void
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::setRequest()

Parameters

<pre>Wait for status = OK on $server, check every $interval seconds</pre>

waitForStableState(string | int $server, int $interval) : \ZendService\ZendServerAPI\DataTypes\ServerInfo

Parameters

$server

stringint

Servername or server id

$interval

int

Seconds to repeat test

Returns

Get the first event groups identifier by an given issue id.

getFirstEventGroupsIdByIssueId(int $issueId) : int
Inherited

This will perform an monitorGetIssuesDetails action.

inherited_from \ZendService\ZendServerAPI\BaseAPI::getFirstEventGroupsIdByIssueId()

Parameters

$issueId

int

Returns

int

 Properties

 

$name : string
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::$$name
 

$pluginManager : \ZendService\ZendServerAPI\PluginManager
Inherited
inherited_from \ZendService\ZendServerAPI\BaseAPI::$$pluginManager

 Constants

 

Break loops for wait methods after this number of tries

DEFAULT_WAITINTERVAL : int