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=7c9314f502cde8daad23b61d10b24a542e04154a;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 - - - - - - - - - + -
- - - - - - - - - + Class: MCollective::RPC::Helpers - - - - -
ClassMCollective::RPC::Helpers
In: - - lib/mcollective/rpc/helpers.rb - -
-
Parent: - Object -
-
- + -
+ + + + - - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Helpers

+ +
+

Various utilities for the RPC system

-
- - -
- - - -
- - - - -
- +
+ + + + + + +
+

Public Class Methods

- + +
+ +
+ + add_simplerpc_options(parser, options) + click to toggle source + +
- -
-

Public Class methods

- -
- - - - -
-

+

+ +

Add SimpleRPC common options

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+303: end +

+ +
+ + +
+ + +
+ + +
+ + extract_hosts_from_array(hosts) + click to toggle source + +
+ +
+ +

Given an array of something, make sure each is a string chomp off any new lines and return just the array of hosts

-

[Source]

-
+ + + +
     # 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
-
-
-
-
- -
- - - - -
-

+34: end +

+ +
+ + +
+ + +
+ + +
+ + extract_hosts_from_json(json) + click to toggle source + +
+ +
+ +

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:

]

-

[Source]

-
+ + + +
     # 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
-
-
-
-
- -
- - - - -
-

+25: end +

+ +
+ + +
+ + +
+ + +
+ + old_rpcresults(result, flags = {}) + click to toggle source + +
+ +
+ +

Backward compatible display block for results without a DDL

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+251: end +

+ +
+ + +
+ + +
+ + +
+ + rpcresults(result, flags = {}) + click to toggle source + +
+ +
+ +

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.

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+116: end +

+ +
+ + +
+ + +
+ + +
+ + text_for_flattened_result(status, result) + click to toggle source + +
+ +
+ +

Returns text representing a flattened result of only good data

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- - + + +
+ + +
+ + +
+ + text_for_result(sender, status, msg, result, ddl) + click to toggle source + +
+ +
+ +

Return text representing a result

-

[Source]

-
+ + + +
      # 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
-
-
-
-
+186: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
-
-

[Validate]

-
+
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + +