| Server IP : 77.68.64.21 / Your IP : 216.73.217.105 Web Server : Apache System : Linux hp3-wp-1011378.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64 User : csh2668128 ( 2112425) PHP Version : 8.1.34 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/ruby/vendor_ruby/puppet/face/ |
Upload File : |
require 'puppet/indirector/face'
Puppet::Indirector::Face.define(:report, '0.0.1') do
copyright "Puppet Labs", 2011
license "Apache 2 license; see COPYING"
summary "Create, display, and submit reports."
get_action(:find).summary "Invalid for this face."
get_action(:search).summary "Invalid for this face."
get_action(:destroy).summary "Invalid for this face."
save = get_action(:save)
save.summary "API only: submit a report."
save.arguments "<report>"
save.returns "Nothing."
save.examples <<-'EOT'
From the implementation of `puppet report submit` (API example):
begin
Puppet::Transaction::Report.indirection.terminus_class = :rest
Puppet::Face[:report, "0.0.1"].save(report)
Puppet.notice "Uploaded report for #{report.name}"
rescue => detail
Puppet.log_exception(detail, "Could not send report: #{detail}")
end
EOT
action(:submit) do
summary "API only: submit a report with error handling."
description <<-'EOT'
API only: Submits a report to the puppet master. This action is
essentially a shortcut and wrapper for the `save` action with the `rest`
terminus, and provides additional details in the event of a failure.
EOT
arguments "<report>"
examples <<-'EOT'
From secret_agent.rb (API example):
# ...
report = Puppet::Face[:catalog, '0.0.1'].apply
Puppet::Face[:report, '0.0.1'].submit(report)
return report
EOT
when_invoked do |report, options|
begin
Puppet::Transaction::Report.indirection.terminus_class = :rest
Puppet::Face[:report, "0.0.1"].save(report)
Puppet.notice "Uploaded report for #{report.name}"
rescue => detail
Puppet.log_exception(detail, "Could not send report: #{detail}")
end
end
end
end