WeAreFarmGeek / diplomat

A HTTP Ruby API for Consul
BSD 3-Clause "New" or "Revised" License
370 stars 116 forks source link

Enable configuration override on each consul api call #179

Closed tionebsalocin closed 5 years ago

tionebsalocin commented 5 years ago

Using the configs hash target host or token can be different at each call

e.g value = Diplomat::Kv.get('key/path', token: '000-111-222-333-444', http_addr: 'http://consu01:8500', dc: 'dc1', stale: true) Diplomat::Kv.put('key/path', value, token: '111-222-333-444-555', http_addr: 'http://consu02:8500', dc: 'dc2', stale: true)

ShimmerGlass commented 5 years ago

LGTM.

FAR the options / cutomparams parameters in send{get,put,..}_request could be combined to avoid having too many ways to pass options.

pierresouchay commented 5 years ago

@scalp42 did which version did you use? (there were a few fixes after version 2.1.0...)