| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace Elasticsearch\Endpoints\Cluster\Nodes;
- /**
- * Class Info
- *
- * @category Elasticsearch
- * @package Elasticsearch\Endpoints\Cluster\Nodes
- * @author Zachary Tong <zach@elastic.co>
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
- * @link http://elastic.co
- */
- class Info extends AbstractNodesEndpoint
- {
- // A comma-separated list of metrics you wish returned. Leave empty to return all.
- private $metric;
- /**
- * @param $metric
- *
- * @return $this
- */
- public function setMetric($metric)
- {
- if (isset($metric) !== true) {
- return $this;
- }
- if (is_array($metric) === true) {
- $metric = implode(",", $metric);
- }
- $this->metric = $metric;
- return $this;
- }
- /**
- * @return string
- */
- public function getURI()
- {
- $node_id = $this->nodeID;
- $metric = $this->metric;
- $uri = "/_nodes";
- if (isset($node_id) === true && isset($metric) === true) {
- $uri = "/_nodes/$node_id/$metric";
- } elseif (isset($metric) === true) {
- $uri = "/_nodes/$metric";
- } elseif (isset($node_id) === true) {
- $uri = "/_nodes/$node_id";
- }
- return $uri;
- }
- /**
- * @return string[]
- */
- public function getParamWhitelist()
- {
- return array(
- 'flat_settings',
- 'human',
- );
- }
- /**
- * @return string
- */
- public function getMethod()
- {
- return 'GET';
- }
- }
|