@@ -28,12 +28,12 @@ def query_string
2828 # Perform a REST API request against the indicated endpoint.
2929 #
3030 # @return Net::HTTPResponse
31- def self . rest ( http , \
32- req , \
33- validate_tls = true , \
34- timeout = 10 , \
35- username = nil , \
36- password = nil )
31+ def self . rest ( http ,
32+ req ,
33+ timeout = 10 ,
34+ username = nil ,
35+ password = nil ,
36+ validate_tls : true )
3737
3838 if username && password
3939 req . basic_auth username , password
@@ -84,15 +84,15 @@ def self.format_uri(resource_path, property_flush = {})
8484 # @return Array
8585 # an array of Hashes representing the found API objects, whether they be
8686 # templates, pipelines, et cetera.
87- def self . api_objects ( protocol = 'http' , \
88- validate_tls = true , \
89- host = 'localhost' , \
90- port = 9200 , \
91- timeout = 10 , \
92- username = nil , \
93- password = nil , \
94- ca_file = nil , \
95- ca_path = nil )
87+ def self . api_objects ( protocol = 'http' ,
88+ host = 'localhost' ,
89+ port = 9200 ,
90+ timeout = 10 ,
91+ username = nil ,
92+ password = nil ,
93+ ca_file = nil ,
94+ ca_path = nil ,
95+ validate_tls : true )
9696
9797 uri = URI ( "#{ protocol } ://#{ host } :#{ port } /#{ format_uri ( api_discovery_uri ) } " )
9898 http = Net ::HTTP . new uri . host , uri . port
@@ -103,7 +103,7 @@ def self.api_objects(protocol = 'http', \
103103 http . send method , arg if arg && http . respond_to? ( method )
104104 end
105105
106- response = rest http , req , validate_tls , timeout , username , password
106+ response = rest http , req , timeout , username , password , validate_tls : validate_tls
107107
108108 results = [ ]
109109
@@ -151,14 +151,14 @@ def self.prefetch(resources)
151151 p = resource . parameters
152152 [
153153 p [ :protocol ] . value ,
154- p [ :validate_tls ] . value ,
155154 p [ :host ] . value ,
156155 p [ :port ] . value ,
157156 p [ :timeout ] . value ,
158157 ( p . key? ( :username ) ? p [ :username ] . value : nil ) ,
159158 ( p . key? ( :password ) ? p [ :password ] . value : nil ) ,
160159 ( p . key? ( :ca_file ) ? p [ :ca_file ] . value : nil ) ,
161- ( p . key? ( :ca_path ) ? p [ :ca_path ] . value : nil )
160+ ( p . key? ( :ca_path ) ? p [ :ca_path ] . value : nil ) ,
161+ p [ :validate_tls ] . value ,
162162 ]
163163 # Deduplicate identical settings, and fetch templates
164164 end . uniq
@@ -228,10 +228,10 @@ def flush
228228 response = self . class . rest (
229229 http ,
230230 req ,
231- resource [ :validate_tls ] ,
232231 resource [ :timeout ] ,
233232 resource [ :username ] ,
234- resource [ :password ]
233+ resource [ :password ] ,
234+ validate_tls : resource [ :validate_tls ]
235235 )
236236
237237 # Attempt to return useful error output
@@ -257,14 +257,14 @@ def flush
257257 end
258258 @property_hash = self . class . api_objects (
259259 resource [ :protocol ] ,
260- resource [ :validate_tls ] ,
261260 resource [ :host ] ,
262261 resource [ :port ] ,
263262 resource [ :timeout ] ,
264263 resource [ :username ] ,
265264 resource [ :password ] ,
266265 resource [ :ca_file ] ,
267- resource [ :ca_path ]
266+ resource [ :ca_path ] ,
267+ validate_tls : resource [ :validate_tls ]
268268 ) . find do |t |
269269 t [ :name ] == resource [ :name ]
270270 end
0 commit comments