>> Thanks, but I says about query like this:
>>
>> ["and",
>>   ["and",
>>     ["=", "type", "Class"],
>>     ["=", "title", "Php"]],
>>   ["and",
>>     ["=", "type", "Class"],
>>     ["=", "title", "Nginx"]]]
>
> Think about what this does behind the scenes on the resources endpoint
> (see the query here:
> https://gist.github.com/kbarber/d557da843b363ce3af3a#file-gistfile1-sql-L9-L13)
> , it ultimately is just going to attempt to find a class resource that
> has the title php AND nginx. Since a column can't have two values,
> this will return nothing. If you had a base OR at the top, it would
> return both the php and nginx classes, but this still isn't going to
> provide you everything, but at least it will give you enough
> information to break this down on the client end.
>
> In the SQL world, the way I might construct such a query, is to get
> all the class resources with nginx and php as the title, and then you
> would need a list of distinct certificate names for both, and you
> would want to find the overlap between the two, using an intersection
> query for example
> (http://www.postgresql.org/docs/9.3/static/queries-union.html). None
> of this is supported by the PuppetDB query API today.

Contrary to my last statement, this might work:
https://gist.github.com/kbarber/61d7c04f4d898148a06f

Deepak pointed that last one out. Let us know if it works.

ken.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAE4bNTmQX-E%2Bd8t71vVgENos9pXQR1VahSMmucHo_VoebgHjAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to