Skip to content

Commit 7ba0e7c

Browse files
committed
Add ReloadSecureSettings endpoint
1 parent 920e73e commit 7ba0e7c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace Elasticsearch\Endpoints\Cluster\Nodes;
6+
7+
/**
8+
* Class ReloadSecureSettings
9+
*
10+
* @category Elasticsearch
11+
* @package Elasticsearch\Endpoints\Cluster\Nodes
12+
* @author Zachary Tong <[email protected]>
13+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
14+
* @link http://elastic.co
15+
*/
16+
class ReloadSecureSettings extends AbstractNodesEndpoint
17+
{
18+
/**
19+
* @return string
20+
*/
21+
public function getURI()
22+
{
23+
$nodeId = $this->nodeID;
24+
$uri = "/_nodes/reload_secure_settings";
25+
26+
if (isset($nodeId) === true) {
27+
$uri = "/_nodes/$nodeId/reload_secure_settings";
28+
}
29+
30+
return $uri;
31+
}
32+
33+
/**
34+
* @return string[]
35+
*/
36+
public function getParamWhitelist()
37+
{
38+
return [];
39+
}
40+
41+
/**
42+
* @return string
43+
*/
44+
public function getMethod()
45+
{
46+
return 'POST';
47+
}
48+
}

src/Elasticsearch/Namespaces/NodesNamespace.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,25 @@ public function hotThreads($params = array())
110110
return $this->performRequest($endpoint);
111111
}
112112

113+
/**
114+
* $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
115+
*
116+
* @param array $params Associative array of parameters
117+
*
118+
* @return array
119+
*/
120+
public function reloadSecureSettings($params = array())
121+
{
122+
$nodeID = $this->extractArgument($params, 'node_id');
123+
124+
/** @var callback $endpointBuilder */
125+
$endpointBuilder = $this->endpoints;
126+
127+
/** @var \Elasticsearch\Endpoints\Cluster\Nodes\ReloadSecureSettings $endpoint */
128+
$endpoint = $endpointBuilder('Cluster\Nodes\ReloadSecureSettings');
129+
$endpoint->setNodeID($nodeID);
130+
$endpoint->setParams($params);
131+
132+
return $this->performRequest($endpoint);
133+
}
113134
}

0 commit comments

Comments
 (0)