Closed BarthV closed 8 years ago
Try this.
require 'ridley'
r = Ridley.from_chef_config(File.expand_path('~/.chef/knife.rb'))
nodes = r.partial_search(:node, 'name:my-server-*', ['memory.total'])
nodes.each { |n| puts n.automatic.memory.total }
you can also list multiple attributes in the query array.
I'll try thanks
Hi !
Something I like with
knife search
is-a
option. I personally make a intensive use of it, like this trivial example :Is It possible to create an option in ridley.search to return only the selected key(s) ? It could be possible to pass an attribute array to search function as optionnal attr.