WeAreFarmGeek / diplomat

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

Add support for default datacenter #217

Open miklinux opened 3 years ago

miklinux commented 3 years ago

It would be really helpful if the default datacenter could be set at configuration time

# Initialize Consul
Diplomat.configure do |config|
   config.datacenter = 'mydc'
end

and all API calls would use that each time, unless overridden.

pierresouchay commented 3 years ago

@miklinux Yes, that's a good idea, would you like to propose a PR, I'll be glad to review it

miklinux commented 3 years ago

@pierresouchay Will look into it

miklinux commented 3 years ago

Hi @pierresouchay, here's the PR for reviewing!

https://github.com/WeAreFarmGeek/diplomat/pull/220