diff --git a/src/Elasticsearch/Endpoints/Cluster/Nodes/ReloadSecureSettings.php b/src/Elasticsearch/Endpoints/Cluster/Nodes/ReloadSecureSettings.php new file mode 100644 index 000000000..d25bbf869 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cluster/Nodes/ReloadSecureSettings.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ReloadSecureSettings extends AbstractNodesEndpoint +{ + /** + * @return string + */ + public function getURI() + { + $nodeId = $this->nodeID; + $uri = "/_nodes/reload_secure_settings"; + + if (isset($nodeId) === true) { + $uri = "/_nodes/$nodeId/reload_secure_settings"; + } + + return $uri; + } + + /** + * @return string[] + */ + public function getParamWhitelist() + { + return []; + } + + /** + * @return string + */ + public function getMethod() + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Namespaces/NodesNamespace.php b/src/Elasticsearch/Namespaces/NodesNamespace.php index 46b432046..e72be1df9 100644 --- a/src/Elasticsearch/Namespaces/NodesNamespace.php +++ b/src/Elasticsearch/Namespaces/NodesNamespace.php @@ -108,4 +108,25 @@ public function hotThreads($params = array()) return $this->performRequest($endpoint); } + /** + * $params['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 + * + * @param array $params Associative array of parameters + * + * @return array + */ + public function reloadSecureSettings($params = array()) + { + $nodeID = $this->extractArgument($params, 'node_id'); + + /** @var callback $endpointBuilder */ + $endpointBuilder = $this->endpoints; + + /** @var \Elasticsearch\Endpoints\Cluster\Nodes\ReloadSecureSettings $endpoint */ + $endpoint = $endpointBuilder('Cluster\Nodes\ReloadSecureSettings'); + $endpoint->setNodeID($nodeID); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } }