Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug in Partial Search example, Completed documentation on Partial ... #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rberger
Copy link

@rberger rberger commented Aug 6, 2014

...Search

@sethvargo
Copy link

Hi @rberger. Thank you for the Pull Request. I am willing to fix the broken API call as you pointed out in the other PR, but I do not think it's wise to replicate the documentation from partial search in this README. If you look at the partial_search method in ChefAPI, you can see that it just returns the response from the Chef Server. If ever that changes, I would like Chef to handle the documentation, not me. There are plenty of examples in the Chef docs about partial search queries that I do not think we need to replicate them here.

@rberger
Copy link
Author

rberger commented Aug 12, 2014

From what I understand and what caused huge confusion for me (or maybe I'm still confused if I'm wrong here) the chefAPI expects the keys parameter to be a hash that has a top level key called :keys where as :

:keys => { 'name' => [ 'name' ],
             'ip'   => [ 'ipaddress' ],
             'kernel_version' => [ 'kernel', 'version' ]
           }

Whereas chef-api expects it to just be a hash of key/values with no top level :keys key

 { 'name' => [ 'name' ],
             'ip'   => [ 'ipaddress' ],
             'kernel_version' => [ 'kernel', 'version' ]
 }

Plus the whole idea of passing in attribute keys as an array of strings is hugely confusing and so fundamental.

I think that people who are fluent in these tools that do so much ruby magic don't grasp how hard it is to use them by others, even for people who are ruby fluent. Having to translate from one set of magic to another makes it worse.

Having simple examples is soooooo helpful.

Besides this search issue that I spent a 1/2 day figuring out (and thus wanting to document) I've had almost as much difficulty trying to figure out how to use chef-api just ot update a nested node attribute. You don't show that anywhere. And having the Node docs just point to the Base docs isn't so helpful. I did finally figure it out but I had to mess with things in the ruby repl for a while.

But I will send you and updated pull request with just the API changes as soon as I can. Hopefully I'll have time to turn the other stuff into a blog post.

@fusiondog
Copy link

I found the docs in this PR helpful. If you aren't going to include them, perhaps you could link to the other documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants