Skip to content

Commit

Permalink
Add Cluster\RemoteInfo endoint
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Nov 14, 2017
1 parent cc68efd commit dfd8c3c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/Elasticsearch/Endpoints/Cluster/RemoteInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Elasticsearch\Endpoints\Cluster;

use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* RemoteInfo Health
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cluster
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class RemoteInfo extends AbstractEndpoint
{
/**
* @return string
*/
public function getURI()
{
return "/_remote/info";
}

/**
* @return string[]
*/
public function getParamWhitelist()
{
return [];
}

/**
* @return string
*/
public function getMethod()
{
return 'GET';
}
}
18 changes: 18 additions & 0 deletions src/Elasticsearch/Namespaces/ClusterNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,22 @@ public function allocationExplain($params = array())

return $this->performRequest($endpoint);
}

/**
* $params[]
*
* @param $params array Associative array of parameters
*
* @return array
*/
public function remoteInfo($params = array())
{
/** @var callback $endpointBuilder */
$endpointBuilder = $this->endpoints;

/** @var \Elasticsearch\Endpoints\Cluster\RemoteInfo $endpoint */
$endpoint = $endpointBuilder('Cluster\RemoteInfo');

return $this->performRequest($endpoint);
}
}

0 comments on commit dfd8c3c

Please sign in to comment.