diff --git a/lib/puppet/face/instrumentation_data.rb b/lib/puppet/face/instrumentation_data.rb index c091f5542..05eb4fdb6 100644 --- a/lib/puppet/face/instrumentation_data.rb +++ b/lib/puppet/face/instrumentation_data.rb @@ -1,29 +1,30 @@ require 'puppet/indirector/face' require 'puppet/util/instrumentation/data' Puppet::Indirector::Face.define(:instrumentation_data, '0.0.1') do copyright "Puppet Labs", 2011 license "Apache 2 license; see COPYING" - summary "Manage instrumentation listener accumulated data." + summary "Manage instrumentation listener accumulated data. DEPRECATED." description <<-EOT This subcommand allows to retrieve the various listener data. + (DEPRECATED) This subcommand will be removed in Puppet 4.0. EOT get_action(:destroy).summary "Invalid for this subcommand." get_action(:save).summary "Invalid for this subcommand." get_action(:search).summary "Invalid for this subcommand." find = get_action(:find) find.summary "Retrieve listener data." find.render_as = :pson find.returns <<-EOT The data of an instrumentation listener EOT find.examples <<-EOT Retrieve listener data: $ puppet instrumentation_data find performance --terminus rest EOT end diff --git a/lib/puppet/face/instrumentation_listener.rb b/lib/puppet/face/instrumentation_listener.rb index 53b61bef7..e11ef407f 100644 --- a/lib/puppet/face/instrumentation_listener.rb +++ b/lib/puppet/face/instrumentation_listener.rb @@ -1,97 +1,98 @@ require 'puppet/indirector/face' require 'puppet/util/instrumentation/listener' Puppet::Indirector::Face.define(:instrumentation_listener, '0.0.1') do copyright "Puppet Labs", 2011 license "Apache 2 license; see COPYING" - summary "Manage instrumentation listeners." + summary "Manage instrumentation listeners. DEPRECATED." description <<-EOT This subcommand enables/disables or list instrumentation listeners. + (DEPRECATED) This subcommand will be removed in Puppet 4.0. EOT get_action(:destroy).summary "Invalid for this subcommand." find = get_action(:find) find.summary "Retrieve a single listener." find.render_as = :pson find.returns <<-EOT The status of an instrumentation listener EOT find.examples <<-EOT Retrieve a given listener: $ puppet instrumentation_listener find performance --terminus rest EOT search = get_action(:search) search.summary "Retrieve all instrumentation listeners statuses." search.arguments "" search.render_as = :pson search.returns <<-EOT The statuses of all instrumentation listeners EOT search.short_description <<-EOT This retrieves all instrumentation listeners EOT search.notes <<-EOT Although this action always returns all instrumentation listeners, it requires a dummy search key; this is a known bug. EOT search.examples <<-EOT Retrieve the state of the listeners running in the remote puppet master: $ puppet instrumentation_listener search x --terminus rest EOT def manage(name, activate) Puppet::Util::Instrumentation::Listener.indirection.terminus_class = :rest listener = Puppet::Face[:instrumentation_listener, '0.0.1'].find(name) if listener listener.enabled = activate Puppet::Face[:instrumentation_listener, '0.0.1'].save(listener) end end action :enable do summary "Enable a given instrumentation listener." arguments "" returns "Nothing." description <<-EOT Enable a given instrumentation listener. After being enabled the listener will start receiving instrumentation notifications from the probes if those are enabled. EOT examples <<-EOT Enable the "performance" listener in the running master: $ puppet instrumentation_listener enable performance --terminus rest EOT when_invoked do |name, options| manage(name, true) end end action :disable do summary "Disable a given instrumentation listener." arguments "" returns "Nothing." description <<-EOT Disable a given instrumentation listener. After being disabled the listener will stop receiving instrumentation notifications from the probes. EOT examples <<-EOT Disable the "performance" listener in the running master: $ puppet instrumentation_listener disable performance --terminus rest EOT when_invoked do |name, options| manage(name, false) end end get_action(:save).summary "API only: modify an instrumentation listener status." get_action(:save).arguments "" end diff --git a/lib/puppet/face/instrumentation_probe.rb b/lib/puppet/face/instrumentation_probe.rb index 840eac70a..b77f5e977 100644 --- a/lib/puppet/face/instrumentation_probe.rb +++ b/lib/puppet/face/instrumentation_probe.rb @@ -1,78 +1,79 @@ require 'puppet/indirector/face' require 'puppet/util/instrumentation/indirection_probe' Puppet::Indirector::Face.define(:instrumentation_probe, '0.0.1') do copyright "Puppet Labs", 2011 license "Apache 2 license; see COPYING" - summary "Manage instrumentation probes." + summary "Manage instrumentation probes. Deprecated" description <<-EOT This subcommand enables/disables or list instrumentation listeners. + (DEPRECATED) This subcommand will be removed in Puppet 4.0. EOT get_action(:find).summary "Invalid for this subcommand." search = get_action(:search) search.summary "Retrieve all probe statuses." search.arguments "" search.render_as = :pson search.returns <<-EOT The statuses of all instrumentation probes EOT search.short_description <<-EOT This retrieves all instrumentation probes EOT search.notes <<-EOT Although this action always returns all instrumentation probes, it requires a dummy search key; this is a known bug. EOT search.examples <<-EOT Retrieve the state of the probes running in the remote puppet master: $ puppet instrumentation_probe search x --terminus rest EOT action :enable do summary "Enable all instrumentation probes." arguments "" returns "Nothing." description <<-EOT Enable all instrumentation probes. After being enabled, all enabled listeners will start receiving instrumentation notifications from the probes. EOT examples <<-EOT Enable the probes for the running master: $ puppet instrumentation_probe enable x --terminus rest EOT when_invoked do |name, options| Puppet::Face[:instrumentation_probe, '0.0.1'].save(nil) end end action :disable do summary "Disable all instrumentation probes." arguments "" returns "Nothing." description <<-EOT Disable all instrumentation probes. After being disabled, no listeners will receive instrumentation notifications. EOT examples <<-EOT Disable the probes for the running master: $ puppet instrumentation_probe disable x --terminus rest EOT when_invoked do |name, options| Puppet::Face[:instrumentation_probe, '0.0.1'].destroy(nil) end end get_action(:save).summary "API only: enable all instrumentation probes." get_action(:save).arguments "" get_action(:destroy).summary "API only: disable all instrumentation probes." get_action(:destroy).arguments "" end