| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520 |
- <?php
- namespace Elasticsearch\Namespaces;
- /**
- * Class CatNamespace
- *
- * @category Elasticsearch
- * @package Elasticsearch\Namespaces\CatNamespace
- * @author Zachary Tong <zach@elastic.co>
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
- * @link http://elastic.co
- */
- class CatNamespace extends AbstractNamespace
- {
- /**
- * $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 aliases($params = array())
- {
- $name = $this->extractArgument($params, 'name');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Aliases $endpoint */
- $endpoint = $endpointBuilder('Cat\Aliases');
- $endpoint->setName($name);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function allocation($params = array())
- {
- $nodeID = $this->extractArgument($params, 'node_id');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Allocation $endpoint */
- $endpoint = $endpointBuilder('Cat\Allocation');
- $endpoint->setNodeID($nodeID);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 count($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Count $endpoint */
- $endpoint = $endpointBuilder('Cat\Count');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['ts'] = (bool) Set to false to disable timestamping
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function health($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Health $endpoint */
- $endpoint = $endpointBuilder('Cat\Health');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $params['help'] = (bool) Return help information
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function help($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Help $endpoint */
- $endpoint = $endpointBuilder('Cat\Help');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- * ['pri'] = (bool) Set to true to return stats only for primary shards
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function indices($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Indices $endpoint */
- $endpoint = $endpointBuilder('Cat\Indices');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 master($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Master $endpoint */
- $endpoint = $endpointBuilder('Cat\Master');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 nodes($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Nodes $endpoint */
- $endpoint = $endpointBuilder('Cat\Nodes');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 nodeAttrs($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\NodeAttrs $endpoint */
- $endpoint = $endpointBuilder('Cat\NodeAttrs');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 pendingTasks($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\PendingTasks $endpoint */
- $endpoint = $endpointBuilder('Cat\PendingTasks');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function recovery($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Recovery $endpoint */
- $endpoint = $endpointBuilder('Cat\Recovery');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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 repositories($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Repositories $endpoint */
- $endpoint = $endpointBuilder('Cat\Repositories');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function shards($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Shards $endpoint */
- $endpoint = $endpointBuilder('Cat\Shards');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- * ['repository'] = (string) Name of repository from which to fetch the snapshot information
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function snapshots($params = array())
- {
- $repository = $this->extractArgument($params, 'repository');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Snapshots $endpoint */
- $endpoint = $endpointBuilder('Cat\Snapshots');
- $endpoint->setRepository($repository);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['full_id'] = (bool) Enables displaying the complete node ids
- * ['size'] = (enum) The multiplier in which to display values ([ "", "k", "m", "g", "t", "p" ])
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function threadPool($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\ThreadPool $endpoint */
- $endpoint = $endpointBuilder('Cat\ThreadPool');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- * ['fields'] = (list) A comma-separated list of fields to return the fielddata size
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function fielddata($params = array())
- {
- $fields = $this->extractArgument($params, 'fields');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Fielddata $endpoint */
- $endpoint = $endpointBuilder('Cat\Fielddata');
- $endpoint->setFields($fields);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Plugins $endpoint */
- $endpoint = $endpointBuilder('Cat\Plugins');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $params['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 segments($params = array())
- {
- $index = $this->extractArgument($params, 'index');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Segments $endpoint */
- $endpoint = $endpointBuilder('Cat\Segments');
- $endpoint->setIndex($index);
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml
- * ['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
- * ['format'] = (string) a short version of the Accept header, e.g. json, yaml
- * ['actions'] = (list) A comma-separated list of actions that should be returned. Leave empty to return all.
- * ['detailed'] = (boolean) Return detailed task information (default: false)
- * ['parent_node'] = (string) Return tasks with specified parent node.
- * ['parent_task'] = (number) Return tasks with specified parent task id. Set to -1 to return all.
- * ['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 tasks($params = array())
- {
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Tasks $endpoint */
- $endpoint = $endpointBuilder('Cat\Tasks');
- $endpoint->setParams($params);
- return $this->performRequest($endpoint);
- }
- /**
- * $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
- * ['bytes'] = (enum) The unit in which to display byte values
- *
- * @param $params array Associative array of parameters
- *
- * @return array
- */
- public function templates($params = array())
- {
- $name = $this->extractArgument($params, 'name');
- /** @var callback $endpointBuilder */
- $endpointBuilder = $this->endpoints;
- /** @var \Elasticsearch\Endpoints\Cat\Templates $endpoint */
- $endpoint = $endpointBuilder('Cat\Templates');
- $endpoint->setName($name)
- ->setParams($params);
- return $this->performRequest($endpoint);
- }
- }
|