Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / RPC.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
8         <title>Module: MCollective::RPC</title>
9
10         <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
12         <script src="../js/jquery.js" type="text/javascript"
13                 charset="utf-8"></script>
14         <script src="../js/thickbox-compressed.js" type="text/javascript"
15                 charset="utf-8"></script>
16         <script src="../js/quicksearch.js" type="text/javascript"
17                 charset="utf-8"></script>
18         <script src="../js/darkfish.js" type="text/javascript"
19                 charset="utf-8"></script>
20
21 </head>
22 <body class="module">
23
24         <div id="metadata">
25                 <div id="file-metadata">
26                         <div id="file-list-section" class="section">
27                                 <h3 class="section-header">In Files</h3>
28                                 <div class="section-body">
29                                         <ul>
30                                         
31                                                 <li><a href="../lib/mcollective/rpc_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/rpc.rb">lib/mcollective/rpc.rb</a></li>
33                                         
34                                                 <li><a href="../lib/mcollective/rpc/actionrunner_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
35                                                         class="thickbox" title="lib/mcollective/rpc/actionrunner.rb">lib/mcollective/rpc/actionrunner.rb</a></li>
36                                         
37                                                 <li><a href="../lib/mcollective/rpc/reply_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38                                                         class="thickbox" title="lib/mcollective/rpc/reply.rb">lib/mcollective/rpc/reply.rb</a></li>
39                                         
40                                                 <li><a href="../lib/mcollective/rpc/progress_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
41                                                         class="thickbox" title="lib/mcollective/rpc/progress.rb">lib/mcollective/rpc/progress.rb</a></li>
42                                         
43                                                 <li><a href="../lib/mcollective/rpc/agent_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
44                                                         class="thickbox" title="lib/mcollective/rpc/agent.rb">lib/mcollective/rpc/agent.rb</a></li>
45                                         
46                                                 <li><a href="../lib/mcollective/rpc/request_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
47                                                         class="thickbox" title="lib/mcollective/rpc/request.rb">lib/mcollective/rpc/request.rb</a></li>
48                                         
49                                                 <li><a href="../lib/mcollective/rpc/audit_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
50                                                         class="thickbox" title="lib/mcollective/rpc/audit.rb">lib/mcollective/rpc/audit.rb</a></li>
51                                         
52                                                 <li><a href="../lib/mcollective/rpc/stats_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
53                                                         class="thickbox" title="lib/mcollective/rpc/stats.rb">lib/mcollective/rpc/stats.rb</a></li>
54                                         
55                                                 <li><a href="../lib/mcollective/rpc/result_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
56                                                         class="thickbox" title="lib/mcollective/rpc/result.rb">lib/mcollective/rpc/result.rb</a></li>
57                                         
58                                                 <li><a href="../lib/mcollective/rpc/helpers_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
59                                                         class="thickbox" title="lib/mcollective/rpc/helpers.rb">lib/mcollective/rpc/helpers.rb</a></li>
60                                         
61                                                 <li><a href="../lib/mcollective/rpc/client_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
62                                                         class="thickbox" title="lib/mcollective/rpc/client.rb">lib/mcollective/rpc/client.rb</a></li>
63                                         
64                                         </ul>
65                                 </div>
66                         </div>
67
68                         
69                 </div>
70
71                 <div id="class-metadata">
72
73                         <!-- Parent Class -->
74                         
75
76                         <!-- Namespace Contents -->
77                         
78                         <div id="namespace-list-section" class="section">
79                                 <h3 class="section-header">Namespace</h3>
80                                 <ul class="link-list">
81                                         
82                                         <li><span class="type">CLASS</span> <a href="RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
83                                         
84                                         <li><span class="type">CLASS</span> <a href="RPC/Agent.html">MCollective::RPC::Agent</a></li>
85                                         
86                                         <li><span class="type">CLASS</span> <a href="RPC/Audit.html">MCollective::RPC::Audit</a></li>
87                                         
88                                         <li><span class="type">CLASS</span> <a href="RPC/Client.html">MCollective::RPC::Client</a></li>
89                                         
90                                         <li><span class="type">CLASS</span> <a href="RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
91                                         
92                                         <li><span class="type">CLASS</span> <a href="RPC/Progress.html">MCollective::RPC::Progress</a></li>
93                                         
94                                         <li><span class="type">CLASS</span> <a href="RPC/Reply.html">MCollective::RPC::Reply</a></li>
95                                         
96                                         <li><span class="type">CLASS</span> <a href="RPC/Request.html">MCollective::RPC::Request</a></li>
97                                         
98                                         <li><span class="type">CLASS</span> <a href="RPC/Result.html">MCollective::RPC::Result</a></li>
99                                         
100                                         <li><span class="type">CLASS</span> <a href="RPC/Stats.html">MCollective::RPC::Stats</a></li>
101                                         
102                                 </ul>
103                         </div>
104                         
105
106                         <!-- Method Quickref -->
107                         
108                         <div id="method-list-section" class="section">
109                                 <h3 class="section-header">Methods</h3>
110                                 <ul class="link-list">
111                                         
112                                         <li><a href="#M000327">::const_missing</a></li>
113                                         
114                                         <li><a href="#M000320">::discovered</a></li>
115                                         
116                                         <li><a href="#M000319">::stats</a></li>
117                                         
118                                         <li><a href="#M000324">#empty_filter?</a></li>
119                                         
120                                         <li><a href="#M000323">#printrpc</a></li>
121                                         
122                                         <li><a href="#M000321">#printrpcstats</a></li>
123                                         
124                                         <li><a href="#M000314">#rpcclient</a></li>
125                                         
126                                         <li><a href="#M000310">#rpcoptions</a></li>
127                                         
128                                 </ul>
129                         </div>
130                         
131
132                         <!-- Included Modules -->
133                         
134                 </div>
135
136                 <div id="project-metadata">
137                         
138                         
139                         <div id="fileindex-section" class="section project-section">
140                                 <h3 class="section-header">Files</h3>
141                                 <ul>
142                                 
143                                         <li class="file"><a href="../COPYING.html">COPYING</a></li>
144                                 
145                                         <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
146                                 
147                                         <li class="file"><a href="../README.html">README</a></li>
148                                 
149                                         <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
150                                 
151                                         <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
152                                 
153                                         <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
154                                 
155                                         <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
156                                 
157                                         <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
158                                 
159                                         <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
160                                 
161                                         <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
162                                 
163                                         <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
164                                 
165                                         <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
166                                 
167                                         <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
168                                 
169                                         <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
170                                 
171                                         <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
172                                 
173                                         <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
174                                 
175                                         <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
176                                 
177                                         <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
178                                 
179                                         <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
180                                 
181                                         <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
182                                 
183                                 </ul>
184                         </div>
185                         
186
187                         <div id="classindex-section" class="section project-section">
188                                 <h3 class="section-header">Class Index
189                                         <span class="search-toggle"><img src="../images/find.png"
190                                                 height="16" width="16" alt="[+]"
191                                                 title="show/hide quicksearch" /></span></h3>
192                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
193                                 <fieldset>
194                                         <legend>Quicksearch</legend>
195                                         <input type="text" name="quicksearch" value=""
196                                                 class="quicksearch-field" />
197                                 </fieldset>
198                                 </form>
199
200                                 <ul class="link-list">
201                                 
202                                         <li><a href="../MCollective.html">MCollective</a></li>
203                                 
204                                         <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
205                                 
206                                         <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
207                                 
208                                         <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
209                                 
210                                         <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
211                                 
212                                         <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
213                                 
214                                         <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
215                                 
216                                         <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
217                                 
218                                         <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
219                                 
220                                         <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
221                                 
222                                         <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
223                                 
224                                         <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
225                                 
226                                         <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
227                                 
228                                         <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
229                                 
230                                         <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
231                                 
232                                         <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
233                                 
234                                         <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
235                                 
236                                         <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
237                                 
238                                         <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
239                                 
240                                         <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
241                                 
242                                         <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
243                                 
244                                         <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
245                                 
246                                         <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
247                                 
248                                         <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
249                                 
250                                         <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
251                                 
252                                         <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
253                                 
254                                         <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
255                                 
256                                         <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
257                                 
258                                         <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
259                                 
260                                         <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
261                                 
262                                         <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
263                                 
264                                         <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
265                                 
266                                         <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
267                                 
268                                         <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
269                                 
270                                         <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
271                                 
272                                         <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
273                                 
274                                         <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
275                                 
276                                         <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
277                                 
278                                         <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
279                                 
280                                         <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
281                                 
282                                         <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
283                                 
284                                         <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
285                                 
286                                         <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
287                                 
288                                         <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
289                                 
290                                         <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
291                                 
292                                         <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
293                                 
294                                         <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
295                                 
296                                         <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
297                                 
298                                         <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
299                                 
300                                         <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
301                                 
302                                         <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
303                                 
304                                         <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
305                                 
306                                         <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
307                                 
308                                         <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
309                                 
310                                         <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
311                                 
312                                         <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
313                                 
314                                         <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
315                                 
316                                         <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
317                                 
318                                         <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
319                                 
320                                         <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
321                                 
322                                         <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
323                                 
324                                         <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
325                                 
326                                         <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
327                                 
328                                         <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
329                                 
330                                         <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
331                                 
332                                         <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
333                                 
334                                         <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
335                                 
336                                         <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
337                                 
338                                         <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
339                                 
340                                         <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
341                                 
342                                         <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
343                                 
344                                         <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
345                                 
346                                         <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
347                                 
348                                         <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
349                                 
350                                         <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
351                                 
352                                         <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
353                                 
354                                         <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
355                                 
356                                         <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
357                                 
358                                         <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
359                                 
360                                         <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
361                                 
362                                         <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
363                                 
364                                         <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
365                                 
366                                         <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
367                                 
368                                         <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
369                                 
370                                         <li><a href="../Array.html">Array</a></li>
371                                 
372                                         <li><a href="../Dir.html">Dir</a></li>
373                                 
374                                         <li><a href="../Object.html">Object</a></li>
375                                 
376                                         <li><a href="../String.html">String</a></li>
377                                 
378                                         <li><a href="../Symbol.html">Symbol</a></li>
379                                 
380                                 </ul>
381                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
382                         </div>
383
384                         
385                 </div>
386         </div>
387
388         <div id="documentation">
389                 <h1 class="module">MCollective::RPC</h1>
390
391                 <div id="description">
392                         <p>
393 Toolset to create a standard interface of client and agent using an <a
394 href="RPC.html">RPC</a> metaphor, standard compliant agents will make it
395 easier to create generic clients like web interfaces etc
396 </p>
397
398                 </div>
399
400                 <!-- Constants -->
401                 
402
403                 <!-- Attributes -->
404                 
405
406                 <!-- Methods -->
407                 
408                 <div id="public-class-method-details" class="method-section section">
409                         <h3 class="section-header">Public Class Methods</h3>
410
411                 
412                         <div id="const-missing-method" class="method-detail ">
413                                 <a name="M000327"></a>
414
415                                 <div class="method-heading">
416                                 
417                                         <span class="method-name">const_missing</span><span
418                                                 class="method-args">(const_name)</span>
419                                         <span class="method-click-advice">click to toggle source</span>
420                                 
421                                 </div>
422
423                                 <div class="method-description">
424                                         
425                                         <p class="missing-docs">(Not documented)</p>
426                                         
427
428                                         
429                                         <div class="method-source-code"
430                                                 id="const-missing-source">
431 <pre>
432      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 175</span>
433 175:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">const_missing</span>(<span class="ruby-identifier">const_name</span>)
434 176:       <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">const_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:DDL</span>
435 177: 
436 178:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;MCollective::RPC::DDL is deprecatd, please use MCollective::DDL instead&quot;</span>)
437 179:       <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">DDL</span>
438 180:     <span class="ruby-keyword kw">end</span></pre>
439                                         </div>
440                                         
441                                 </div>
442
443                                 
444                         </div>
445
446                 
447                         <div id="discovered-method" class="method-detail ">
448                                 <a name="M000320"></a>
449
450                                 <div class="method-heading">
451                                 
452                                         <span class="method-name">discovered</span><span
453                                                 class="method-args">(discovered)</span>
454                                         <span class="method-click-advice">click to toggle source</span>
455                                 
456                                 </div>
457
458                                 <div class="method-description">
459                                         
460                                         <p>
461 means for other classes to drop discovered hosts into this module its a bit
462 hacky but needed so that the mixin methods like printrpcstats can easily
463 get access to it without users having to pass it around in params.
464 </p>
465                                         
466
467                                         
468                                         <div class="method-source-code"
469                                                 id="discovered-source">
470 <pre>
471      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 107</span>
472 107:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">discovered</span>(<span class="ruby-identifier">discovered</span>)
473 108:       <span class="ruby-ivar">@@discovered</span> = <span class="ruby-identifier">discovered</span>
474 109:     <span class="ruby-keyword kw">end</span></pre>
475                                         </div>
476                                         
477                                 </div>
478
479                                 
480                         </div>
481
482                 
483                         <div id="stats-method" class="method-detail ">
484                                 <a name="M000319"></a>
485
486                                 <div class="method-heading">
487                                 
488                                         <span class="method-name">stats</span><span
489                                                 class="method-args">(stats)</span>
490                                         <span class="method-click-advice">click to toggle source</span>
491                                 
492                                 </div>
493
494                                 <div class="method-description">
495                                         
496                                         <p>
497 means for other classes to drop stats into this module its a bit hacky but
498 needed so that the mixin methods like printrpcstats can easily get access
499 to it without users having to pass it around in params.
500 </p>
501                                         
502
503                                         
504                                         <div class="method-source-code"
505                                                 id="stats-source">
506 <pre>
507      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 99</span>
508  99:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-identifier">stats</span>)
509 100:       <span class="ruby-ivar">@@stats</span> = <span class="ruby-identifier">stats</span>
510 101:     <span class="ruby-keyword kw">end</span></pre>
511                                         </div>
512                                         
513                                 </div>
514
515                                 
516                         </div>
517
518                 
519                 </div>
520         
521                 <div id="public-instance-method-details" class="method-section section">
522                         <h3 class="section-header">Public Instance Methods</h3>
523
524                 
525                         <div id="empty-filter--method" class="method-detail ">
526                                 <a name="M000324"></a>
527
528                                 <div class="method-heading">
529                                 
530                                         <span class="method-name">empty_filter?</span><span
531                                                 class="method-args">(options)</span>
532                                         <span class="method-click-advice">click to toggle source</span>
533                                 
534                                 </div>
535
536                                 <div class="method-description">
537                                         
538                                         <p>
539 Wrapper for <a href="Util.html#M000300">MCollective::Util.empty_filter?</a>
540 to make clients less fugly to write - ticket 18
541 </p>
542                                         
543
544                                         
545                                         <div class="method-source-code"
546                                                 id="empty-filter--source">
547 <pre>
548      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 167</span>
549 167:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>)
550 168:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:filter</span>)
551 169:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
552 170:       <span class="ruby-keyword kw">else</span>
553 171:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>)
554 172:       <span class="ruby-keyword kw">end</span>
555 173:     <span class="ruby-keyword kw">end</span></pre>
556                                         </div>
557                                         
558                                 </div>
559
560                                 
561                         </div>
562
563                 
564                         <div id="printrpc-method" class="method-detail ">
565                                 <a name="M000323"></a>
566
567                                 <div class="method-heading">
568                                 
569                                         <span class="method-name">printrpc</span><span
570                                                 class="method-args">(result, flags = {})</span>
571                                         <span class="method-click-advice">click to toggle source</span>
572                                 
573                                 </div>
574
575                                 <div class="method-description">
576                                         
577                                         <p>
578 Prints the result of an <a href="RPC.html">RPC</a> call.
579 </p>
580 <p>
581 In the default quiet mode - no flattening or verbose - only results that
582 produce an error will be printed
583 </p>
584 <p>
585 To get details of each result run with the -v command line option.
586 </p>
587                                         
588
589                                         
590                                         <div class="method-source-code"
591                                                 id="printrpc-source">
592 <pre>
593      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 146</span>
594 146:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">printrpc</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span> = {})
595 147:       <span class="ruby-identifier">verbose</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>
596 148:       <span class="ruby-identifier">verbose</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">verbose</span>
597 149:       <span class="ruby-identifier">flatten</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:flatten</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
598 150:       <span class="ruby-identifier">format</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:output_format</span>]
599 151:       <span class="ruby-identifier">forced_mode</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:force_display_mode</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
600 152: 
601 153:       <span class="ruby-identifier">result_text</span> =  <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">rpcresults</span>(<span class="ruby-identifier">result</span>, {<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">:flatten</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">flatten</span>, <span class="ruby-identifier">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">format</span>, <span class="ruby-identifier">:force_display_mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">forced_mode</span>})
602 154: 
603 155:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
604 156:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\n%s\n&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-identifier">result_text</span> ]
605 157:       <span class="ruby-keyword kw">else</span>
606 158:         <span class="ruby-comment cmt"># when we get just one result to print dont pad them all with</span>
607 159:         <span class="ruby-comment cmt"># blank spaces etc, just print the individual result with no</span>
608 160:         <span class="ruby-comment cmt"># padding</span>
609 161:         <span class="ruby-identifier">puts</span> <span class="ruby-identifier">result_text</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">result_text</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
610 162:       <span class="ruby-keyword kw">end</span>
611 163:     <span class="ruby-keyword kw">end</span></pre>
612                                         </div>
613                                         
614                                 </div>
615
616                                 
617                         </div>
618
619                 
620                         <div id="printrpcstats-method" class="method-detail ">
621                                 <a name="M000321"></a>
622
623                                 <div class="method-heading">
624                                 
625                                         <span class="method-name">printrpcstats</span><span
626                                                 class="method-args">(flags={})</span>
627                                         <span class="method-click-advice">click to toggle source</span>
628                                 
629                                 </div>
630
631                                 <div class="method-description">
632                                         
633                                         <p>
634 Prints stats, requires stats to be saved from elsewhere using the <a
635 href="RPC.html#M000319">MCollective::RPC.stats</a> method.
636 </p>
637 <p>
638 If you&#8217;ve passed -v on the command line a detailed stat block will be
639 printed, else just a one liner.
640 </p>
641 <p>
642 You can pass flags into it:
643 </p>
644 <pre>
645   printrpcstats :caption =&gt; &quot;Foo&quot;, :summarize =&gt; true
646 </pre>
647 <p>
648 This will use &#8220;Foo&#8221; as the caption to the stats in verbose mode
649 and print out any aggregate summary information if present
650 </p>
651                                         
652
653                                         
654                                         <div class="method-source-code"
655                                                 id="printrpcstats-source">
656 <pre>
657      <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 123</span>
658 123:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">printrpcstats</span>(<span class="ruby-identifier">flags</span>={})
659 124:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
660 125: 
661 126:       <span class="ruby-identifier">flags</span> = {<span class="ruby-identifier">:summarize</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:caption</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rpc stats&quot;</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">flags</span>)
662 127: 
663 128:       <span class="ruby-identifier">verbose</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>
664 129: 
665 130:       <span class="ruby-keyword kw">begin</span>
666 131:         <span class="ruby-identifier">stats</span> = <span class="ruby-ivar">@@stats</span>
667 132:       <span class="ruby-keyword kw">rescue</span>
668 133:         <span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;no stats to display&quot;</span>)
669 134:         <span class="ruby-keyword kw">return</span>
670 135:       <span class="ruby-keyword kw">end</span>
671 136: 
672 137:       <span class="ruby-identifier">puts</span> <span class="ruby-identifier">stats</span>.<span class="ruby-identifier">report</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:caption</span>], <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:summarize</span>], <span class="ruby-identifier">verbose</span>)
673 138:     <span class="ruby-keyword kw">end</span></pre>
674                                         </div>
675                                         
676                                 </div>
677
678                                 
679                         </div>
680
681                 
682                         <div id="rpcclient-method" class="method-detail ">
683                                 <a name="M000314"></a>
684
685                                 <div class="method-heading">
686                                 
687                                         <span class="method-name">rpcclient</span><span
688                                                 class="method-args">(agent, flags = {})</span>
689                                         <span class="method-click-advice">click to toggle source</span>
690                                 
691                                 </div>
692
693                                 <div class="method-description">
694                                         
695                                         <p>
696 Wrapper to create clients, supposed to be used as a mixin:
697 </p>
698 <p>
699 include <a href="RPC.html">MCollective::RPC</a>
700 </p>
701 <p>
702 exim = rpcclient(&#8220;exim&#8221;) printrpc exim.mailq
703 </p>
704 <p>
705 or
706 </p>
707 <p>
708 rpcclient(&#8220;exim&#8221;) do |exim|
709 </p>
710 <pre>
711    printrpc exim.mailq
712 </pre>
713 <p>
714 end
715 </p>
716 <p>
717 It will take a few flags:
718 </p>
719 <pre>
720    :configfile =&gt; &quot;etc/client.cfg&quot;
721    :options =&gt; options
722    :exit_on_failure =&gt; true
723 </pre>
724 <p>
725 Options would be a build up options hash from the <a
726 href="Optionparser.html">Optionparser</a> you can use the rpcoptions helper
727 to create this
728 </p>
729 <p>
730 :exit_on_failure is true by default, and causes the application to exit if
731 there is a failure constructing the <a href="RPC.html">RPC</a> client. Set
732 this flag to false to cause an Exception to be raised instead.
733 </p>
734                                         
735
736                                         
737                                         <div class="method-source-code"
738                                                 id="rpcclient-source">
739 <pre>
740     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 60</span>
741 60:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpcclient</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">flags</span> = {})
742 61:       <span class="ruby-identifier">configfile</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:configfile</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;/etc/mcollective/client.cfg&quot;</span>
743 62:       <span class="ruby-identifier">options</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">nil</span>
744 63: 
745 64:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">:exit_on_failure</span>)
746 65:         <span class="ruby-identifier">exit_on_failure</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:exit_on_failure</span>]
747 66:       <span class="ruby-keyword kw">else</span>
748 67:         <span class="ruby-comment cmt"># We exit on failure by default for CLI-friendliness</span>
749 68:         <span class="ruby-identifier">exit_on_failure</span> = <span class="ruby-keyword kw">true</span>
750 69:       <span class="ruby-keyword kw">end</span>
751 70: 
752 71:       <span class="ruby-keyword kw">begin</span>
753 72:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>
754 73:           <span class="ruby-identifier">rpc</span> = <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:configfile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>)
755 74:           <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">rpc</span>.<span class="ruby-identifier">options</span>
756 75:         <span class="ruby-keyword kw">else</span>
757 76:           <span class="ruby-identifier">rpc</span> = <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:configfile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">configfile</span>)
758 77:           <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">rpc</span>.<span class="ruby-identifier">options</span>
759 78:         <span class="ruby-keyword kw">end</span>
760 79:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
761 80:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exit_on_failure</span>
762 81:           <span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;Could not create RPC client: #{e}&quot;</span>)
763 82:           <span class="ruby-identifier">exit!</span>
764 83:         <span class="ruby-keyword kw">else</span>
765 84:           <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
766 85:         <span class="ruby-keyword kw">end</span>
767 86:       <span class="ruby-keyword kw">end</span>
768 87: 
769 88:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
770 89:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">rpc</span>)
771 90:       <span class="ruby-keyword kw">else</span>
772 91:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rpc</span>
773 92:       <span class="ruby-keyword kw">end</span>
774 93:     <span class="ruby-keyword kw">end</span></pre>
775                                         </div>
776                                         
777                                 </div>
778
779                                 
780                         </div>
781
782                 
783                         <div id="rpcoptions-method" class="method-detail ">
784                                 <a name="M000310"></a>
785
786                                 <div class="method-heading">
787                                 
788                                         <span class="method-name">rpcoptions</span><span
789                                                 class="method-args">()</span>
790                                         <span class="method-click-advice">click to toggle source</span>
791                                 
792                                 </div>
793
794                                 <div class="method-description">
795                                         
796                                         <p>
797 Creates a standard options hash, pass in a block to add extra headings etc
798 see <a href="Optionparser.html">Optionparser</a>
799 </p>
800                                         
801
802                                         
803                                         <div class="method-source-code"
804                                                 id="rpcoptions-source">
805 <pre>
806     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 21</span>
807 21:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpcoptions</span>
808 22:       <span class="ruby-identifier">oparser</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Optionparser</span>.<span class="ruby-identifier">new</span>({<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:progress_bar</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}, <span class="ruby-value str">&quot;filter&quot;</span>)
809 23: 
810 24:       <span class="ruby-identifier">options</span> = <span class="ruby-identifier">oparser</span>.<span class="ruby-identifier">parse</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
811 25:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
812 26:           <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>)
813 27:         <span class="ruby-keyword kw">end</span>
814 28: 
815 29:         <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">add_simplerpc_options</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>)
816 30:       <span class="ruby-keyword kw">end</span>
817 31: 
818 32:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
819 33:     <span class="ruby-keyword kw">end</span></pre>
820                                         </div>
821                                         
822                                 </div>
823
824                                 
825                         </div>
826
827                 
828                 </div>
829         
830
831         </div>
832
833
834         <div id="rdoc-debugging-section-dump" class="debugging-section">
835         
836                 <p>Disabled; run with --debug to generate this.</p>
837         
838         </div>
839
840         <div id="validator-badges">
841                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
842                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
843                         Rdoc Generator</a> 1.1.6</small>.</p>
844         </div>
845
846 </body>
847 </html>
848