----- Original Message -----
> From: "Ryan Whitehurst" <[email protected]>
> To: "puppet-dev" <[email protected]>
> Sent: Tuesday, 2 August, 2016 18:04:24
> Subject: Re: [Puppet-dev] PQL, puppetdb and tags set with tag()

> On Sun, Jul 31, 2016 at 3:05 PM, R.I.Pienaar <[email protected]> wrote:
>> hello,
>>
>> I am trying to selectively find classes using PQL that has a certain 
>> parameter.
>>
>> class foo($server=true) {
>> }
>>
>> So with PQL I have no idea how to match only foo classes where server = 
>> true, it
>> appears from errors that it does support search parameters but nothing in the
>> docs and I can't figure it out.
> 
> In the current version of PQL, you can't query against parameters.
> It's under development though:
> https://github.com/puppetlabs/puppetdb/pull/2000
> 
> In the future, you should be able to query parameters with
> 
>  resources { type = "Class" and title = "Foo" and parameters.server = true }
> 
> What you can do now, however, is use the AST query language:
> 
> ["from", "resources",
> ["and",
>  ["=", "type", "Class"],
>  ["=", "title", "Foo"],
>  ["=", ["parameter", "server"], true]]]
> 
> This will do the same thing as the PQL except it works in the current
> version of PuppetDB. It's not quite as convenient, but at least it
> works.

Thanks, alas I have giant PQL queries so can't really mix and match just this 
part
and don't want to make many queries :(

Thanks though.

Odd about the tags stuff, but I found a way to get what I need with tags

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev/1611037508.526592.1470154221964.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to