Elastica\Node\Info::refresh PHP Method

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
    public function refresh(array $params = [])
    {
        $this->_params = $params;
        $path = '_nodes/' . $this->getNode()->getId();
        if (!empty($params)) {
            $path .= '/';
            foreach ($params as $param) {
                $path .= $param . ',';
            }
        }
        $this->_response = $this->getNode()->getClient()->request($path, Request::GET);
        $data = $this->getResponse()->getData();
        $this->_data = reset($data['nodes']);
        $this->_id = key($data['nodes']);
        $this->getNode()->setId($this->getId());
    }