class Diplomat::Nodes

@depreciated Methods for interacting with the Consul nodes API endpoint

Public Instance Methods

get() click to toggle source

Get all nodes @deprecated Please use Diplomat::Node instead. @return [OpenStruct] all data associated with the nodes in catalog

# File lib/diplomat/nodes.rb, line 10
def get
  ret = @conn.get '/v1/catalog/nodes'
  JSON.parse(ret.body)
end
get_all(options = nil) click to toggle source
# File lib/diplomat/nodes.rb, line 15
def get_all(options = nil)
  url = ['/v1/catalog/nodes']
  url << use_named_parameter('dc', options[:dc]) if options && options[:dc]

  ret = @conn.get concat_url url
  JSON.parse(ret.body).map { |service| OpenStruct.new service }
rescue Faraday::ClientError
  raise Diplomat::PathNotFound
end