Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module Elasticsearch
module API
module Nodes
module Actions

# Re-read the local node's encrypted keystore. Specifically, it will prompt the keystore
# decryption and reading across the cluster.
#
# @example Reload secure settings for all nodes
#
# client.nodes.reload_secure_settings
#
# @example Reload secure settings for a list of nodes
#
# client.nodes.reload_secure_settings(node_id: 'foo,bar')
#
# @option arguments [ Array ] :node_id A comma-separated list of node IDs or names to perform the operation on
# @option arguments [ String ] :timeout Explicit operation timeout
#
# @see http://elasticsearch.org/guide/reference/api/cluster-nodes-reload-secure-settings
#
def reload_secure_settings(arguments={})
valid_params = [
:timeout ]

method = HTTP_POST
path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'reload_secure_settings'

params = Utils.__validate_and_extract_params arguments, valid_params
body = nil

perform_request(method, path, params, body).body
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
require 'spec_helper'

describe 'client#reload_secure_settings' do

let(:expected_args) do
[
'POST',
url,
params,
nil,
nil
]
end

let(:params) do
{}
end

let(:url) do
'_nodes/reload_secure_settings'
end

it 'performs the request' do
expect(client_double.nodes.reload_secure_settings()).to eq({})
end

context 'when a node id is specified' do

let(:url) do
'_nodes/foo/reload_secure_settings'
end

it 'performs the request' do
expect(client_double.nodes.reload_secure_settings(node_id: 'foo')).to eq({})
end
end

context 'when more than one node id is specified as a string' do

let(:url) do
'_nodes/foo,bar/reload_secure_settings'
end

it 'performs the request' do
expect(client_double.nodes.reload_secure_settings(node_id: 'foo,bar', body: { foo: 'bar' })).to eq({})
end
end

context 'when more than one node id is specified as a list' do

let(:url) do
'_nodes/foo,bar/reload_secure_settings'
end

it 'performs the request' do
expect(client_double.nodes.reload_secure_settings(node_id: ['foo', 'bar'], body: { foo: 'bar' })).to eq({})
end
end

context 'when a timeout param is specified' do

let(:params) do
{ timeout: '30s'}
end

it 'performs the request' do
expect(client_double.nodes.reload_secure_settings(timeout: '30s')).to eq({})
end
end
end