[chef] Proper way to use Spice library for search?


Chronological Thread 
  • From: Benoit Caron < >
  • To:
  • Subject: [chef] Proper way to use Spice library for search?
  • Date: Fri, 11 Nov 2011 10:56:28 -0500

I'm using the Spice library to uses the API to automate some tasks.

I can correctly use it to access and write to a data bag, but I can't figure how to make the search work.

I'm setting things up like this:

            Spice.setup do |s|
                s.server_url = "http://my.chef-server:4000"
                s.client_name = "myname"
                s.key_file = "/path/to/my/key.pem"
            end
sp = Spice.connection

From the rdoc, I tough that I could use a search method on my Spice object, but I get a NoMethodeError if I try sp.search

I tried to call search with the get method:

result = sp.get("/search/node/", :q => "recipe:acookbook AND chef_environment:production")

But the query is not taken into account and I get the whole list of nodes.

Any users of this libs (or it's author ;)) around that could point me in the right direction?

Thanks

Benoit


  • [chef] Proper way to use Spice library for search?, Benoit Caron, 11/11/2011

Archive powered by MHonArc 2.6.16.

§