Skip to content

Commit

Permalink
Cluster/State endpoint accepts a metric parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Feb 11, 2014
1 parent f9dabd2 commit c0a5d5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Elasticsearch/Namespaces/ClusterNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ public function reroute($params = array())
*/
public function state($params = array())
{
$metric = $this->extractArgument($params, 'metric');

/** @var callback $endpointBuilder */
$endpointBuilder = $this->dicEndpoints;

/** @var \Elasticsearch\Endpoints\Cluster\State $endpoint */
$endpoint = $endpointBuilder('Cluster\State');
$endpoint->setParams($params);
$endpoint->setParams($params)->setMetric($metric);
$response = $endpoint->performRequest();
return $response['data'];
}
Expand Down

0 comments on commit c0a5d5d

Please sign in to comment.