Complete implementation of new Server model.

This commit is contained in:
Dane Everitt 2017-02-02 19:41:38 -05:00
parent 644ee85f59
commit 3114b7e52a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 170 additions and 202 deletions

View file

@ -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)
{