PHP Class Elastica\Node\Info

Show file Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_data Stats data.
$_id string Unique node id.
$_node Node.
$_params array Query parameters.
$_response Response.

Public Methods

Method Description
__construct ( Node $node, array $params = [] ) Create new info object for node.
get ( ) : mixed Returns the entry in the data array based on the params.
getData ( ) : array Return all info data.
getId ( ) : string
getIp ( ) : string Return IP of the node.
getName ( ) : string
getNode ( ) : Node Return node object.
getPlugins ( ) : array Return data regarding plugins installed on this node.
getPort ( ) : string Return port of the node.
getResponse ( ) : Response Returns response object.
hasPlugin ( string $name ) : boolean Check if the given plugin is installed on this node.
refresh ( array $params = [] ) : Response Reloads all nodes information. Has to be called if informations changed.

Method Details

__construct() public method

Create new info object for node.
public __construct ( Node $node, array $params = [] )
$node Elastica\Node Node object
$params array List of params to return. Can be: settings, os, process, jvm, thread_pool, network, transport, http

get() public method

Several params possible. Example 1: get('os', 'mem', 'total') returns total memory of the system the node is running on Example 2: get('os', 'mem') returns an array with all mem infos
public get ( ) : mixed
return mixed Data array entry or null if not found

getData() public method

Return all info data.
public getData ( ) : array
return array Data array

getId() public method

public getId ( ) : string
return string Unique node id

getIp() public method

Return IP of the node.
public getIp ( ) : string
return string Returns Node ip address

getName() public method

public getName ( ) : string
return string Node name

getNode() public method

Return node object.
public getNode ( ) : Node
return Elastica\Node Node object

getPlugins() public method

Return data regarding plugins installed on this node.
public getPlugins ( ) : array
return array plugin data

getPort() public method

Return port of the node.
public getPort ( ) : string
return string Returns Node port

getResponse() public method

Returns response object.
public getResponse ( ) : Response
return Elastica\Response Response object

hasPlugin() public method

Check if the given plugin is installed on this node.
public hasPlugin ( string $name ) : boolean
$name string plugin name
return boolean true if the plugin is installed, false otherwise

refresh() public method

Reloads all nodes information. Has to be called if informations changed.
public refresh ( array $params = [] ) : Response
$params array Params to return (default none). Possible options: settings, os, process, jvm, thread_pool, network, transport, http, plugin
return Elastica\Response Response object

Property Details

$_data protected property

Stats data.
protected $_data

$_id protected property

Unique node id.
protected string $_id
return string

$_node protected property

Node.
protected $_node

$_params protected property

Query parameters.
protected array $_params
return array

$_response protected property

Response.
protected $_response