Class: ContainersManager::ConsulService
- Inherits:
-
Object
- Object
- ContainersManager::ConsulService
- Defined in:
- lib/containers_manager/services/consul_service.rb
Instance Method Summary collapse
- #deregister(id) ⇒ Object
-
#initialize(configuration) ⇒ ConsulService
constructor
A new instance of ConsulService.
- #services(url) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ ConsulService
Returns a new instance of ConsulService.
5 6 7 |
# File 'lib/containers_manager/services/consul_service.rb', line 5 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#deregister(id) ⇒ Object
14 15 16 |
# File 'lib/containers_manager/services/consul_service.rb', line 14 def deregister(id) system("curl -XPUT #{@configuration.consul_deregister_url}/#{id}") end |
#services(url) ⇒ Object
9 10 11 12 |
# File 'lib/containers_manager/services/consul_service.rb', line 9 def services(url) resp = `curl -sSL #{url}` JSON.parse(resp) end |