Skip to content

Commit

Permalink
Add NodeNamespace and SnapshotNamespace to Client
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Jan 21, 2014
1 parent 3cde301 commit 86c0c98
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Elasticsearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Elasticsearch\Endpoints;
use Elasticsearch\Namespaces\ClusterNamespace;
use Elasticsearch\Namespaces\IndicesNamespace;
use Elasticsearch\Namespaces\NodesNamespace;
use Elasticsearch\Namespaces\SnapshotNamespace;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Monolog\Processor\IntrospectionProcessor;
Expand Down Expand Up @@ -52,6 +54,16 @@ class Client
*/
protected $cluster;

/**
* @var NodesNamespace
*/
protected $nodes;

/**
* @var NodesNamespace
*/
protected $snapshot;

/** @var callback */
protected $dicEndpoints;

Expand All @@ -68,6 +80,8 @@ public function __construct($params = array())
$this->transport = $this->params['transport'];
$this->indices = $this->params['indicesNamespace'];
$this->cluster = $this->params['clusterNamespace'];
$this->nodes = $this->params['nodesNamespace'];
$this->snapshot = $this->params['snapshotNamespace'];
$this->dicEndpoints = $this->params['endpoint'];
}

Expand Down Expand Up @@ -954,6 +968,28 @@ public function cluster()
}


/**
* Operate on the Nodes namespace of commands
*
* @return NodesNamespace
*/
public function nodes()
{
return $this->nodes;
}


/**
* Operate on the Snapshot namespace of commands
*
* @return SnapshotNamespace
*/
public function snapshot()
{
return $this->snapshot;
}


/**
* Sets up the DIC parameter object
*
Expand Down

0 comments on commit 86c0c98

Please sign in to comment.