Reloads all nodes information. Has to be called if informations changed.

@param array $params Params to return (default none). Possible options: settings, os, process, jvm, thread_pool, network, transport, http, plugin

@return Response Response object
327764
public function refresh(array $params = []): Response
    {
        $this->_params = $params;

        $endpoint = new \Elasticsearch\Endpoints\Cluster\Nodes\Info();
        $endpoint->setNodeID($this->getNode()->getId());

        if (!empty($params)) {
            $endpoint->setMetric($params);
        }

        $this->_response = $this->getNode()->getClient()->requestEndpoint($endpoint);
        $data = $this->getResponse()->getData();

        $this->_data = \reset($data['nodes']);
        $this->_id = \key($data['nodes']);
        $this->getNode()->setId($this->getId());

        return $this->_response;
    }
221895
public static function load($param)
    {
        if (!($node = self::loadById($param))) {
            $node = self::loadByPath($param);
        }

        return $node;
    }
1237243
protected function _restserver($params) {
    // generic application level parameters
    $params['api_key'] = $this->getAppId();
    $params['format'] = 'json-strings';

    $result = json_decode($this->_oauthRequest(
      $this->getApiUrl($params['method']),
      $params
    ), true);

    // results are returned, errors are thrown
    if (is_array($result) && isset($result['error_code'])) {
      $this->throwAPIException($result);
      // @codeCoverageIgnoreStart
    }
    // @codeCoverageIgnoreEnd

    $method = strtolower($params['method']);
    if ($method === 'auth.expiresession' ||
        $method === 'auth.revokeauthorization') {
      $this->destroySession();
    }

    return $result;
  }
412086
function connectionSet(array $params)
    {
        $this->connection = new Redis();
        if ($this->connection == false) {
            throw new common_exception_Error("Redis php module not found");
        }
        if (!isset($params['host'])) {
            throw new common_exception_Error('Missing host information for Redis driver');
        }
        $host    = $params['host'];
        $port    = isset($params['port']) ? $params['port'] : self::DEFAULT_PORT;
        $timeout = isset($params['timeout']) ? $params['timeout'] : self::DEFAULT_TIMEOUT;
        $persist = isset($params['pconnect']) ? $params['pconnect'] : true;
        $this->params['attempt'] = isset($params['attempt']) ? $params['attempt'] : self::DEFAULT_ATTEMPT;

        if ($persist) {
            $this->connection->pconnect($host , $port , $timeout);
        } else {
            $this->connection->connect($host , $port , $timeout);
        }
    }
523562
public function update($params, $optParams = [])
    {
        if (!$params instanceof Cloud) {
            throw new InvalidParamException(Cloud::class . ' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'update',
            'restId' => $params->id,
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Cloud($response->data) : $response;
        });
    }
1320992
public function create(array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE,
            $params,
            null
        );
    }
483908
public function findOneByParams(array $params = [])
    {
        $params['limit'] = 1;
        $records = $this->findByParams($params);
        if (count($records) > 0) {
            return $records->rewind();
        }

        return null;
    }
125600
public function loadCount($params=array()) {
		
		$this->openConnection();
		
		$res = 0;
		
		try {
		
			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			$res = (int)$stat->fetch(\PDO::FETCH_COLUMN);

			// logger
			$this->logParamQuery($this->query, $res, $params);
		
		} catch (\PDOException $e) {
		
			$this->handleException($e, $params);
		
		}
		
		$stat->closeCursor();

		return $res;
		
	}
1100114
public function loadObject($params=array()) {

		$this->openConnection();
		
		$obj = NULL;
		
		try {
			
			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			$obj = $stat->fetch(\PDO::FETCH_OBJ);
			
			// logger
			$this->logParamQuery($this->query, (bool)$obj, $params);

		} catch (\PDOException $e) {

			$this->handleException($e, $params);
		
		}
		
		$stat->closeCursor();

		return $obj;
		
	}
1336277
public function flush( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site' ) );
		$this->_setLocale( $params->site );

		$this->_getContext()->getCache()->flush();

		return array(
			'success' => true,
		);
	}
