Complete implementation of new Server model.
This commit is contained in:
parent
644ee85f59
commit
3114b7e52a
10 changed files with 170 additions and 202 deletions
|
@ -96,11 +96,27 @@ class Node extends Model
|
|||
return self::$nodes[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an instance of the Guzzle client for this specific node.
|
||||
*
|
||||
* @return \GuzzleHttp\Client
|
||||
*/
|
||||
public function guzzleClient($headers = [])
|
||||
{
|
||||
return new Client([
|
||||
'base_uri' => sprintf('%s://%s:%s/', $this->scheme, $this->fqdn, $this->daemonListen),
|
||||
'timeout' => env('GUZZLE_TIMEOUT', 5.0),
|
||||
'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 3.0),
|
||||
'headers' => $headers,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Guzzle Client for the node in question.
|
||||
*
|
||||
* @param int $node
|
||||
* @return \GuzzleHttp\Client
|
||||
* @deprecated
|
||||
*/
|
||||
public static function guzzleRequest($node)
|
||||
{
|
||||
|
|
Reference in a new issue