class Diplomat::Nodes

@depreciated Methods for interacting with the Consul nodes API endpoint

Public Instance Methods

get(options = {}) click to toggle source

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

# File lib/diplomat/nodes.rb, line 11
def get(options = {})
  ret = send_get_request(@conn, ['/v1/catalog/nodes'], options)
  JSON.parse(ret.body)
end
get_all(options = {}) click to toggle source
# File lib/diplomat/nodes.rb, line 16
def get_all(options = {})
  custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil
  ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)
  JSON.parse(ret.body).map { |service| OpenStruct.new service }
end