1090380
public function sync(array $queryParams = [])
    {
        $response = $this->client->post("{$this->uri()}/sync", [
            'query' => $queryParams,
        ]);

        return $this->handleResponse($response);
    }
1324991
public function updateWebsite(...$params)
    {
        $name      = \array_shift($params);
        $ipAddress = \array_shift($params);
        $https     = \array_shift($params);
        $domains   = \array_shift($params);

        if ($this->version === 1)
        {
            $siteApps = $params;

            return $this->updateV1Website($name, $ipAddress, $https, $domains, $siteApps);
        }

        $certificate = \array_shift($params);
        $siteApps    = $params;

        return $this->updateV2Website($name, $ipAddress, $https, $domains, $certificate, $siteApps);
    }
1101157
public function setAllParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setParam($key, $value);
        }

        return $this;
    }
693594
protected function call(array $params)
    {
        $response = $this->client->get(null, array('query' => $params));

        $result = $response->json();

        if ($result['result'] == 'ERR') {
            throw new ResponseException($result['message'], $result['code']);
        }

        return $result;
    }
909073
protected function handleAssetRequest(array $params)
    {
        $response = new Response();

        $assetsConf = $this->config->getSection('asset_resolv');
        $assetsDir  = $this->config->get('app.public_dir') . '/assets';

        if (! empty($assetsConf['current'])) {
            $file = $assetsDir . '/' . $assetsConf['current'] . '/' . $params['filename'];

            if (file_exists($file)) {
                $fileResource = new Http\File\File($file);
                $mtime = filemtime($fileResource->getPathname());

                $response->headers->set('Content-Type', $fileResource->getMimeType());
                $response->setContent(file_get_contents($fileResource->getPathname()));
                $response->setCache(array(
                    'public' => true,
                    'last_modified' => new \DateTime(gmdate("D, d M Y H:i:s", $mtime))
                ));

                $response->setExpires(new \DateTime(gmdate("D, j M Y H:i:s", time() + MONTH)));
                $response->isNotModified($this->request);

                return $response;
            }
        } elseif (! empty($assetsConf['fallback'])) {

        }
    }
443746
private function processRequest($params = null)
    {
        // Ensure this api is currently enabled/supported
        $this->assertEnabled();

        // Instantiate requester
        $requestor = new Requestor($this->config);

        switch ($this->config['dataFormat']) {
            case 'xml':
                // Do nothing special for XML
                break;
            case 'json':
                // Validate and sanitize parameters (json decode/encode)
                if ($this->config['paramValidationEnabled']) {
                    $params_decoded = json_decode($params, TRUE);
                    $params_decoded = $this->validateApiParameters($this->keys, $params_decoded);
                    // Add URI method and version to payload
                    $params_decoded['_method'] = $this->id;
                    $params_decoded['_version'] = $requestor->version;
                    $params = json_encode($params_decoded);
                }
                break;
            case 'array':
                // Validate and sanitize parameters
                if ($this->config['paramValidationEnabled']) {
                    $params = $this->validateApiParameters($this->keys, $params);
                } else {
                    $params = $this->setAuthenticationParametersNoValidation($params);
                }
                // Add URI method and version to payload
                $params['_method'] = $this->id;
                $params['_version'] = $requestor->version;
                break;
            default:
                throw new ApiException(
                    'Invalid dataFormat: '.$this->config['dataFormat']
                );
        }

        // Send request
        $response = $requestor->request('post', $this->id, $params);

        // Return result
        $this->lastApiResponse = $response;
        return $response;
    }
1044090
public function loadResult($params=array()) {
		
		$this->openConnection();
		
		$res = NULL;

		try {

			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			
			// logger
			$count = $this->handler->query('SELECT FOUND_ROWS()')->fetchColumn();
			$this->logParamQuery($this->query, $count, $params);
			$res = $stat->fetch(\PDO::FETCH_COLUMN);	
		
		} catch (\PDOException $e) {

			$this->handleException($e, $params);

		}
		
		$stat->closeCursor();

		return $res;
		
	}