summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2011-02-17 14:59:59 -0800
committerPaul Berry <paul@puppetlabs.com>2011-02-17 14:59:59 -0800
commit23fc4db954c22bce2c6cc8996d5fafb175e2b747 (patch)
treefef367b2b6a94148b0207ad13acd53e42d49bea1 /lib/puppet/node
parentab27da7967e1e145d5fbc130e5fbcec6795ca775 (diff)
downloadpuppet-23fc4db954c22bce2c6cc8996d5fafb175e2b747.tar.gz
puppet-23fc4db954c22bce2c6cc8996d5fafb175e2b747.tar.xz
puppet-23fc4db954c22bce2c6cc8996d5fafb175e2b747.zip
(#5132) Provide a query REST interface for inventory
This REST interface returns a list of nodes that match a fact query. Fact queries can use (in)equality testing as a string comparison, and >, <, >=, <= numerical comparisons. Multiple tests can be done as AND comparisons, not OR. The fact queries need to be prefixed by facts, and the comparisons other than equality are specified with a .comparison_type after the fact name. This will be better explained in the REST documentation on the website. Searches that don't match anything now return empty array instead of a 404 error. Conflicts: spec/spec_helper.rb
Diffstat (limited to 'lib/puppet/node')
-rw-r--r--lib/puppet/node/inventory.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/node/inventory.rb b/lib/puppet/node/inventory.rb
new file mode 100644
index 000000000..fd99163b0
--- /dev/null
+++ b/lib/puppet/node/inventory.rb
@@ -0,0 +1,7 @@
+require 'puppet/node'
+require 'puppet/indirector'
+
+class Puppet::Node::Inventory
+ extend Puppet::Indirector
+ indirects :inventory, :terminus_setting => :inventory_terminus
+end