-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Remote Namespace and Remote\Info endpoint
- Loading branch information
1 parent
dfdb1a8
commit 82121d9
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Remote; | ||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Info | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Endpoints\Cluster\Nodes | ||
* @author Zachary Tong <[email protected]> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elastic.co | ||
*/ | ||
class Info extends AbstractEndpoint | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getURI() | ||
{ | ||
return "/_remote/info"; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getParamWhitelist() | ||
{ | ||
return array(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Namespaces; | ||
|
||
use Elasticsearch\Endpoints\Remote\Info; | ||
|
||
/** | ||
* Class RemoteNamespace | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Namespaces\TasksNamespace | ||
* @author Zachary Tong <[email protected]> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elastic.co | ||
*/ | ||
class RemoteNamespace extends AbstractNamespace | ||
{ | ||
/** | ||
* @param $params array Associative array of parameters | ||
* | ||
* @return array | ||
*/ | ||
public function info($params = array()) | ||
{ | ||
/** @var callback $endpointBuilder */ | ||
$endpointBuilder = $this->endpoints; | ||
|
||
/** @var Info $endpoint */ | ||
$endpoint = $endpointBuilder('Remote\Info'); | ||
$endpoint->setParams($params); | ||
|
||
return $this->performRequest($endpoint); | ||
} | ||
} |