summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/indirector/rest.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb
index 4c54183c6..690c79632 100644
--- a/lib/puppet/indirector/rest.rb
+++ b/lib/puppet/indirector/rest.rb
@@ -13,4 +13,12 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
raise YAML.load(network_result) if network_result =~ %r{--- !ruby/exception}
decoded_result = indirection.model.from_yaml(network_result)
end
+
+ def search(key, options = {})
+ network_results = network_fetch("#{indirection.name}s/#{key}")
+ raise YAML.load(network_results) if network_results =~ %r{--- !ruby/exception}
+ decoded_results = network_results.collect do |result|
+ indirection.model.from_yaml(result)
+ end
+ end
end