Method: Chef::DataBag.list

Defined in:
lib/chef/data_bag.rb

.list(inflate = false) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/chef/data_bag.rb', line 84

def self.list(inflate=false)
  if inflate
    # Can't search for all data bags like other objects, fall back to N+1 :(
    list(false).inject({}) do |response, bag_and_uri|
      response[bag_and_uri.first] = load(bag_and_uri.first)
      response
    end
  else
    Chef::REST.new(Chef::Config[:chef_server_url]).get_rest("data")
  end
end