X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FRPC%2FHelpers.html;fp=doc%2Fclasses%2FMCollective%2FRPC%2FHelpers.html;h=18f9afee378f7aec14dfe57018ae193ef9a72d75;hb=refs%2Fheads%2Fhavana;hp=5e06bcefe02d7e85296927761f1b00284f48f59b;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/RPC/Helpers.html b/doc/MCollective/RPC/Helpers.html similarity index 68% rename from doc/classes/MCollective/RPC/Helpers.html rename to doc/MCollective/RPC/Helpers.html index 5e06bce..18f9afe 100644 --- a/doc/classes/MCollective/RPC/Helpers.html +++ b/doc/MCollective/RPC/Helpers.html @@ -1,141 +1,381 @@ - - - + +
-Class | -MCollective::RPC::Helpers | -
In: | -
-
- lib/mcollective/rpc/helpers.rb
-
- - |
-
Parent: | -- Object - | -
+ +
+ +Various utilities for the RPC system
-+
Add SimpleRPC common options
- -# File lib/mcollective/rpc/helpers.rb, line 254 254: def self.add_simplerpc_options(parser, options) @@ -187,29 +427,37 @@ Add SimpleRPC common options 300: 301: raise "--display has to be one of 'ok', 'all' or 'failed'" unless [:ok, :failed, :always].include?(options[:force_display_mode]) 302: end -303: end --
Given an array of something, make sure each is a string chomp off any new lines and return just the array of hosts
- -# File lib/mcollective/rpc/helpers.rb, line 29 29: def self.extract_hosts_from_array(hosts) @@ -217,25 +465,31 @@ lines and return just the array of hosts 31: raise "#{host} should be a string" unless host.is_a?(String) 32: host.chomp 33: end -34: end --
Parse JSON output as produced by printrpc and extract the -"sender" of each rpc response +“sender” of each rpc response
The simplist valid JSON based data would be: @@ -250,9 +504,11 @@ The simplist valid JSON based data would be:
]
- -# File lib/mcollective/rpc/helpers.rb, line 14 14: def self.extract_hosts_from_json(json) @@ -266,29 +522,37 @@ The simplist valid JSON based data would be: 22: 23: host["sender"] 24: end.uniq -25: end --
Backward compatible display block for results without a DDL
- -# File lib/mcollective/rpc/helpers.rb, line 202 202: def self.old_rpcresults(result, flags = {}) @@ -340,23 +604,29 @@ href="../DDL.html">DDL 248: end 249: 250: result_text << "" -251: end --
Returns a blob of text representing the results in a standard way
@@ -378,13 +648,15 @@ flags: printrpc exim.mailq, :verbose => true
-If you‘ve asked it to flatten the result it will not print sender -hostnames, it will just print the result as if it‘s one huge result, +If you’ve asked it to flatten the result it will not print sender +hostnames, it will just print the result as if it’s one huge result, handy for things like showing a combined mailq.
- -# File lib/mcollective/rpc/helpers.rb, line 54 54: def self.rpcresults(result, flags = {}) @@ -449,28 +721,36 @@ handy for things like showing a combined mailq. 113: end 114: 115: result_text -116: end --
Returns text representing a flattened result of only good data
- -# File lib/mcollective/rpc/helpers.rb, line 189 189: def self.text_for_flattened_result(status, result) @@ -483,28 +763,36 @@ Returns text representing a flattened result of only good data 196: result_text << result 197: end 198: end -199: end --
Return text representing a result
- -# File lib/mcollective/rpc/helpers.rb, line 119 119: def self.text_for_result(sender, status, msg, result, ddl) @@ -574,22 +862,33 @@ Return text representing a result 183: 184: result_text << "\n" 185: result_text -186: end --
Disabled; run with --debug to generate this.
+ +Generated with the Darkfish + Rdoc Generator 1.1.6.
+