Sha256: d08f957292ecdda412c6f6d9bae507df82f2ef0bc14bdd8c0001e1e377ea1d75

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

require 'net/http'
require 'json'

module ContainersManager
  class ConsulService
    def initialize(configuration)
      @configuration = configuration
    end

    def services(url)
      uri = URI(url)
      JSON.parse(Net::HTTP.get(uri))
    end

    def deregister(id)
      system("curl -XPUT #{@configuration.consul_deregister_url}/#{id}")
    end

    private

    attr_reader :configuration
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
containers_manager-0.1.9 lib/containers_manager/services/consul_service.rb