Method: Diplomat::Query#get_all

Defined in:
lib/diplomat/query.rb

#get_all(options = {}) ⇒ OpenStruct

Get all prepared queries

Parameters:

  • options (Hash) (defaults to: {})

    :dc Consul datacenter to query

Returns:

  • (OpenStruct)

    the list of all prepared queries



21
22
23
24
25
# File 'lib/diplomat/query.rb', line 21

def get_all(options = {})
  custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil
  ret = send_get_request(@conn, ['/v1/query'], options, custom_params)
  JSON.parse(ret.body).map { |query| OpenStruct.new query }
end