Skip to content

Commit

Permalink
Add Cat\Plugins endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Apr 3, 2015
1 parent e94d27a commit 15f3582
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/Elasticsearch/Endpoints/Cat/Plugins.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace Elasticsearch\Endpoints\Cat;

use Elasticsearch\Endpoints\AbstractEndpoint;
use Elasticsearch\Common\Exceptions;

/**
* Class Health
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elasticsearch.org
*/

class Plugins extends AbstractEndpoint
{
/**
* @return string
*/
protected function getURI()
{
$uri = "/_cat/plugins";


return $uri;
}


/**
* @return string[]
*/
protected function getParamWhitelist()
{
return array(
'local',
'master_timeout',
'h',
'help',
'v',
);
}


/**
* @return string
*/
protected function getMethod()
{
return 'GET';
}
}
24 changes: 24 additions & 0 deletions src/Elasticsearch/Namespaces/CatNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,28 @@ public function segments($params = array())
return $response['data'];
}


/**
* $params['local'] = (bool) Return local information, do not retrieve the state from master node (default: false)
* ['master_timeout'] = (time) Explicit operation timeout for connection to master node
* ['h'] = (list) Comma-separated list of column names to display
* ['help'] = (bool) Return help information
* ['v'] = (bool) Verbose mode. Display column headers
*
* @param $params array Associative array of parameters
*
* @return array
*/
public function plugins($params = array())
{
/** @var callback $endpointBuilder */
$endpointBuilder = $this->dicEndpoints;

/** @var \Elasticsearch\Endpoints\Cat\Plugins $endpoint */
$endpoint = $endpointBuilder('Cat\Plugins');
$endpoint->setParams($params);
$response = $endpoint->performRequest();
return $response['data'];
}

}

0 comments on commit 15f3582

Please sign in to comment.