Support for the v4 api ?
Ziaunys opened this issue · comments
Eric Zounes commented
PuppetDB 3.1 no longer supports the v1, v2, and v3 API versions so I was wondering if there are plans to add support for v4.
Zack Smith commented
Maybe something like this?
# Logic to support PuppetDB API versions 3 and 4
# and the associated PuppetDB terminus interfaces
if Puppet::Util::Puppetdb.config.respond_to?("server_urls")
uri = URI(Puppet::Util::Puppetdb.config.server_urls.first)
server = uri.host
port = uri.port
endpoint = "/pdb/query/v4/resources"
else
server = Puppet::Util::Puppetdb.server
port = Puppet::Util::Puppetdb.port
endpoint = "/v3/resources"
end
Though that won't handle the key name changes.
Nate McCurdy commented
Will also need to change all instances of select-
to select_
as the key names have changed in v4.
https://docs.puppetlabs.com/puppetdb/3.0/api/query/v4/query.html#query-strings
Rémi Ferrand commented
👍 . Is there any plan to support the v4 API in a near future ?
Matthew Gyurgyik commented
Erik Dalén commented
I just pushed the release of 2.0.0 now. And it actually has full support for structured facts as well :)
Hope it works well (it does in my testing). But report any bugs you find.