Skip to content

Commit

Permalink
Add ReloadSecureSettings endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Jan 7, 2019
1 parent c75d690 commit 75b32b2
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/Elasticsearch/Endpoints/Cluster/Nodes/ReloadSecureSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

declare(strict_types = 1);

namespace Elasticsearch\Endpoints\Cluster\Nodes;

/**
* Class ReloadSecureSettings
*
* @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 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';
}
}
21 changes: 21 additions & 0 deletions src/Elasticsearch/Namespaces/NodesNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 75b32b2

Please sign in to comment.