Update version according to OSCI-856
[packages/precise/mcollective.git] / doc / MCollective / RPC / Client.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>Class: MCollective::RPC::Client</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="class">
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/client_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/rpc/client.rb">lib/mcollective/rpc/client.rb</a></li>
33                                         
34                                         </ul>
35                                 </div>
36                         </div>
37
38                         
39                 </div>
40
41                 <div id="class-metadata">
42
43                         <!-- Parent Class -->
44                         
45                         <div id="parent-class-section" class="section">
46                                 <h3 class="section-header">Parent</h3>
47                                 
48                                 <p class="link"><a href="../../Object.html">Object</a></p>
49                                 
50                         </div>
51                         
52
53                         <!-- Namespace Contents -->
54                         
55
56                         <!-- Method Quickref -->
57                         
58                         <div id="method-list-section" class="section">
59                                 <h3 class="section-header">Methods</h3>
60                                 <ul class="link-list">
61                                         
62                                         <li><a href="#M000443">::new</a></li>
63                                         
64                                         <li><a href="#M000461">#agent_filter</a></li>
65                                         
66                                         <li><a href="#M000475">#aggregate_reply</a></li>
67                                         
68                                         <li><a href="#M000471">#batch_size=</a></li>
69                                         
70                                         <li><a href="#M000472">#batch_sleep_time=</a></li>
71                                         
72                                         <li><a href="#M000480">#call_agent</a></li>
73                                         
74                                         <li><a href="#M000479">#call_agent_batched</a></li>
75                                         
76                                         <li><a href="#M000459">#class_filter</a></li>
77                                         
78                                         <li><a href="#M000468">#collective=</a></li>
79                                         
80                                         <li><a href="#M000463">#compound_filter</a></li>
81                                         
82                                         <li><a href="#M000454">#custom_request</a></li>
83                                         
84                                         <li><a href="#M000446">#disconnect</a></li>
85                                         
86                                         <li><a href="#M000466">#discover</a></li>
87                                         
88                                         <li><a href="#M000457">#discovery_method=</a></li>
89                                         
90                                         <li><a href="#M000458">#discovery_options=</a></li>
91                                         
92                                         <li><a href="#M000455">#discovery_timeout</a></li>
93                                         
94                                         <li><a href="#M000456">#discovery_timeout=</a></li>
95                                         
96                                         <li><a href="#M000460">#fact_filter</a></li>
97                                         
98                                         <li><a href="#M000477">#fire_and_forget_request</a></li>
99                                         
100                                         <li><a href="#M000447">#help</a></li>
101                                         
102                                         <li><a href="#M000462">#identity_filter</a></li>
103                                         
104                                         <li><a href="#M000478">#identity_filter_discovery_optimization</a></li>
105                                         
106                                         <li><a href="#M000470">#limit_method=</a></li>
107                                         
108                                         <li><a href="#M000469">#limit_targets=</a></li>
109                                         
110                                         <li><a href="#M000474">#load_aggregate_functions</a></li>
111                                         
112                                         <li><a href="#M000452">#method_missing</a></li>
113                                         
114                                         <li><a href="#M000448">#new_request</a></li>
115                                         
116                                         <li><a href="#M000467">#options</a></li>
117                                         
118                                         <li><a href="#M000473">#pick_nodes_from_discovered</a></li>
119                                         
120                                         <li><a href="#M000485">#process_results_with_block</a></li>
121                                         
122                                         <li><a href="#M000481">#process_results_without_block</a></li>
123                                         
124                                         <li><a href="#M000464">#reset</a></li>
125                                         
126                                         <li><a href="#M000465">#reset_filter</a></li>
127                                         
128                                         <li><a href="#M000476">#rpc_result_from_reply</a></li>
129                                         
130                                         <li><a href="#M000449">#validate_request</a></li>
131                                         
132                                 </ul>
133                         </div>
134                         
135
136                         <!-- Included Modules -->
137                         
138                 </div>
139
140                 <div id="project-metadata">
141                         
142                         
143                         <div id="fileindex-section" class="section project-section">
144                                 <h3 class="section-header">Files</h3>
145                                 <ul>
146                                 
147                                         <li class="file"><a href="../../COPYING.html">COPYING</a></li>
148                                 
149                                         <li class="file"><a href="../../Gemfile.html">Gemfile</a></li>
150                                 
151                                         <li class="file"><a href="../../README.html">README</a></li>
152                                 
153                                         <li class="file"><a href="../../Rakefile.html">Rakefile</a></li>
154                                 
155                                         <li class="file"><a href="../../etc/client_cfg_dist.html">client.cfg.dist</a></li>
156                                 
157                                         <li class="file"><a href="../../etc/data-help_erb.html">data-help.erb</a></li>
158                                 
159                                         <li class="file"><a href="../../etc/discovery-help_erb.html">discovery-help.erb</a></li>
160                                 
161                                         <li class="file"><a href="../../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
162                                 
163                                         <li class="file"><a href="../../etc/metadata-help_erb.html">metadata-help.erb</a></li>
164                                 
165                                         <li class="file"><a href="../../etc/msg-help_erb.html">msg-help.erb</a></li>
166                                 
167                                         <li class="file"><a href="../../etc/rpc-help_erb.html">rpc-help.erb</a></li>
168                                 
169                                         <li class="file"><a href="../../etc/server_cfg_dist.html">server.cfg.dist</a></li>
170                                 
171                                         <li class="file"><a href="../../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
172                                 
173                                         <li class="file"><a href="../../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
174                                 
175                                         <li class="file"><a href="../../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
176                                 
177                                         <li class="file"><a href="../../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
178                                 
179                                         <li class="file"><a href="../../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
180                                 
181                                         <li class="file"><a href="../../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
182                                 
183                                         <li class="file"><a href="../../lib/mcollective/locales/en_yml.html">en.yml</a></li>
184                                 
185                                         <li class="file"><a href="../../mcollective_init.html">mcollective.init</a></li>
186                                 
187                                 </ul>
188                         </div>
189                         
190
191                         <div id="classindex-section" class="section project-section">
192                                 <h3 class="section-header">Class Index
193                                         <span class="search-toggle"><img src="../../images/find.png"
194                                                 height="16" width="16" alt="[+]"
195                                                 title="show/hide quicksearch" /></span></h3>
196                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
197                                 <fieldset>
198                                         <legend>Quicksearch</legend>
199                                         <input type="text" name="quicksearch" value=""
200                                                 class="quicksearch-field" />
201                                 </fieldset>
202                                 </form>
203
204                                 <ul class="link-list">
205                                 
206                                         <li><a href="../../MCollective.html">MCollective</a></li>
207                                 
208                                         <li><a href="../../MCollective/Agent.html">MCollective::Agent</a></li>
209                                 
210                                         <li><a href="../../MCollective/Agents.html">MCollective::Agents</a></li>
211                                 
212                                         <li><a href="../../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
213                                 
214                                         <li><a href="../../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
215                                 
216                                         <li><a href="../../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
217                                 
218                                         <li><a href="../../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
219                                 
220                                         <li><a href="../../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
221                                 
222                                         <li><a href="../../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
223                                 
224                                         <li><a href="../../MCollective/Application.html">MCollective::Application</a></li>
225                                 
226                                         <li><a href="../../MCollective/Applications.html">MCollective::Applications</a></li>
227                                 
228                                         <li><a href="../../MCollective/Cache.html">MCollective::Cache</a></li>
229                                 
230                                         <li><a href="../../MCollective/Client.html">MCollective::Client</a></li>
231                                 
232                                         <li><a href="../../MCollective/CodedError.html">MCollective::CodedError</a></li>
233                                 
234                                         <li><a href="../../MCollective/Config.html">MCollective::Config</a></li>
235                                 
236                                         <li><a href="../../MCollective/Connector.html">MCollective::Connector</a></li>
237                                 
238                                         <li><a href="../../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
239                                 
240                                         <li><a href="../../MCollective/DDL.html">MCollective::DDL</a></li>
241                                 
242                                         <li><a href="../../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
243                                 
244                                         <li><a href="../../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
245                                 
246                                         <li><a href="../../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
247                                 
248                                         <li><a href="../../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
249                                 
250                                         <li><a href="../../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
251                                 
252                                         <li><a href="../../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
253                                 
254                                         <li><a href="../../MCollective/Data.html">MCollective::Data</a></li>
255                                 
256                                         <li><a href="../../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
257                                 
258                                         <li><a href="../../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
259                                 
260                                         <li><a href="../../MCollective/Discovery.html">MCollective::Discovery</a></li>
261                                 
262                                         <li><a href="../../MCollective/Facts.html">MCollective::Facts</a></li>
263                                 
264                                         <li><a href="../../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
265                                 
266                                         <li><a href="../../MCollective/Generators.html">MCollective::Generators</a></li>
267                                 
268                                         <li><a href="../../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
269                                 
270                                         <li><a href="../../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
271                                 
272                                         <li><a href="../../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
273                                 
274                                         <li><a href="../../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
275                                 
276                                         <li><a href="../../MCollective/Log.html">MCollective::Log</a></li>
277                                 
278                                         <li><a href="../../MCollective/Logger.html">MCollective::Logger</a></li>
279                                 
280                                         <li><a href="../../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
281                                 
282                                         <li><a href="../../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
283                                 
284                                         <li><a href="../../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
285                                 
286                                         <li><a href="../../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
287                                 
288                                         <li><a href="../../MCollective/Matcher.html">MCollective::Matcher</a></li>
289                                 
290                                         <li><a href="../../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
291                                 
292                                         <li><a href="../../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
293                                 
294                                         <li><a href="../../MCollective/Message.html">MCollective::Message</a></li>
295                                 
296                                         <li><a href="../../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
297                                 
298                                         <li><a href="../../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
299                                 
300                                         <li><a href="../../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
301                                 
302                                         <li><a href="../../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
303                                 
304                                         <li><a href="../../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
305                                 
306                                         <li><a href="../../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
307                                 
308                                         <li><a href="../../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
309                                 
310                                         <li><a href="../../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
311                                 
312                                         <li><a href="../../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
313                                 
314                                         <li><a href="../../MCollective/RPC.html">MCollective::RPC</a></li>
315                                 
316                                         <li><a href="../../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
317                                 
318                                         <li><a href="../../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
319                                 
320                                         <li><a href="../../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
321                                 
322                                         <li><a href="../../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
323                                 
324                                         <li><a href="../../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
325                                 
326                                         <li><a href="../../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
327                                 
328                                         <li><a href="../../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
329                                 
330                                         <li><a href="../../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
331                                 
332                                         <li><a href="../../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
333                                 
334                                         <li><a href="../../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
335                                 
336                                         <li><a href="../../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
337                                 
338                                         <li><a href="../../MCollective/RPCError.html">MCollective::RPCError</a></li>
339                                 
340                                         <li><a href="../../MCollective/Registration.html">MCollective::Registration</a></li>
341                                 
342                                         <li><a href="../../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
343                                 
344                                         <li><a href="../../MCollective/Runner.html">MCollective::Runner</a></li>
345                                 
346                                         <li><a href="../../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
347                                 
348                                         <li><a href="../../MCollective/SSL.html">MCollective::SSL</a></li>
349                                 
350                                         <li><a href="../../MCollective/Security.html">MCollective::Security</a></li>
351                                 
352                                         <li><a href="../../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
353                                 
354                                         <li><a href="../../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
355                                 
356                                         <li><a href="../../MCollective/Shell.html">MCollective::Shell</a></li>
357                                 
358                                         <li><a href="../../MCollective/Translatable.html">MCollective::Translatable</a></li>
359                                 
360                                         <li><a href="../../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
361                                 
362                                         <li><a href="../../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
363                                 
364                                         <li><a href="../../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
365                                 
366                                         <li><a href="../../MCollective/Util.html">MCollective::Util</a></li>
367                                 
368                                         <li><a href="../../MCollective/Validator.html">MCollective::Validator</a></li>
369                                 
370                                         <li><a href="../../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
371                                 
372                                         <li><a href="../../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
373                                 
374                                         <li><a href="../../Array.html">Array</a></li>
375                                 
376                                         <li><a href="../../Dir.html">Dir</a></li>
377                                 
378                                         <li><a href="../../Object.html">Object</a></li>
379                                 
380                                         <li><a href="../../String.html">String</a></li>
381                                 
382                                         <li><a href="../../Symbol.html">Symbol</a></li>
383                                 
384                                 </ul>
385                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
386                         </div>
387
388                         
389                 </div>
390         </div>
391
392         <div id="documentation">
393                 <h1 class="class">MCollective::RPC::Client</h1>
394
395                 <div id="description">
396                         <p>
397 The main component of the Simple <a href="../RPC.html">RPC</a> client
398 system, this wraps around <a href="../Client.html">MCollective::Client</a>
399 and just brings in a lot of convention and standard approached.
400 </p>
401
402                 </div>
403
404                 <!-- Constants -->
405                 
406
407                 <!-- Attributes -->
408                 
409                 <div id="attribute-method-details" class="method-section section">
410                         <h3 class="section-header">Attributes</h3>
411
412                         
413                         <div id="timeout-attribute-method" class="method-detail">
414                                 <a name="timeout"></a>
415                                 
416                                 <a name="timeout="></a>
417                                 
418                                 <div class="method-heading attribute-method-heading">
419                                         <span class="method-name">timeout</span><span
420                                                 class="attribute-access-type">[RW]</span>
421                                 </div>
422
423                                 <div class="method-description">
424                                 
425                                 <p class="missing-docs">(Not documented)</p>
426                                 
427                                 </div>
428                         </div>
429                         
430                         <div id="verbose-attribute-method" class="method-detail">
431                                 <a name="verbose"></a>
432                                 
433                                 <a name="verbose="></a>
434                                 
435                                 <div class="method-heading attribute-method-heading">
436                                         <span class="method-name">verbose</span><span
437                                                 class="attribute-access-type">[RW]</span>
438                                 </div>
439
440                                 <div class="method-description">
441                                 
442                                 <p class="missing-docs">(Not documented)</p>
443                                 
444                                 </div>
445                         </div>
446                         
447                         <div id="filter-attribute-method" class="method-detail">
448                                 <a name="filter"></a>
449                                 
450                                 <a name="filter="></a>
451                                 
452                                 <div class="method-heading attribute-method-heading">
453                                         <span class="method-name">filter</span><span
454                                                 class="attribute-access-type">[RW]</span>
455                                 </div>
456
457                                 <div class="method-description">
458                                 
459                                 <p class="missing-docs">(Not documented)</p>
460                                 
461                                 </div>
462                         </div>
463                         
464                         <div id="config-attribute-method" class="method-detail">
465                                 <a name="config"></a>
466                                 
467                                 <a name="config="></a>
468                                 
469                                 <div class="method-heading attribute-method-heading">
470                                         <span class="method-name">config</span><span
471                                                 class="attribute-access-type">[RW]</span>
472                                 </div>
473
474                                 <div class="method-description">
475                                 
476                                 <p class="missing-docs">(Not documented)</p>
477                                 
478                                 </div>
479                         </div>
480                         
481                         <div id="progress-attribute-method" class="method-detail">
482                                 <a name="progress"></a>
483                                 
484                                 <a name="progress="></a>
485                                 
486                                 <div class="method-heading attribute-method-heading">
487                                         <span class="method-name">progress</span><span
488                                                 class="attribute-access-type">[RW]</span>
489                                 </div>
490
491                                 <div class="method-description">
492                                 
493                                 <p class="missing-docs">(Not documented)</p>
494                                 
495                                 </div>
496                         </div>
497                         
498                         <div id="ttl-attribute-method" class="method-detail">
499                                 <a name="ttl"></a>
500                                 
501                                 <a name="ttl="></a>
502                                 
503                                 <div class="method-heading attribute-method-heading">
504                                         <span class="method-name">ttl</span><span
505                                                 class="attribute-access-type">[RW]</span>
506                                 </div>
507
508                                 <div class="method-description">
509                                 
510                                 <p class="missing-docs">(Not documented)</p>
511                                 
512                                 </div>
513                         </div>
514                         
515                         <div id="reply-to-attribute-method" class="method-detail">
516                                 <a name="reply_to"></a>
517                                 
518                                 <a name="reply_to="></a>
519                                 
520                                 <div class="method-heading attribute-method-heading">
521                                         <span class="method-name">reply_to</span><span
522                                                 class="attribute-access-type">[RW]</span>
523                                 </div>
524
525                                 <div class="method-description">
526                                 
527                                 <p class="missing-docs">(Not documented)</p>
528                                 
529                                 </div>
530                         </div>
531                         
532                         <div id="client-attribute-method" class="method-detail">
533                                 <a name="client"></a>
534                                 
535                                 <div class="method-heading attribute-method-heading">
536                                         <span class="method-name">client</span><span
537                                                 class="attribute-access-type">[R]</span>
538                                 </div>
539
540                                 <div class="method-description">
541                                 
542                                 <p class="missing-docs">(Not documented)</p>
543                                 
544                                 </div>
545                         </div>
546                         
547                         <div id="stats-attribute-method" class="method-detail">
548                                 <a name="stats"></a>
549                                 
550                                 <div class="method-heading attribute-method-heading">
551                                         <span class="method-name">stats</span><span
552                                                 class="attribute-access-type">[R]</span>
553                                 </div>
554
555                                 <div class="method-description">
556                                 
557                                 <p class="missing-docs">(Not documented)</p>
558                                 
559                                 </div>
560                         </div>
561                         
562                         <div id="ddl-attribute-method" class="method-detail">
563                                 <a name="ddl"></a>
564                                 
565                                 <div class="method-heading attribute-method-heading">
566                                         <span class="method-name">ddl</span><span
567                                                 class="attribute-access-type">[R]</span>
568                                 </div>
569
570                                 <div class="method-description">
571                                 
572                                 <p class="missing-docs">(Not documented)</p>
573                                 
574                                 </div>
575                         </div>
576                         
577                         <div id="agent-attribute-method" class="method-detail">
578                                 <a name="agent"></a>
579                                 
580                                 <div class="method-heading attribute-method-heading">
581                                         <span class="method-name">agent</span><span
582                                                 class="attribute-access-type">[R]</span>
583                                 </div>
584
585                                 <div class="method-description">
586                                 
587                                 <p class="missing-docs">(Not documented)</p>
588                                 
589                                 </div>
590                         </div>
591                         
592                         <div id="limit-targets-attribute-method" class="method-detail">
593                                 <a name="limit_targets"></a>
594                                 
595                                 <div class="method-heading attribute-method-heading">
596                                         <span class="method-name">limit_targets</span><span
597                                                 class="attribute-access-type">[R]</span>
598                                 </div>
599
600                                 <div class="method-description">
601                                 
602                                 <p class="missing-docs">(Not documented)</p>
603                                 
604                                 </div>
605                         </div>
606                         
607                         <div id="limit-method-attribute-method" class="method-detail">
608                                 <a name="limit_method"></a>
609                                 
610                                 <div class="method-heading attribute-method-heading">
611                                         <span class="method-name">limit_method</span><span
612                                                 class="attribute-access-type">[R]</span>
613                                 </div>
614
615                                 <div class="method-description">
616                                 
617                                 <p class="missing-docs">(Not documented)</p>
618                                 
619                                 </div>
620                         </div>
621                         
622                         <div id="output-format-attribute-method" class="method-detail">
623                                 <a name="output_format"></a>
624                                 
625                                 <div class="method-heading attribute-method-heading">
626                                         <span class="method-name">output_format</span><span
627                                                 class="attribute-access-type">[R]</span>
628                                 </div>
629
630                                 <div class="method-description">
631                                 
632                                 <p class="missing-docs">(Not documented)</p>
633                                 
634                                 </div>
635                         </div>
636                         
637                         <div id="batch-size-attribute-method" class="method-detail">
638                                 <a name="batch_size"></a>
639                                 
640                                 <div class="method-heading attribute-method-heading">
641                                         <span class="method-name">batch_size</span><span
642                                                 class="attribute-access-type">[R]</span>
643                                 </div>
644
645                                 <div class="method-description">
646                                 
647                                 <p class="missing-docs">(Not documented)</p>
648                                 
649                                 </div>
650                         </div>
651                         
652                         <div id="batch-sleep-time-attribute-method" class="method-detail">
653                                 <a name="batch_sleep_time"></a>
654                                 
655                                 <div class="method-heading attribute-method-heading">
656                                         <span class="method-name">batch_sleep_time</span><span
657                                                 class="attribute-access-type">[R]</span>
658                                 </div>
659
660                                 <div class="method-description">
661                                 
662                                 <p class="missing-docs">(Not documented)</p>
663                                 
664                                 </div>
665                         </div>
666                         
667                         <div id="batch-mode-attribute-method" class="method-detail">
668                                 <a name="batch_mode"></a>
669                                 
670                                 <div class="method-heading attribute-method-heading">
671                                         <span class="method-name">batch_mode</span><span
672                                                 class="attribute-access-type">[R]</span>
673                                 </div>
674
675                                 <div class="method-description">
676                                 
677                                 <p class="missing-docs">(Not documented)</p>
678                                 
679                                 </div>
680                         </div>
681                         
682                         <div id="discovery-options-attribute-method" class="method-detail">
683                                 <a name="discovery_options"></a>
684                                 
685                                 <div class="method-heading attribute-method-heading">
686                                         <span class="method-name">discovery_options</span><span
687                                                 class="attribute-access-type">[R]</span>
688                                 </div>
689
690                                 <div class="method-description">
691                                 
692                                 <p class="missing-docs">(Not documented)</p>
693                                 
694                                 </div>
695                         </div>
696                         
697                         <div id="discovery-method-attribute-method" class="method-detail">
698                                 <a name="discovery_method"></a>
699                                 
700                                 <div class="method-heading attribute-method-heading">
701                                         <span class="method-name">discovery_method</span><span
702                                                 class="attribute-access-type">[R]</span>
703                                 </div>
704
705                                 <div class="method-description">
706                                 
707                                 <p class="missing-docs">(Not documented)</p>
708                                 
709                                 </div>
710                         </div>
711                         
712                         <div id="default-discovery-method-attribute-method" class="method-detail">
713                                 <a name="default_discovery_method"></a>
714                                 
715                                 <div class="method-heading attribute-method-heading">
716                                         <span class="method-name">default_discovery_method</span><span
717                                                 class="attribute-access-type">[R]</span>
718                                 </div>
719
720                                 <div class="method-description">
721                                 
722                                 <p class="missing-docs">(Not documented)</p>
723                                 
724                                 </div>
725                         </div>
726                         
727                         <div id="limit-seed-attribute-method" class="method-detail">
728                                 <a name="limit_seed"></a>
729                                 
730                                 <div class="method-heading attribute-method-heading">
731                                         <span class="method-name">limit_seed</span><span
732                                                 class="attribute-access-type">[R]</span>
733                                 </div>
734
735                                 <div class="method-description">
736                                 
737                                 <p class="missing-docs">(Not documented)</p>
738                                 
739                                 </div>
740                         </div>
741                         
742                 </div>
743                 
744
745                 <!-- Methods -->
746                 
747                 <div id="public-class-method-details" class="method-section section">
748                         <h3 class="section-header">Public Class Methods</h3>
749
750                 
751                         <div id="new-method" class="method-detail ">
752                                 <a name="M000443"></a>
753
754                                 <div class="method-heading">
755                                 
756                                         <span class="method-name">new</span><span
757                                                 class="method-args">(agent, flags = {})</span>
758                                         <span class="method-click-advice">click to toggle source</span>
759                                 
760                                 </div>
761
762                                 <div class="method-description">
763                                         
764                                         <p>
765 Creates a stub for a remote agent, you can pass in an options array in the
766 flags which will then be used else it will just create a default options
767 array with filtering enabled based on the standard command line use.
768 </p>
769 <pre>
770   rpc = RPC::Client.new(&quot;rpctest&quot;, :configfile =&gt; &quot;client.cfg&quot;, :options =&gt; options)
771 </pre>
772 <p>
773 You typically would not call this directly you&#8217;d use <a
774 href="../RPC.html#M000314">MCollective::RPC#rpcclient</a> instead which is
775 a wrapper around this that can be used as a Mixin
776 </p>
777                                         
778
779                                         
780                                         <div class="method-source-code"
781                                                 id="new-source">
782 <pre>
783      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 20</span>
784  20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">flags</span> = {})
785  21:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:options</span>)
786  22:           <span class="ruby-identifier">initial_options</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>]
787  23: 
788  24:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@@initial_options</span>
789  25:           <span class="ruby-identifier">initial_options</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-ivar">@@initial_options</span>)
790  26: 
791  27:         <span class="ruby-keyword kw">else</span>
792  28:           <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-identifier">:mcollective_limit_targets</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:batch_size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:batch_sleep_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>}, <span class="ruby-value str">&quot;filter&quot;</span>)
793  29: 
794  30:           <span class="ruby-identifier">initial_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">opts</span><span class="ruby-operator">|</span>
795  31:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
796  32:               <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">opts</span>)
797  33:             <span class="ruby-keyword kw">end</span>
798  34: 
799  35:             <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">add_simplerpc_options</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">opts</span>)
800  36:           <span class="ruby-keyword kw">end</span>
801  37: 
802  38:           <span class="ruby-ivar">@@initial_options</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">initial_options</span>)
803  39:         <span class="ruby-keyword kw">end</span>
804  40: 
805  41:         <span class="ruby-ivar">@initial_options</span> = <span class="ruby-identifier">initial_options</span>
806  42: 
807  43:         <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:config</span>]
808  44:         <span class="ruby-ivar">@client</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@config</span>)
809  45:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">initial_options</span>
810  46: 
811  47:         <span class="ruby-ivar">@stats</span> = <span class="ruby-constant">Stats</span>.<span class="ruby-identifier">new</span>
812  48:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
813  49:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">5</span>
814  50:         <span class="ruby-ivar">@verbose</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:verbose</span>]
815  51:         <span class="ruby-ivar">@filter</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:filter</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
816  52:         <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-keyword kw">nil</span>
817  53:         <span class="ruby-ivar">@progress</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:progress_bar</span>]
818  54:         <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:mcollective_limit_targets</span>]
819  55:         <span class="ruby-ivar">@limit_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">rpclimitmethod</span>
820  56:         <span class="ruby-ivar">@limit_seed</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:limit_seed</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">nil</span>
821  57:         <span class="ruby-ivar">@output_format</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:console</span>
822  58:         <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">false</span>
823  59:         <span class="ruby-ivar">@reply_to</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:reply_to</span>]
824  60:         <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:discovery_method</span>]
825  61:         <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@discovery_method</span>
826  62:           <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">default_discovery_method</span>
827  63:           <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">true</span>
828  64:         <span class="ruby-keyword kw">else</span>
829  65:           <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">false</span>
830  66:         <span class="ruby-keyword kw">end</span>
831  67:         <span class="ruby-ivar">@discovery_options</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:discovery_options</span>] <span class="ruby-operator">||</span> []
832  68:         <span class="ruby-ivar">@force_display_mode</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:force_display_mode</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
833  69: 
834  70:         <span class="ruby-ivar">@batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:batch_size</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>)
835  71:         <span class="ruby-ivar">@batch_sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:batch_sleep_time</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>)
836  72:         <span class="ruby-ivar">@batch_mode</span> = <span class="ruby-ivar">@batch_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
837  73: 
838  74:         <span class="ruby-identifier">agent_filter</span> <span class="ruby-identifier">agent</span>
839  75: 
840  76:         <span class="ruby-ivar">@discovery_timeout</span> = <span class="ruby-ivar">@initial_options</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:disctimeout</span>, <span class="ruby-keyword kw">nil</span>)
841  77: 
842  78:         <span class="ruby-ivar">@collective</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">collective</span>
843  79:         <span class="ruby-ivar">@ttl</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ttl</span>
844  80:         <span class="ruby-ivar">@publish_timeout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:publish_timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">publish_timeout</span>
845  81:         <span class="ruby-ivar">@threaded</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:threaded</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">threaded</span>
846  82: 
847  83:         <span class="ruby-comment cmt"># if we can find a DDL for the service override</span>
848  84:         <span class="ruby-comment cmt"># the timeout of the client so we always magically</span>
849  85:         <span class="ruby-comment cmt"># wait appropriate amounts of time.</span>
850  86:         <span class="ruby-comment cmt">#</span>
851  87:         <span class="ruby-comment cmt"># We add the discovery timeout to the ddl supplied</span>
852  88:         <span class="ruby-comment cmt"># timeout as the discovery timeout tends to be tuned</span>
853  89:         <span class="ruby-comment cmt"># for local network conditions and fact source speed</span>
854  90:         <span class="ruby-comment cmt"># which would other wise not be accounted for and</span>
855  91:         <span class="ruby-comment cmt"># some results might get missed.</span>
856  92:         <span class="ruby-comment cmt">#</span>
857  93:         <span class="ruby-comment cmt"># We do this only if the timeout is the default 5</span>
858  94:         <span class="ruby-comment cmt"># seconds, so that users cli overrides will still</span>
859  95:         <span class="ruby-comment cmt"># get applied</span>
860  96:         <span class="ruby-comment cmt">#</span>
861  97:         <span class="ruby-comment cmt"># DDLs are required, failure to find a DDL is fatal</span>
862  98:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>)
863  99:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ddl</span> = <span class="ruby-ivar">@ddl</span>
864 100:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">discovery_timeout</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">==</span> <span class="ruby-value">5</span>
865 101: 
866 102:         <span class="ruby-comment cmt"># allows stderr and stdout to be overridden for testing</span>
867 103:         <span class="ruby-comment cmt"># but also for web apps that might not want a bunch of stuff</span>
868 104:         <span class="ruby-comment cmt"># generated to actual file handles</span>
869 105:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stderr</span>]
870 106:           <span class="ruby-ivar">@stderr</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stderr</span>]
871 107:         <span class="ruby-keyword kw">else</span>
872 108:           <span class="ruby-ivar">@stderr</span> = <span class="ruby-constant">STDERR</span>
873 109:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
874 110:         <span class="ruby-keyword kw">end</span>
875 111: 
876 112:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stdout</span>]
877 113:           <span class="ruby-ivar">@stdout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stdout</span>]
878 114:         <span class="ruby-keyword kw">else</span>
879 115:           <span class="ruby-ivar">@stdout</span> = <span class="ruby-constant">STDOUT</span>
880 116:           <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
881 117:         <span class="ruby-keyword kw">end</span>
882 118:       <span class="ruby-keyword kw">end</span></pre>
883                                         </div>
884                                         
885                                 </div>
886
887                                 
888                         </div>
889
890                 
891                 </div>
892         
893                 <div id="public-instance-method-details" class="method-section section">
894                         <h3 class="section-header">Public Instance Methods</h3>
895
896                 
897                         <div id="agent-filter-method" class="method-detail ">
898                                 <a name="M000461"></a>
899
900                                 <div class="method-heading">
901                                 
902                                         <span class="method-name">agent_filter</span><span
903                                                 class="method-args">(agent)</span>
904                                         <span class="method-click-advice">click to toggle source</span>
905                                 
906                                 </div>
907
908                                 <div class="method-description">
909                                         
910                                         <p>
911 Sets the agent filter
912 </p>
913                                         
914
915                                         
916                                         <div class="method-source-code"
917                                                 id="agent-filter-source">
918 <pre>
919      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 422</span>
920 422:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">agent_filter</span>(<span class="ruby-identifier">agent</span>)
921 423:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">agent</span>]
922 424:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>].<span class="ruby-identifier">compact!</span>
923 425:         <span class="ruby-identifier">reset</span>
924 426:       <span class="ruby-keyword kw">end</span></pre>
925                                         </div>
926                                         
927                                 </div>
928
929                                 
930                         </div>
931
932                 
933                         <div id="aggregate-reply-method" class="method-detail ">
934                                 <a name="M000475"></a>
935
936                                 <div class="method-heading">
937                                 
938                                         <span class="method-name">aggregate_reply</span><span
939                                                 class="method-args">(reply, aggregate)</span>
940                                         <span class="method-click-advice">click to toggle source</span>
941                                 
942                                 </div>
943
944                                 <div class="method-description">
945                                         
946                                         <p class="missing-docs">(Not documented)</p>
947                                         
948
949                                         
950                                         <div class="method-source-code"
951                                                 id="aggregate-reply-source">
952 <pre>
953      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 687</span>
954 687:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">reply</span>, <span class="ruby-identifier">aggregate</span>)
955 688:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aggregate</span>
956 689: 
957 690:         <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">call_functions</span>(<span class="ruby-identifier">reply</span>)
958 691:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">aggregate</span>
959 692:       <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>
960 693:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Failed to calculate aggregate summaries for reply from %s, calculating summaries disabled: %s: %s (%s)&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:senderid</span>], <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>])
961 694:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
962 695:       <span class="ruby-keyword kw">end</span></pre>
963                                         </div>
964                                         
965                                 </div>
966
967                                 
968                         </div>
969
970                 
971                         <div id="batch-size--method" class="method-detail ">
972                                 <a name="M000471"></a>
973
974                                 <div class="method-heading">
975                                 
976                                         <span class="method-name">batch_size=</span><span
977                                                 class="method-args">(limit)</span>
978                                         <span class="method-click-advice">click to toggle source</span>
979                                 
980                                 </div>
981
982                                 <div class="method-description">
983                                         
984                                         <p>
985 Sets the batch size, if the size is set to 0 that will disable batch mode
986 </p>
987                                         
988
989                                         
990                                         <div class="method-source-code"
991                                                 id="batch-size--source">
992 <pre>
993      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 608</span>
994 608:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">batch_size=</span>(<span class="ruby-identifier">limit</span>)
995 609:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only set batch size if direct addressing is supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
996 610: 
997 611:         <span class="ruby-ivar">@batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
998 612:         <span class="ruby-ivar">@batch_mode</span> = <span class="ruby-ivar">@batch_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
999 613:       <span class="ruby-keyword kw">end</span></pre>
1000                                         </div>
1001                                         
1002                                 </div>
1003
1004                                 
1005                         </div>
1006
1007                 
1008                         <div id="batch-sleep-time--method" class="method-detail ">
1009                                 <a name="M000472"></a>
1010
1011                                 <div class="method-heading">
1012                                 
1013                                         <span class="method-name">batch_sleep_time=</span><span
1014                                                 class="method-args">(time)</span>
1015                                         <span class="method-click-advice">click to toggle source</span>
1016                                 
1017                                 </div>
1018
1019                                 <div class="method-description">
1020                                         
1021                                         <p class="missing-docs">(Not documented)</p>
1022                                         
1023
1024                                         
1025                                         <div class="method-source-code"
1026                                                 id="batch-sleep-time--source">
1027 <pre>
1028      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 615</span>
1029 615:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">batch_sleep_time=</span>(<span class="ruby-identifier">time</span>)
1030 616:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only set batch sleep time if direct addressing is supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1031 617: 
1032 618:         <span class="ruby-ivar">@batch_sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">time</span>)
1033 619:       <span class="ruby-keyword kw">end</span></pre>
1034                                         </div>
1035                                         
1036                                 </div>
1037
1038                                 
1039                         </div>
1040
1041                 
1042                         <div id="call-agent-method" class="method-detail ">
1043                                 <a name="M000480"></a>
1044
1045                                 <div class="method-heading">
1046                                 
1047                                         <span class="method-name">call_agent</span><span
1048                                                 class="method-args">(action, args, opts, disc=:auto, &block)</span>
1049                                         <span class="method-click-advice">click to toggle source</span>
1050                                 
1051                                 </div>
1052
1053                                 <div class="method-description">
1054                                         
1055                                         <p>
1056 Handles traditional calls to the remote agents with full stats blocks, non
1057 blocks and everything else supported.
1058 </p>
1059 <p>
1060 Other methods of calling the nodes can reuse this code by for example
1061 specifying custom options and discovery data
1062 </p>
1063                                         
1064
1065                                         
1066                                         <div class="method-source-code"
1067                                                 id="call-agent-source">
1068 <pre>
1069      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 844</span>
1070 844:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-identifier">disc</span>=<span class="ruby-identifier">:auto</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1071 845:         <span class="ruby-comment cmt"># Handle fire and forget requests and make sure</span>
1072 846:         <span class="ruby-comment cmt"># the :process_results value is set appropriately</span>
1073 847:         <span class="ruby-comment cmt">#</span>
1074 848:         <span class="ruby-comment cmt"># specific reply-to requests should be treated like</span>
1075 849:         <span class="ruby-comment cmt"># fire and forget since the client will never get</span>
1076 850:         <span class="ruby-comment cmt"># the responses</span>
1077 851:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@reply_to</span>
1078 852:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
1079 853:         <span class="ruby-keyword kw">else</span>
1080 854:           <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] = <span class="ruby-keyword kw">true</span>
1081 855:         <span class="ruby-keyword kw">end</span>
1082 856: 
1083 857:         <span class="ruby-comment cmt"># Do discovery when no specific discovery array is given</span>
1084 858:         <span class="ruby-comment cmt">#</span>
1085 859:         <span class="ruby-comment cmt"># If an array is given set the force_direct_request hint that</span>
1086 860:         <span class="ruby-comment cmt"># will tell the message object to be a direct request one</span>
1087 861:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">disc</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:auto</span>
1088 862:           <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discover</span>
1089 863:         <span class="ruby-keyword kw">else</span>
1090 864:           <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1091 865:           <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">disc</span>
1092 866:         <span class="ruby-keyword kw">end</span>
1093 867: 
1094 868:         <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
1095 869: 
1096 870:         <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filter</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>})
1097 871:         <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">clone</span>
1098 872: 
1099 873:         <span class="ruby-identifier">results</span> = []
1100 874:         <span class="ruby-identifier">respcount</span> = <span class="ruby-value">0</span>
1101 875: 
1102 876:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
1103 877:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@force_direct_request</span>
1104 878: 
1105 879:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block_given?</span>
1106 880:             <span class="ruby-identifier">twirl</span> = <span class="ruby-constant">Progress</span>.<span class="ruby-identifier">new</span>
1107 881:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">puts</span>
1108 882:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>)
1109 883:           <span class="ruby-keyword kw">end</span>
1110 884: 
1111 885:           <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
1112 886: 
1113 887:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">req</span>(<span class="ruby-identifier">message</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span>
1114 888:             <span class="ruby-identifier">respcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
1115 889: 
1116 890:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1117 891:               <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
1118 892:             <span class="ruby-keyword kw">else</span>
1119 893:               <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
1120 894: 
1121 895:               <span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
1122 896: 
1123 897:               <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>
1124 898:             <span class="ruby-keyword kw">end</span>
1125 899:           <span class="ruby-keyword kw">end</span>
1126 900: 
1127 901:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_summary</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">summarize</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
1128 902:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_failures</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">failed</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
1129 903:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">client_stats</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>
1130 904:         <span class="ruby-keyword kw">else</span>
1131 905:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\nNo request sent, we did not discover any nodes.&quot;</span>)
1132 906:         <span class="ruby-keyword kw">end</span>
1133 907: 
1134 908:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">finish_request</span>
1135 909: 
1136 910:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-ivar">@stats</span>)
1137 911: 
1138 912:         <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\n\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
1139 913: 
1140 914:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1141 915:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">stats</span>
1142 916:         <span class="ruby-keyword kw">else</span>
1143 917:           <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">results</span>].<span class="ruby-identifier">flatten</span>
1144 918:         <span class="ruby-keyword kw">end</span>
1145 919:       <span class="ruby-keyword kw">end</span></pre>
1146                                         </div>
1147                                         
1148                                 </div>
1149
1150                                 
1151                         </div>
1152
1153                 
1154                         <div id="call-agent-batched-method" class="method-detail ">
1155                                 <a name="M000479"></a>
1156
1157                                 <div class="method-heading">
1158                                 
1159                                         <span class="method-name">call_agent_batched</span><span
1160                                                 class="method-args">(action, args, opts, batch_size, sleep_time, &block)</span>
1161                                         <span class="method-click-advice">click to toggle source</span>
1162                                 
1163                                 </div>
1164
1165                                 <div class="method-description">
1166                                         
1167                                         <p>
1168 Calls an agent in a way very similar to <a
1169 href="Client.html#M000480">call_agent</a> but it supports batching the
1170 queries to the network.
1171 </p>
1172 <p>
1173 The result sets, stats, block handling etc is all exactly like you would
1174 expect from normal call_agent.
1175 </p>
1176 <p>
1177 This is used by <a href="Client.html#M000452">method_missing</a> and works
1178 only with direct addressing mode
1179 </p>
1180                                         
1181
1182                                         
1183                                         <div class="method-source-code"
1184                                                 id="call-agent-batched-source">
1185 <pre>
1186      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 759</span>
1187 759:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_agent_batched</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-identifier">batch_size</span>, <span class="ruby-identifier">sleep_time</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1188 760:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Batched requests requires direct addressing&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1189 761:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot bypass result processing for batched requests&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
1190 762: 
1191 763:         <span class="ruby-identifier">batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">batch_size</span>)
1192 764:         <span class="ruby-identifier">sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">sleep_time</span>)
1193 765: 
1194 766:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Calling #{agent}##{action} in batches of #{batch_size} with sleep time of #{sleep_time}&quot;</span>)
1195 767: 
1196 768:         <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span>
1197 769: 
1198 770:         <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discover</span>
1199 771:         <span class="ruby-identifier">results</span> = []
1200 772:         <span class="ruby-identifier">respcount</span> = <span class="ruby-value">0</span>
1201 773: 
1202 774:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
1203 775:           <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
1204 776: 
1205 777:           <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
1206 778: 
1207 779:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block_given?</span>
1208 780:             <span class="ruby-identifier">twirl</span> = <span class="ruby-constant">Progress</span>.<span class="ruby-identifier">new</span>
1209 781:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">puts</span>
1210 782:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>)
1211 783:           <span class="ruby-keyword kw">end</span>
1212 784: 
1213 785:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-keyword kw">nil</span>
1214 786: 
1215 787:           <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">in_groups_of</span>(<span class="ruby-identifier">batch_size</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hosts</span>, <span class="ruby-identifier">last_batch</span><span class="ruby-operator">|</span>
1216 788:             <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:direct_request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filter</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>})
1217 789: 
1218 790:             <span class="ruby-comment cmt"># first time round we let the Message object create a request id</span>
1219 791:             <span class="ruby-comment cmt"># we then re-use it for future requests to keep auditing sane etc</span>
1220 792:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-identifier">message</span>.<span class="ruby-identifier">create_reqid</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span>
1221 793:             <span class="ruby-identifier">message</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span>
1222 794: 
1223 795:             <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">clone</span>.<span class="ruby-identifier">compact</span>
1224 796: 
1225 797:             <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">req</span>(<span class="ruby-identifier">message</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span>
1226 798:               <span class="ruby-identifier">respcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
1227 799: 
1228 800:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1229 801:                 <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
1230 802:               <span class="ruby-keyword kw">else</span>
1231 803:                 <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
1232 804: 
1233 805:                 <span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
1234 806: 
1235 807:                 <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>
1236 808:               <span class="ruby-keyword kw">end</span>
1237 809:             <span class="ruby-keyword kw">end</span>
1238 810: 
1239 811:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">noresponsefrom</span>.<span class="ruby-identifier">concat</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:noresponsefrom</span>]
1240 812:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">responses</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:responses</span>]
1241 813:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">blocktime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">sleep_time</span>
1242 814:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">totaltime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:totaltime</span>]
1243 815:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discoverytime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discoverytime</span>]
1244 816: 
1245 817:             <span class="ruby-identifier">sleep</span> <span class="ruby-identifier">sleep_time</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">last_batch</span>
1246 818:           <span class="ruby-keyword kw">end</span>
1247 819: 
1248 820:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_summary</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">summarize</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
1249 821:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_failures</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">failed</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
1250 822:         <span class="ruby-keyword kw">else</span>
1251 823:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\nNo request sent, we did not discover any nodes.&quot;</span>)
1252 824:         <span class="ruby-keyword kw">end</span>
1253 825: 
1254 826:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">finish_request</span>
1255 827: 
1256 828:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-ivar">@stats</span>)
1257 829: 
1258 830:         <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
1259 831: 
1260 832:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1261 833:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">stats</span>
1262 834:         <span class="ruby-keyword kw">else</span>
1263 835:           <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">results</span>].<span class="ruby-identifier">flatten</span>
1264 836:         <span class="ruby-keyword kw">end</span>
1265 837:       <span class="ruby-keyword kw">end</span></pre>
1266                                         </div>
1267                                         
1268                                 </div>
1269
1270                                 
1271                         </div>
1272
1273                 
1274                         <div id="class-filter-method" class="method-detail ">
1275                                 <a name="M000459"></a>
1276
1277                                 <div class="method-heading">
1278                                 
1279                                         <span class="method-name">class_filter</span><span
1280                                                 class="method-args">(klass)</span>
1281                                         <span class="method-click-advice">click to toggle source</span>
1282                                 
1283                                 </div>
1284
1285                                 <div class="method-description">
1286                                         
1287                                         <p>
1288 Sets the class filter
1289 </p>
1290                                         
1291
1292                                         
1293                                         <div class="method-source-code"
1294                                                 id="class-filter-source">
1295 <pre>
1296      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 398</span>
1297 398:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_filter</span>(<span class="ruby-identifier">klass</span>)
1298 399:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">klass</span>]
1299 400:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>].<span class="ruby-identifier">compact!</span>
1300 401:         <span class="ruby-identifier">reset</span>
1301 402:       <span class="ruby-keyword kw">end</span></pre>
1302                                         </div>
1303                                         
1304                                 </div>
1305
1306                                 
1307                         </div>
1308
1309                 
1310                         <div id="collective--method" class="method-detail ">
1311                                 <a name="M000468"></a>
1312
1313                                 <div class="method-heading">
1314                                 
1315                                         <span class="method-name">collective=</span><span
1316                                                 class="method-args">(c)</span>
1317                                         <span class="method-click-advice">click to toggle source</span>
1318                                 
1319                                 </div>
1320
1321                                 <div class="method-description">
1322                                         
1323                                         <p>
1324 Sets the collective we are communicating with
1325 </p>
1326                                         
1327
1328                                         
1329                                         <div class="method-source-code"
1330                                                 id="collective--source">
1331 <pre>
1332      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 573</span>
1333 573:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collective=</span>(<span class="ruby-identifier">c</span>)
1334 574:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown collective #{c}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">collectives</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">c</span>)
1335 575: 
1336 576:         <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">c</span>
1337 577:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
1338 578:         <span class="ruby-identifier">reset</span>
1339 579:       <span class="ruby-keyword kw">end</span></pre>
1340                                         </div>
1341                                         
1342                                 </div>
1343
1344                                 
1345                         </div>
1346
1347                 
1348                         <div id="compound-filter-method" class="method-detail ">
1349                                 <a name="M000463"></a>
1350
1351                                 <div class="method-heading">
1352                                 
1353                                         <span class="method-name">compound_filter</span><span
1354                                                 class="method-args">(filter)</span>
1355                                         <span class="method-click-advice">click to toggle source</span>
1356                                 
1357                                 </div>
1358
1359                                 <div class="method-description">
1360                                         
1361                                         <p>
1362 Set a compound filter
1363 </p>
1364                                         
1365
1366                                         
1367                                         <div class="method-source-code"
1368                                                 id="compound-filter-source">
1369 <pre>
1370      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 436</span>
1371 436:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compound_filter</span>(<span class="ruby-identifier">filter</span>)
1372 437:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] <span class="ruby-operator">|</span>  [<span class="ruby-constant">Matcher</span>.<span class="ruby-identifier">create_compound_callstack</span>(<span class="ruby-identifier">filter</span>)]
1373 438:         <span class="ruby-identifier">reset</span>
1374 439:       <span class="ruby-keyword kw">end</span></pre>
1375                                         </div>
1376                                         
1377                                 </div>
1378
1379                                 
1380                         </div>
1381
1382                 
1383                         <div id="custom-request-method" class="method-detail ">
1384                                 <a name="M000454"></a>
1385
1386                                 <div class="method-heading">
1387                                 
1388                                         <span class="method-name">custom_request</span><span
1389                                                 class="method-args">(action, args, expected_agents, filter = {}, &block)</span>
1390                                         <span class="method-click-advice">click to toggle source</span>
1391                                 
1392                                 </div>
1393
1394                                 <div class="method-description">
1395                                         
1396                                         <p>
1397 Constructs custom requests with custom filters and discovery data the idea
1398 is that this would be used in web applications where you might be using a
1399 cached copy of data provided by a registration agent to figure out on your
1400 own what nodes will be responding and what your filter would be.
1401 </p>
1402 <p>
1403 This will help you essentially short circuit the traditional cycle of:
1404 </p>
1405 <p>
1406 mc discover / call / wait for discovered nodes
1407 </p>
1408 <p>
1409 by doing discovery however you like, contructing a filter and a list of
1410 nodes you expect responses from.
1411 </p>
1412 <p>
1413 Other than that it will work exactly like a normal call, blocks will behave
1414 the same way, stats will be handled the same way etcetc
1415 </p>
1416 <p>
1417 If you just wanted to contact one machine for example with a client that
1418 already has other filter options setup you can do:
1419 </p>
1420 <p>
1421 puppet.custom_request(&#8220;runonce&#8221;, {},
1422 [&#8220;your.box.com&#8220;], {:identity => &#8220;your.box.com&#8220;})
1423 </p>
1424 <p>
1425 This will do runonce action on just &#8216;your.box.com&#8217;, no
1426 discovery will be done and after receiving just one response it will stop
1427 waiting for responses
1428 </p>
1429 <p>
1430 If direct_addressing is enabled in the config file you can provide an empty
1431 hash as a filter, this will force that request to be a directly addressed
1432 request which technically does not need filters. If you try to use this
1433 mode with direct addressing disabled an exception will be raise
1434 </p>
1435                                         
1436
1437                                         
1438                                         <div class="method-source-code"
1439                                                 id="custom-request-source">
1440 <pre>
1441      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 296</span>
1442 296:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">expected_agents</span>, <span class="ruby-identifier">filter</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1443 297:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
1444 298: 
1445 299:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filter</span> <span class="ruby-operator">==</span> {} <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1446 300:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Attempted to do a filterless custom_request without direct_addressing enabled, preventing unexpected call to all nodes&quot;</span>
1447 301:         <span class="ruby-keyword kw">end</span>
1448 302: 
1449 303:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">reset</span>
1450 304: 
1451 305:         <span class="ruby-identifier">custom_filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
1452 306:         <span class="ruby-identifier">custom_options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">clone</span>
1453 307: 
1454 308:         <span class="ruby-comment cmt"># merge the supplied filter with the standard empty one</span>
1455 309:         <span class="ruby-comment cmt"># we could just use the merge method but I want to be sure</span>
1456 310:         <span class="ruby-comment cmt"># we dont merge in stuff that isnt actually valid</span>
1457 311:         [<span class="ruby-value str">&quot;identity&quot;</span>, <span class="ruby-value str">&quot;fact&quot;</span>, <span class="ruby-value str">&quot;agent&quot;</span>, <span class="ruby-value str">&quot;cf_class&quot;</span>, <span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ftype</span><span class="ruby-operator">|</span>
1458 312:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">ftype</span>)
1459 313:             <span class="ruby-identifier">custom_filter</span>[<span class="ruby-identifier">ftype</span>] = [<span class="ruby-identifier">filter</span>[<span class="ruby-identifier">ftype</span>], <span class="ruby-identifier">custom_filter</span>[<span class="ruby-identifier">ftype</span>]].<span class="ruby-identifier">flatten</span>
1460 314:           <span class="ruby-keyword kw">end</span>
1461 315:         <span class="ruby-keyword kw">end</span>
1462 316: 
1463 317:         <span class="ruby-comment cmt"># ensure that all filters at least restrict the call to the agent we're a proxy for</span>
1464 318:         <span class="ruby-identifier">custom_filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@agent</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">custom_filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@agent</span>)
1465 319:         <span class="ruby-identifier">custom_options</span>[<span class="ruby-identifier">:filter</span>] = <span class="ruby-identifier">custom_filter</span>
1466 320: 
1467 321:         <span class="ruby-comment cmt"># Fake out the stats discovery would have put there</span>
1468 322:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discovered_agents</span>([<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>)
1469 323: 
1470 324:         <span class="ruby-comment cmt"># Handle fire and forget requests</span>
1471 325:         <span class="ruby-comment cmt">#</span>
1472 326:         <span class="ruby-comment cmt"># If a specific reply-to was set then from the client perspective this should</span>
1473 327:         <span class="ruby-comment cmt"># be a fire and forget request too since no response will ever reach us - it</span>
1474 328:         <span class="ruby-comment cmt"># will go to the reply-to destination</span>
1475 329:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@reply_to</span>
1476 330:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_filter</span>)
1477 331:         <span class="ruby-keyword kw">end</span>
1478 332: 
1479 333:         <span class="ruby-comment cmt"># Now do a call pretty much exactly like in method_missing except with our own</span>
1480 334:         <span class="ruby-comment cmt"># options and discovery magic</span>
1481 335:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1482 336:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_options</span>, [<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
1483 337:             <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">r</span>)
1484 338:           <span class="ruby-keyword kw">end</span>
1485 339:         <span class="ruby-keyword kw">else</span>
1486 340:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_options</span>, [<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>)
1487 341:         <span class="ruby-keyword kw">end</span>
1488 342:       <span class="ruby-keyword kw">end</span></pre>
1489                                         </div>
1490                                         
1491                                 </div>
1492
1493                                 
1494                         </div>
1495
1496                 
1497                         <div id="disconnect-method" class="method-detail ">
1498                                 <a name="M000446"></a>
1499
1500                                 <div class="method-heading">
1501                                 
1502                                         <span class="method-name">disconnect</span><span
1503                                                 class="method-args">()</span>
1504                                         <span class="method-click-advice">click to toggle source</span>
1505                                 
1506                                 </div>
1507
1508                                 <div class="method-description">
1509                                         
1510                                         <p>
1511 Disconnects cleanly from the middleware
1512 </p>
1513                                         
1514
1515                                         
1516                                         <div class="method-source-code"
1517                                                 id="disconnect-source">
1518 <pre>
1519      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 121</span>
1520 121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span>
1521 122:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">disconnect</span>
1522 123:       <span class="ruby-keyword kw">end</span></pre>
1523                                         </div>
1524                                         
1525                                 </div>
1526
1527                                 
1528                         </div>
1529
1530                 
1531                         <div id="discover-method" class="method-detail ">
1532                                 <a name="M000466"></a>
1533
1534                                 <div class="method-heading">
1535                                 
1536                                         <span class="method-name">discover</span><span
1537                                                 class="method-args">(flags={})</span>
1538                                         <span class="method-click-advice">click to toggle source</span>
1539                                 
1540                                 </div>
1541
1542                                 <div class="method-description">
1543                                         
1544                                         <p>
1545 Does discovery based on the filters set, if a discovery was previously done
1546 return that else do a new discovery.
1547 </p>
1548 <p>
1549 Alternatively if identity filters are given and none of them are regular
1550 expressions then just use the provided data as discovered data, avoiding
1551 discovery
1552 </p>
1553 <p>
1554 <a href="../Discovery.html">Discovery</a> can be forced if
1555 direct_addressing is enabled by passing in an array of nodes with :nodes or
1556 JSON data like those produced by mcollective <a href="../RPC.html">RPC</a>
1557 JSON output using :json
1558 </p>
1559 <p>
1560 Will show a message indicating its doing discovery if running verbose or if
1561 the :verbose flag is passed in.
1562 </p>
1563 <p>
1564 Use reset to force a new discovery
1565 </p>
1566                                         
1567
1568                                         
1569                                         <div class="method-source-code"
1570                                                 id="discover-source">
1571 <pre>
1572      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 468</span>
1573 468:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover</span>(<span class="ruby-identifier">flags</span>={})
1574 469:         <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
1575 470:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown option #{key} passed to discover&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:verbose</span>, <span class="ruby-identifier">:hosts</span>, <span class="ruby-identifier">:nodes</span>, <span class="ruby-identifier">:json</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
1576 471:         <span class="ruby-keyword kw">end</span>
1577 472: 
1578 473:         <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:verbose</span>) <span class="ruby-operator">?</span> <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> = <span class="ruby-ivar">@verbose</span>
1579 474: 
1580 475:         <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@output_format</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
1581 476: 
1582 477:         <span class="ruby-comment cmt"># flags[:nodes] and flags[:hosts] are the same thing, we should never have</span>
1583 478:         <span class="ruby-comment cmt"># allowed :hosts as that was inconsistent with the established terminology</span>
1584 479:         <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] = <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:hosts</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:hosts</span>)
1585 480: 
1586 481:         <span class="ruby-identifier">reset</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
1587 482: 
1588 483:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_agents</span>
1589 484:           <span class="ruby-comment cmt"># if either hosts or JSON is supplied try to figure out discovery data from there</span>
1590 485:           <span class="ruby-comment cmt"># if direct_addressing is not enabled this is a critical error as the user might</span>
1591 486:           <span class="ruby-comment cmt"># not have supplied filters so raise an exception</span>
1592 487:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
1593 488:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only supply discovery data if direct_addressing is enabled&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1594 489: 
1595 490:             <span class="ruby-identifier">hosts</span> = []
1596 491: 
1597 492:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>]
1598 493:               <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">extract_hosts_from_array</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>])
1599 494:             <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
1600 495:               <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">extract_hosts_from_json</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>])
1601 496:             <span class="ruby-keyword kw">end</span>
1602 497: 
1603 498:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Could not find any hosts in discovery data provided&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">empty?</span>
1604 499: 
1605 500:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-identifier">hosts</span>
1606 501:             <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span>
1607 502: 
1608 503:           <span class="ruby-keyword kw">else</span>
1609 504:             <span class="ruby-identifier">identity_filter_discovery_optimization</span>
1610 505:           <span class="ruby-keyword kw">end</span>
1611 506:         <span class="ruby-keyword kw">end</span>
1612 507: 
1613 508:         <span class="ruby-comment cmt"># All else fails we do it the hard way using a traditional broadcast</span>
1614 509:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_agents</span>
1615 510:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_discovery</span> <span class="ruby-identifier">:start</span>
1616 511: 
1617 512:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
1618 513: 
1619 514:           <span class="ruby-comment cmt"># if compound filters are used the only real option is to use the mc</span>
1620 515:           <span class="ruby-comment cmt"># discovery plugin since its the only capable of using data queries etc</span>
1621 516:           <span class="ruby-comment cmt"># and we do not want to degrade that experience just to allow compounds</span>
1622 517:           <span class="ruby-comment cmt"># on other discovery plugins the UX would be too bad raising complex sets</span>
1623 518:           <span class="ruby-comment cmt"># of errors etc.</span>
1624 519:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
1625 520: 
1626 521:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
1627 522:             <span class="ruby-identifier">actual_timeout</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">discovery_timeout</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
1628 523: 
1629 524:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">actual_timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
1630 525:               <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;Discovering hosts using the %s method for %d second(s) .... &quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">actual_timeout</span>])
1631 526:             <span class="ruby-keyword kw">else</span>
1632 527:               <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;Discovering hosts using the %s method .... &quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_method</span>])
1633 528:             <span class="ruby-keyword kw">end</span>
1634 529:           <span class="ruby-keyword kw">end</span>
1635 530: 
1636 531:           <span class="ruby-comment cmt"># if the requested limit is a pure number and not a percent</span>
1637 532:           <span class="ruby-comment cmt"># and if we're configured to use the first found hosts as the</span>
1638 533:           <span class="ruby-comment cmt"># limit method then pass in the limit thus minimizing the amount</span>
1639 534:           <span class="ruby-comment cmt"># of work we do in the discover phase and speeding it up significantly</span>
1640 535:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:first</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@limit_targets</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>)
1641 536:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-ivar">@filter</span>, <span class="ruby-identifier">discovery_timeout</span>, <span class="ruby-ivar">@limit_targets</span>)
1642 537:           <span class="ruby-keyword kw">else</span>
1643 538:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-ivar">@filter</span>, <span class="ruby-identifier">discovery_timeout</span>)
1644 539:           <span class="ruby-keyword kw">end</span>
1645 540: 
1646 541:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-ivar">@discovered_agents</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
1647 542: 
1648 543:           <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_direct_mode?</span>
1649 544: 
1650 545:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_discovery</span> <span class="ruby-identifier">:end</span>
1651 546:         <span class="ruby-keyword kw">end</span>
1652 547: 
1653 548:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discovered_agents</span>(<span class="ruby-ivar">@discovered_agents</span>)
1654 549:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">discovered</span>(<span class="ruby-ivar">@discovered_agents</span>)
1655 550: 
1656 551:         <span class="ruby-ivar">@discovered_agents</span>
1657 552:       <span class="ruby-keyword kw">end</span></pre>
1658                                         </div>
1659                                         
1660                                 </div>
1661
1662                                 
1663                         </div>
1664
1665                 
1666                         <div id="discovery-method--method" class="method-detail ">
1667                                 <a name="M000457"></a>
1668
1669                                 <div class="method-heading">
1670                                 
1671                                         <span class="method-name">discovery_method=</span><span
1672                                                 class="method-args">(method)</span>
1673                                         <span class="method-click-advice">click to toggle source</span>
1674                                 
1675                                 </div>
1676
1677                                 <div class="method-description">
1678                                         
1679                                         <p>
1680 Sets the discovery method. If we change the method there are a number of
1681 steps to take:
1682 </p>
1683 <pre>
1684  - set the new method
1685  - if discovery options were provided, re-set those to initially
1686    provided ones else clear them as they might now apply to a
1687    different provider
1688  - update the client options so it knows there is a new discovery
1689    method in force
1690  - reset discovery data forcing a discover on the next request
1691 </pre>
1692 <p>
1693 The remaining item is the discovery timeout, we leave that as is since that
1694 is the user supplied timeout either via initial options or via specifically
1695 setting it on the client.
1696 </p>
1697                                         
1698
1699                                         
1700                                         <div class="method-source-code"
1701                                                 id="discovery-method--source">
1702 <pre>
1703      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 377</span>
1704 377:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_method=</span>(<span class="ruby-identifier">method</span>)
1705 378:         <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">false</span>
1706 379:         <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-identifier">method</span>
1707 380: 
1708 381:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initial_options</span>[<span class="ruby-identifier">:discovery_options</span>]
1709 382:           <span class="ruby-ivar">@discovery_options</span> = <span class="ruby-ivar">@initial_options</span>[<span class="ruby-identifier">:discovery_options</span>]
1710 383:         <span class="ruby-keyword kw">else</span>
1711 384:           <span class="ruby-ivar">@discovery_options</span>.<span class="ruby-identifier">clear</span>
1712 385:         <span class="ruby-keyword kw">end</span>
1713 386: 
1714 387:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
1715 388: 
1716 389:         <span class="ruby-identifier">reset</span>
1717 390:       <span class="ruby-keyword kw">end</span></pre>
1718                                         </div>
1719                                         
1720                                 </div>
1721
1722                                 
1723                         </div>
1724
1725                 
1726                         <div id="discovery-options--method" class="method-detail ">
1727                                 <a name="M000458"></a>
1728
1729                                 <div class="method-heading">
1730                                 
1731                                         <span class="method-name">discovery_options=</span><span
1732                                                 class="method-args">(options)</span>
1733                                         <span class="method-click-advice">click to toggle source</span>
1734                                 
1735                                 </div>
1736
1737                                 <div class="method-description">
1738                                         
1739                                         <p class="missing-docs">(Not documented)</p>
1740                                         
1741
1742                                         
1743                                         <div class="method-source-code"
1744                                                 id="discovery-options--source">
1745 <pre>
1746      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 392</span>
1747 392:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_options=</span>(<span class="ruby-identifier">options</span>)
1748 393:         <span class="ruby-ivar">@discovery_options</span> = [<span class="ruby-identifier">options</span>].<span class="ruby-identifier">flatten</span>
1749 394:         <span class="ruby-identifier">reset</span>
1750 395:       <span class="ruby-keyword kw">end</span></pre>
1751                                         </div>
1752                                         
1753                                 </div>
1754
1755                                 
1756                         </div>
1757
1758                 
1759                         <div id="discovery-timeout-method" class="method-detail ">
1760                                 <a name="M000455"></a>
1761
1762                                 <div class="method-heading">
1763                                 
1764                                         <span class="method-name">discovery_timeout</span><span
1765                                                 class="method-args">()</span>
1766                                         <span class="method-click-advice">click to toggle source</span>
1767                                 
1768                                 </div>
1769
1770                                 <div class="method-description">
1771                                         
1772                                         <p class="missing-docs">(Not documented)</p>
1773                                         
1774
1775                                         
1776                                         <div class="method-source-code"
1777                                                 id="discovery-timeout-source">
1778 <pre>
1779      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 344</span>
1780 344:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout</span>
1781 345:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@discovery_timeout</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovery_timeout</span>
1782 346:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>]
1783 347:       <span class="ruby-keyword kw">end</span></pre>
1784                                         </div>
1785                                         
1786                                 </div>
1787
1788                                 
1789                         </div>
1790
1791                 
1792                         <div id="discovery-timeout--method" class="method-detail ">
1793                                 <a name="M000456"></a>
1794
1795                                 <div class="method-heading">
1796                                 
1797                                         <span class="method-name">discovery_timeout=</span><span
1798                                                 class="method-args">(timeout)</span>
1799                                         <span class="method-click-advice">click to toggle source</span>
1800                                 
1801                                 </div>
1802
1803                                 <div class="method-description">
1804                                         
1805                                         <p class="missing-docs">(Not documented)</p>
1806                                         
1807
1808                                         
1809                                         <div class="method-source-code"
1810                                                 id="discovery-timeout--source">
1811 <pre>
1812      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 349</span>
1813 349:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout=</span>(<span class="ruby-identifier">timeout</span>)
1814 350:         <span class="ruby-ivar">@discovery_timeout</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">timeout</span>)
1815 351: 
1816 352:         <span class="ruby-comment cmt"># we calculate the overall timeout from the DDL of the agent and</span>
1817 353:         <span class="ruby-comment cmt"># the supplied discovery timeout unless someone specifically</span>
1818 354:         <span class="ruby-comment cmt"># specifies a timeout to the constructor</span>
1819 355:         <span class="ruby-comment cmt">#</span>
1820 356:         <span class="ruby-comment cmt"># But if we also then specifically set a discovery_timeout on the</span>
1821 357:         <span class="ruby-comment cmt"># agent that has to override the supplied timeout so we then</span>
1822 358:         <span class="ruby-comment cmt"># calculate a correct timeout based on DDL timeout and the</span>
1823 359:         <span class="ruby-comment cmt"># supplied discovery timeout</span>
1824 360:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">discovery_timeout</span>
1825 361:       <span class="ruby-keyword kw">end</span></pre>
1826                                         </div>
1827                                         
1828                                 </div>
1829
1830                                 
1831                         </div>
1832
1833                 
1834                         <div id="fact-filter-method" class="method-detail ">
1835                                 <a name="M000460"></a>
1836
1837                                 <div class="method-heading">
1838                                 
1839                                         <span class="method-name">fact_filter</span><span
1840                                                 class="method-args">(fact, value=nil, operator="=")</span>
1841                                         <span class="method-click-advice">click to toggle source</span>
1842                                 
1843                                 </div>
1844
1845                                 <div class="method-description">
1846                                         
1847                                         <p>
1848 Sets the fact filter
1849 </p>
1850                                         
1851
1852                                         
1853                                         <div class="method-source-code"
1854                                                 id="fact-filter-source">
1855 <pre>
1856      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 405</span>
1857 405:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fact_filter</span>(<span class="ruby-identifier">fact</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">operator</span>=<span class="ruby-value str">&quot;=&quot;</span>)
1858 406:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">nil?</span>
1859 407:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
1860 408: 
1861 409:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
1862 410:           <span class="ruby-identifier">parsed</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">parse_fact_string</span>(<span class="ruby-identifier">fact</span>)
1863 411:           <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">parsed</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parsed</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
1864 412:         <span class="ruby-keyword kw">else</span>
1865 413:           <span class="ruby-identifier">parsed</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">parse_fact_string</span>(<span class="ruby-node">&quot;#{fact}#{operator}#{value}&quot;</span>)
1866 414:           <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">parsed</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parsed</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
1867 415:         <span class="ruby-keyword kw">end</span>
1868 416: 
1869 417:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>].<span class="ruby-identifier">compact!</span>
1870 418:         <span class="ruby-identifier">reset</span>
1871 419:       <span class="ruby-keyword kw">end</span></pre>
1872                                         </div>
1873                                         
1874                                 </div>
1875
1876                                 
1877                         </div>
1878
1879                 
1880                         <div id="fire-and-forget-request-method" class="method-detail ">
1881                                 <a name="M000477"></a>
1882
1883                                 <div class="method-heading">
1884                                 
1885                                         <span class="method-name">fire_and_forget_request</span><span
1886                                                 class="method-args">(action, args, filter=nil)</span>
1887                                         <span class="method-click-advice">click to toggle source</span>
1888                                 
1889                                 </div>
1890
1891                                 <div class="method-description">
1892                                         
1893                                         <p>
1894 for requests that do not care for results just return the request id and
1895 don&#8217;t do any of the response processing.
1896 </p>
1897 <p>
1898 We send the :process_results flag with to the nodes so they can make
1899 decisions based on that.
1900 </p>
1901 <p>
1902 Should only be called via <a href="Client.html#M000452">method_missing</a>
1903 </p>
1904                                         
1905
1906                                         
1907                                         <div class="method-source-code"
1908                                                 id="fire-and-forget-request-source">
1909 <pre>
1910      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 710</span>
1911 710:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">filter</span>=<span class="ruby-keyword kw">nil</span>)
1912 711:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
1913 712: 
1914 713:         <span class="ruby-identifier">identity_filter_discovery_optimization</span>
1915 714: 
1916 715:         <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
1917 716: 
1918 717:         <span class="ruby-identifier">filter</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>
1919 718: 
1920 719:         <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>})
1921 720:         <span class="ruby-identifier">message</span>.<span class="ruby-identifier">reply_to</span> = <span class="ruby-ivar">@reply_to</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@reply_to</span>
1922 721: 
1923 722:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@force_direct_request</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_direct_mode?</span>
1924 723:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">clone</span>
1925 724:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span>
1926 725:         <span class="ruby-keyword kw">end</span>
1927 726: 
1928 727:         <span class="ruby-identifier">client</span>.<span class="ruby-identifier">sendreq</span>(<span class="ruby-identifier">message</span>, <span class="ruby-keyword kw">nil</span>)
1929 728:       <span class="ruby-keyword kw">end</span></pre>
1930                                         </div>
1931                                         
1932                                 </div>
1933
1934                                 
1935                         </div>
1936
1937                 
1938                         <div id="help-method" class="method-detail ">
1939                                 <a name="M000447"></a>
1940
1941                                 <div class="method-heading">
1942                                 
1943                                         <span class="method-name">help</span><span
1944                                                 class="method-args">(template)</span>
1945                                         <span class="method-click-advice">click to toggle source</span>
1946                                 
1947                                 </div>
1948
1949                                 <div class="method-description">
1950                                         
1951                                         <p>
1952 Returns help for an agent if a <a href="../DDL.html">DDL</a> was found
1953 </p>
1954                                         
1955
1956                                         
1957                                         <div class="method-source-code"
1958                                                 id="help-source">
1959 <pre>
1960      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 126</span>
1961 126:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">template</span>)
1962 127:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">help</span>(<span class="ruby-identifier">template</span>)
1963 128:       <span class="ruby-keyword kw">end</span></pre>
1964                                         </div>
1965                                         
1966                                 </div>
1967
1968                                 
1969                         </div>
1970
1971                 
1972                         <div id="identity-filter-method" class="method-detail ">
1973                                 <a name="M000462"></a>
1974
1975                                 <div class="method-heading">
1976                                 
1977                                         <span class="method-name">identity_filter</span><span
1978                                                 class="method-args">(identity)</span>
1979                                         <span class="method-click-advice">click to toggle source</span>
1980                                 
1981                                 </div>
1982
1983                                 <div class="method-description">
1984                                         
1985                                         <p>
1986 Sets the identity filter
1987 </p>
1988                                         
1989
1990                                         
1991                                         <div class="method-source-code"
1992                                                 id="identity-filter-source">
1993 <pre>
1994      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 429</span>
1995 429:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identity_filter</span>(<span class="ruby-identifier">identity</span>)
1996 430:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">identity</span>]
1997 431:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">compact!</span>
1998 432:         <span class="ruby-identifier">reset</span>
1999 433:       <span class="ruby-keyword kw">end</span></pre>
2000                                         </div>
2001                                         
2002                                 </div>
2003
2004                                 
2005                         </div>
2006
2007                 
2008                         <div id="identity-filter-discovery-optimization-method" class="method-detail ">
2009                                 <a name="M000478"></a>
2010
2011                                 <div class="method-heading">
2012                                 
2013                                         <span class="method-name">identity_filter_discovery_optimization</span><span
2014                                                 class="method-args">()</span>
2015                                         <span class="method-click-advice">click to toggle source</span>
2016                                 
2017                                 </div>
2018
2019                                 <div class="method-description">
2020                                         
2021                                         <p>
2022 if an identity filter is supplied and it is all strings no regex we can use
2023 that as discovery data, technically the identity filter is then redundant
2024 if we are in direct addressing mode and we could empty it out but this use
2025 case should only really be for a few -I&#8217;s on the CLI
2026 </p>
2027 <p>
2028 For safety we leave the filter in place for now, that way we can support
2029 this enhancement also in broadcast mode.
2030 </p>
2031 <p>
2032 This is only needed for the &#8216;mc&#8217; discovery method, other
2033 methods might change the concept of identity to mean something else so we
2034 should pass the full identity filter to them
2035 </p>
2036                                         
2037
2038                                         
2039                                         <div class="method-source-code"
2040                                                 id="identity-filter-discovery-optimization-source">
2041 <pre>
2042      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 741</span>
2043 741:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identity_filter_discovery_optimization</span>
2044 742:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@discovery_method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
2045 743:           <span class="ruby-identifier">regex_filters</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;^\/&quot;</span>)}.<span class="ruby-identifier">size</span>
2046 744: 
2047 745:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">regex_filters</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
2048 746:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">clone</span>
2049 747:             <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
2050 748:           <span class="ruby-keyword kw">end</span>
2051 749:         <span class="ruby-keyword kw">end</span>
2052 750:       <span class="ruby-keyword kw">end</span></pre>
2053                                         </div>
2054                                         
2055                                 </div>
2056
2057                                 
2058                         </div>
2059
2060                 
2061                         <div id="limit-method--method" class="method-detail ">
2062                                 <a name="M000470"></a>
2063
2064                                 <div class="method-heading">
2065                                 
2066                                         <span class="method-name">limit_method=</span><span
2067                                                 class="method-args">(method)</span>
2068                                         <span class="method-click-advice">click to toggle source</span>
2069                                 
2070                                 </div>
2071
2072                                 <div class="method-description">
2073                                         
2074                                         <p>
2075 Sets and sanity check the <a
2076 href="Client.html#limit_method">limit_method</a> variable used to determine
2077 how to limit targets if <a
2078 href="Client.html#limit_targets">limit_targets</a> is set
2079 </p>
2080                                         
2081
2082                                         
2083                                         <div class="method-source-code"
2084                                                 id="limit-method--source">
2085 <pre>
2086      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 599</span>
2087 599:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit_method=</span>(<span class="ruby-identifier">method</span>)
2088 600:         <span class="ruby-identifier">method</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
2089 601: 
2090 602:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown limit method #{method} must be :random or :first&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:random</span>, <span class="ruby-identifier">:first</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method</span>)
2091 603: 
2092 604:         <span class="ruby-ivar">@limit_method</span> = <span class="ruby-identifier">method</span>
2093 605:       <span class="ruby-keyword kw">end</span></pre>
2094                                         </div>
2095                                         
2096                                 </div>
2097
2098                                 
2099                         </div>
2100
2101                 
2102                         <div id="limit-targets--method" class="method-detail ">
2103                                 <a name="M000469"></a>
2104
2105                                 <div class="method-heading">
2106                                 
2107                                         <span class="method-name">limit_targets=</span><span
2108                                                 class="method-args">(limit)</span>
2109                                         <span class="method-click-advice">click to toggle source</span>
2110                                 
2111                                 </div>
2112
2113                                 <div class="method-description">
2114                                         
2115                                         <p>
2116 Sets and sanity checks the <a
2117 href="Client.html#limit_targets">limit_targets</a> variable used to
2118 restrict how many nodes we&#8217;ll target
2119 </p>
2120                                         
2121
2122                                         
2123                                         <div class="method-source-code"
2124                                                 id="limit-targets--source">
2125 <pre>
2126      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 583</span>
2127 583:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit_targets=</span>(<span class="ruby-identifier">limit</span>)
2128 584:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
2129 585:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Invalid limit specified: #{limit} valid limits are /^\d+%*$/&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">limit</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+%*$/</span>
2130 586: 
2131 587:           <span class="ruby-keyword kw">begin</span>
2132 588:             <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
2133 589:           <span class="ruby-keyword kw">rescue</span>
2134 590:             <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-identifier">limit</span>
2135 591:           <span class="ruby-keyword kw">end</span>
2136 592:         <span class="ruby-keyword kw">else</span>
2137 593:           <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
2138 594:         <span class="ruby-keyword kw">end</span>
2139 595:       <span class="ruby-keyword kw">end</span></pre>
2140                                         </div>
2141                                         
2142                                 </div>
2143
2144                                 
2145                         </div>
2146
2147                 
2148                         <div id="load-aggregate-functions-method" class="method-detail ">
2149                                 <a name="M000474"></a>
2150
2151                                 <div class="method-heading">
2152                                 
2153                                         <span class="method-name">load_aggregate_functions</span><span
2154                                                 class="method-args">(action, ddl)</span>
2155                                         <span class="method-click-advice">click to toggle source</span>
2156                                 
2157                                 </div>
2158
2159                                 <div class="method-description">
2160                                         
2161                                         <p class="missing-docs">(Not documented)</p>
2162                                         
2163
2164                                         
2165                                         <div class="method-source-code"
2166                                                 id="load-aggregate-functions-source">
2167 <pre>
2168      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 676</span>
2169 676:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">ddl</span>)
2170 677:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddl</span>
2171 678:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>).<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:aggregate</span>)
2172 679: 
2173 680:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Aggregate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>))
2174 681: 
2175 682:       <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
2176 683:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Failed to load aggregate functions, calculating summaries disabled: %s: %s (%s)&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>])
2177 684:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
2178 685:       <span class="ruby-keyword kw">end</span></pre>
2179                                         </div>
2180                                         
2181                                 </div>
2182
2183                                 
2184                         </div>
2185
2186                 
2187                         <div id="method-missing-method" class="method-detail ">
2188                                 <a name="M000452"></a>
2189
2190                                 <div class="method-heading">
2191                                 
2192                                         <span class="method-name">method_missing</span><span
2193                                                 class="method-args">(method_name, *args, &block)</span>
2194                                         <span class="method-click-advice">click to toggle source</span>
2195                                 
2196                                 </div>
2197
2198                                 <div class="method-description">
2199                                         
2200                                         <p>
2201 Magic handler to invoke remote methods
2202 </p>
2203 <p>
2204 Once the stub is created using the constructor or the <a
2205 href="../RPC.html#M000314">RPC#rpcclient</a> helper you can call remote
2206 actions easily:
2207 </p>
2208 <pre>
2209   ret = rpc.echo(:msg =&gt; &quot;hello world&quot;)
2210 </pre>
2211 <p>
2212 This will call the &#8216;echo&#8217; action of the &#8216;rpctest&#8217;
2213 agent and return the result as an array, the array will be a simplified
2214 result set from the usual full <a
2215 href="../Client.html#M000503">MCollective::Client#req</a> with additional
2216 error codes and error text:
2217 </p>
2218 <p>
2219 {
2220 </p>
2221 <pre>
2222   :sender =&gt; &quot;remote.box.com&quot;,
2223   :statuscode =&gt; 0,
2224   :statusmsg =&gt; &quot;OK&quot;,
2225   :data =&gt; &quot;hello world&quot;
2226 </pre>
2227 <p>
2228 }
2229 </p>
2230 <p>
2231 If :statuscode is 0 then everything went find, if it&#8217;s 1 then you
2232 supplied the correct arguments etc but the request could not be completed,
2233 you&#8217;ll find a human parsable reason in :statusmsg then.
2234 </p>
2235 <p>
2236 Codes 2 to 5 maps directly to <a
2237 href="../UnknownRPCAction.html">UnknownRPCAction</a>, <a
2238 href="../MissingRPCData.html">MissingRPCData</a>, <a
2239 href="../InvalidRPCData.html">InvalidRPCData</a> and <a
2240 href="../UnknownRPCError.html">UnknownRPCError</a> see below for a
2241 description of those, in each case :statusmsg would be the reason for
2242 failure.
2243 </p>
2244 <p>
2245 To get access to the full result of the <a
2246 href="../Client.html#M000503">MCollective::Client#req</a> calls you can
2247 pass in a block:
2248 </p>
2249 <pre>
2250   rpc.echo(:msg =&gt; &quot;hello world&quot;) do |resp|
2251      pp resp
2252   end
2253 </pre>
2254 <p>
2255 In this case resp will the result from <a
2256 href="../Client.html#M000503">MCollective::Client#req</a>. Instead of
2257 returning simple text and codes as above you&#8217;ll also need to handle
2258 the following exceptions:
2259 </p>
2260 <p>
2261 <a href="../UnknownRPCAction.html">UnknownRPCAction</a> - There is no
2262 matching action on the agent <a
2263 href="../MissingRPCData.html">MissingRPCData</a> - You did not supply all
2264 the needed parameters for the action <a
2265 href="../InvalidRPCData.html">InvalidRPCData</a> - The data you did supply
2266 did not pass validation <a
2267 href="../UnknownRPCError.html">UnknownRPCError</a> - Some other error
2268 prevented the agent from running
2269 </p>
2270 <p>
2271 During calls a progress indicator will be shown of how many results
2272 we&#8217;ve received against how many nodes were discovered, you can
2273 disable this by setting progress to false:
2274 </p>
2275 <pre>
2276   rpc.progress = false
2277 </pre>
2278 <p>
2279 This supports a 2nd mode where it will send the SimpleRPC request and never
2280 handle the responses. It&#8217;s a bit like UDP, it sends the request with
2281 the filter attached and you only get back the requestid, you have no
2282 indication about results.
2283 </p>
2284 <p>
2285 You can invoke this using:
2286 </p>
2287 <pre>
2288   puts rpc.echo(:process_results =&gt; false)
2289 </pre>
2290 <p>
2291 This will output just the request id.
2292 </p>
2293 <p>
2294 Batched processing is supported:
2295 </p>
2296 <pre>
2297   printrpc rpc.ping(:batch_size =&gt; 5)
2298 </pre>
2299 <p>
2300 This will do everything exactly as normal but communicate to only 5 agents
2301 at a time
2302 </p>
2303                                         
2304
2305                                         
2306                                         <div class="method-source-code"
2307                                                 id="method-missing-source">
2308 <pre>
2309      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 231</span>
2310 231:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2311 232:         <span class="ruby-comment cmt"># set args to an empty hash if nothings given</span>
2312 233:         <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
2313 234:         <span class="ruby-identifier">args</span> = {} <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
2314 235: 
2315 236:         <span class="ruby-identifier">action</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>
2316 237: 
2317 238:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">reset</span>
2318 239: 
2319 240:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
2320 241: 
2321 242:         <span class="ruby-comment cmt"># if a global batch size is set just use that else set it</span>
2322 243:         <span class="ruby-comment cmt"># in the case that it was passed as an argument</span>
2323 244:         <span class="ruby-identifier">batch_mode</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:batch_size</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_mode</span>
2324 245:         <span class="ruby-identifier">batch_size</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:batch_size</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_size</span>
2325 246:         <span class="ruby-identifier">batch_sleep_time</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:batch_sleep_time</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_sleep_time</span>
2326 247: 
2327 248:         <span class="ruby-comment cmt"># if we were given a batch_size argument thats 0 and batch_mode was</span>
2328 249:         <span class="ruby-comment cmt"># determined to be on via global options etc this will allow a batch_size</span>
2329 250:         <span class="ruby-comment cmt"># of 0 to disable or batch_mode for this call only</span>
2330 251:         <span class="ruby-identifier">batch_mode</span> = (<span class="ruby-identifier">batch_mode</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">batch_size</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>)
2331 252: 
2332 253:         <span class="ruby-comment cmt"># Handle single target requests by doing discovery and picking</span>
2333 254:         <span class="ruby-comment cmt"># a random node.  Then do a custom request specifying a filter</span>
2334 255:         <span class="ruby-comment cmt"># that will only match the one node.</span>
2335 256:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_targets</span>
2336 257:           <span class="ruby-identifier">target_nodes</span> = <span class="ruby-identifier">pick_nodes_from_discovered</span>(<span class="ruby-ivar">@limit_targets</span>)
2337 258:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Picked #{target_nodes.join(',')} as limited target(s)&quot;</span>)
2338 259: 
2339 260:           <span class="ruby-identifier">custom_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">target_nodes</span>, {<span class="ruby-value str">&quot;identity&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">/^(#{target_nodes.join('|')})$/</span>}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2340 261:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">batch_mode</span>
2341 262:           <span class="ruby-identifier">call_agent_batched</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">batch_size</span>, <span class="ruby-identifier">batch_sleep_time</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2342 263:         <span class="ruby-keyword kw">else</span>
2343 264:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">:auto</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2344 265:         <span class="ruby-keyword kw">end</span>
2345 266:       <span class="ruby-keyword kw">end</span></pre>
2346                                         </div>
2347                                         
2348                                 </div>
2349
2350                                 
2351                         </div>
2352
2353                 
2354                         <div id="new-request-method" class="method-detail ">
2355                                 <a name="M000448"></a>
2356
2357                                 <div class="method-heading">
2358                                 
2359                                         <span class="method-name">new_request</span><span
2360                                                 class="method-args">(action, data)</span>
2361                                         <span class="method-click-advice">click to toggle source</span>
2362                                 
2363                                 </div>
2364
2365                                 <div class="method-description">
2366                                         
2367                                         <p>
2368 Creates a suitable request hash for the SimpleRPC agent.
2369 </p>
2370 <p>
2371 You&#8217;d use this if you ever wanted to take care of sending requests on
2372 your own - perhaps via Client#sendreq if you didn&#8217;t care for
2373 responses.
2374 </p>
2375 <p>
2376 In that case you can just do:
2377 </p>
2378 <pre>
2379   msg = your_rpc.new_request(&quot;some_action&quot;, :foo =&gt; :bar)
2380   filter = your_rpc.filter
2381
2382   your_rpc.client.sendreq(msg, msg[:agent], filter)
2383 </pre>
2384 <p>
2385 This will send a SimpleRPC request to the action some_action with arguments
2386 :foo = :bar, it will return immediately and you will have no indication at
2387 all if the request was receieved or not
2388 </p>
2389 <p>
2390 Clearly the use of this technique should be limited and done only if your
2391 code requires such a thing
2392 </p>
2393                                         
2394
2395                                         
2396                                         <div class="method-source-code"
2397                                                 id="new-request-source">
2398 <pre>
2399      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 149</span>
2400 149:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">data</span>)
2401 150:         <span class="ruby-identifier">callerid</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">callerid</span>
2402 151: 
2403 152:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid received from security plugin is not valid'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">callerid</span>)
2404 153: 
2405 154:         {<span class="ruby-identifier">:agent</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
2406 155:          <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>,
2407 156:          <span class="ruby-identifier">:caller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">callerid</span>,
2408 157:          <span class="ruby-identifier">:data</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">data</span>}
2409 158:       <span class="ruby-keyword kw">end</span></pre>
2410                                         </div>
2411                                         
2412                                 </div>
2413
2414                                 
2415                         </div>
2416
2417                 
2418                         <div id="options-method" class="method-detail ">
2419                                 <a name="M000467"></a>
2420
2421                                 <div class="method-heading">
2422                                 
2423                                         <span class="method-name">options</span><span
2424                                                 class="method-args">()</span>
2425                                         <span class="method-click-advice">click to toggle source</span>
2426                                 
2427                                 </div>
2428
2429                                 <div class="method-description">
2430                                         
2431                                         <p>
2432 Provides a normal options hash like you would get from <a
2433 href="../Optionparser.html">Optionparser</a>
2434 </p>
2435                                         
2436
2437                                         
2438                                         <div class="method-source-code"
2439                                                 id="options-source">
2440 <pre>
2441      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 556</span>
2442 556:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span>
2443 557:         {<span class="ruby-identifier">:disctimeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">discovery_timeout</span>,
2444 558:          <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@timeout</span>,
2445 559:          <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@verbose</span>,
2446 560:          <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@filter</span>,
2447 561:          <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>,
2448 562:          <span class="ruby-identifier">:output_format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@output_format</span>,
2449 563:          <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@ttl</span>,
2450 564:          <span class="ruby-identifier">:discovery_method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovery_method</span>,
2451 565:          <span class="ruby-identifier">:discovery_options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovery_options</span>,
2452 566:          <span class="ruby-identifier">:force_display_mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@force_display_mode</span>,
2453 567:          <span class="ruby-identifier">:config</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@config</span>,
2454 568:          <span class="ruby-identifier">:publish_timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@publish_timeout</span>,
2455 569:          <span class="ruby-identifier">:threaded</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@threaded</span>}
2456 570:       <span class="ruby-keyword kw">end</span></pre>
2457                                         </div>
2458                                         
2459                                 </div>
2460
2461                                 
2462                         </div>
2463
2464                 
2465                         <div id="pick-nodes-from-discovered-method" class="method-detail ">
2466                                 <a name="M000473"></a>
2467
2468                                 <div class="method-heading">
2469                                 
2470                                         <span class="method-name">pick_nodes_from_discovered</span><span
2471                                                 class="method-args">(count)</span>
2472                                         <span class="method-click-advice">click to toggle source</span>
2473                                 
2474                                 </div>
2475
2476                                 <div class="method-description">
2477                                         
2478                                         <p>
2479 Pick a number of nodes from the discovered nodes
2480 </p>
2481 <p>
2482 The count should be a string that can be either just a number or a
2483 percentage like 10%
2484 </p>
2485 <p>
2486 It will select nodes from the discovered list based on the rpclimitmethod
2487 configuration option which can be either :first or anything else
2488 </p>
2489 <pre>
2490   - :first would be a simple way to do a distance based
2491     selection
2492   - anything else will just pick one at random
2493   - if random chosen, and batch-seed set, then set srand
2494     for the generator, and reset afterwards
2495 </pre>
2496                                         
2497
2498                                         
2499                                         <div class="method-source-code"
2500                                                 id="pick-nodes-from-discovered-source">
2501 <pre>
2502      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 635</span>
2503 635:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pick_nodes_from_discovered</span>(<span class="ruby-identifier">count</span>)
2504 636:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/%$/</span>
2505 637:           <span class="ruby-identifier">pct</span> = <span class="ruby-constant">Integer</span>((<span class="ruby-identifier">discover</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">count</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">100</span>)))
2506 638:           <span class="ruby-identifier">pct</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">count</span> = <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">count</span> = <span class="ruby-identifier">pct</span>
2507 639:         <span class="ruby-keyword kw">else</span>
2508 640:           <span class="ruby-identifier">count</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">count</span>)
2509 641:         <span class="ruby-keyword kw">end</span>
2510 642: 
2511 643:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discover</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">count</span>
2512 644: 
2513 645:         <span class="ruby-identifier">result</span> = []
2514 646: 
2515 647:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:first</span>
2516 648:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discover</span>[<span class="ruby-value">0</span>, <span class="ruby-identifier">count</span>]
2517 649:         <span class="ruby-keyword kw">else</span>
2518 650:           <span class="ruby-comment cmt"># we delete from the discovered list because we want</span>
2519 651:           <span class="ruby-comment cmt"># to be sure there is no chance that the same node will</span>
2520 652:           <span class="ruby-comment cmt"># be randomly picked twice.  So we have to clone the</span>
2521 653:           <span class="ruby-comment cmt"># discovered list else this method will only ever work</span>
2522 654:           <span class="ruby-comment cmt"># once per discovery cycle and not actually return the</span>
2523 655:           <span class="ruby-comment cmt"># right nodes.</span>
2524 656:           <span class="ruby-identifier">haystack</span> = <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">clone</span>
2525 657: 
2526 658:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_seed</span>
2527 659:             <span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">sort!</span>
2528 660:             <span class="ruby-identifier">srand</span>(<span class="ruby-ivar">@limit_seed</span>)
2529 661:           <span class="ruby-keyword kw">end</span>
2530 662: 
2531 663:           <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
2532 664:             <span class="ruby-identifier">rnd</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">size</span>)
2533 665:             <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">rnd</span>)
2534 666:           <span class="ruby-keyword kw">end</span>
2535 667: 
2536 668:           <span class="ruby-comment cmt"># Reset random number generator to fresh seed</span>
2537 669:           <span class="ruby-comment cmt"># As our seed from options is most likely short</span>
2538 670:           <span class="ruby-identifier">srand</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_seed</span>
2539 671:         <span class="ruby-keyword kw">end</span>
2540 672: 
2541 673:         [<span class="ruby-identifier">result</span>].<span class="ruby-identifier">flatten</span>
2542 674:       <span class="ruby-keyword kw">end</span></pre>
2543                                         </div>
2544                                         
2545                                 </div>
2546
2547                                 
2548                         </div>
2549
2550                 
2551                         <div id="process-results-with-block-method" class="method-detail ">
2552                                 <a name="M000485"></a>
2553
2554                                 <div class="method-heading">
2555                                 
2556                                         <span class="method-name">process_results_with_block</span><span
2557                                                 class="method-args">(action, resp, block, aggregate)</span>
2558                                         <span class="method-click-advice">click to toggle source</span>
2559                                 
2560                                 </div>
2561
2562                                 <div class="method-description">
2563                                         
2564                                         <p>
2565 process client requests by calling a block on each result in this mode we
2566 do not do anything fancy with the result objects and we raise exceptions if
2567 there are problems with the data
2568 </p>
2569                                         
2570
2571                                         
2572                                         <div class="method-source-code"
2573                                                 id="process-results-with-block-source">
2574 <pre>
2575      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 944</span>
2576 944:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
2577 945:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">node_responded</span>(<span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>])
2578 946: 
2579 947:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>)
2580 948:         <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
2581 949: 
2582 950:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
2583 951:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ok</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
2584 952:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
2585 953:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_block_execution</span> <span class="ruby-identifier">:start</span>
2586 954: 
2587 955:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
2588 956:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
2589 957:               <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">resp</span>)
2590 958:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
2591 959:               <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">result</span>)
2592 960:           <span class="ruby-keyword kw">end</span>
2593 961: 
2594 962:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_block_execution</span> <span class="ruby-identifier">:end</span>
2595 963:         <span class="ruby-keyword kw">else</span>
2596 964:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span>
2597 965: 
2598 966:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>]
2599 967:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
2600 968:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCAction</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
2601 969:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
2602 970:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">MissingRPCData</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
2603 971:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">4</span>
2604 972:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRPCData</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
2605 973:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">5</span>
2606 974:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCError</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
2607 975:           <span class="ruby-keyword kw">end</span>
2608 976:         <span class="ruby-keyword kw">end</span>
2609 977: 
2610 978:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">aggregate</span>
2611 979:       <span class="ruby-keyword kw">end</span></pre>
2612                                         </div>
2613                                         
2614                                 </div>
2615
2616                                 
2617                         </div>
2618
2619                 
2620                         <div id="process-results-without-block-method" class="method-detail ">
2621                                 <a name="M000481"></a>
2622
2623                                 <div class="method-heading">
2624                                 
2625                                         <span class="method-name">process_results_without_block</span><span
2626                                                 class="method-args">(resp, action, aggregate)</span>
2627                                         <span class="method-click-advice">click to toggle source</span>
2628                                 
2629                                 </div>
2630
2631                                 <div class="method-description">
2632                                         
2633                                         <p>
2634 Handles result sets that has no block associated, sets fails and ok in the
2635 stats object and return a hash of the response to send to the caller
2636 </p>
2637                                         
2638
2639                                         
2640                                         <div class="method-source-code"
2641                                                 id="process-results-without-block-source">
2642 <pre>
2643      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 924</span>
2644 924:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
2645 925:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">node_responded</span>(<span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>])
2646 926: 
2647 927:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>)
2648 928:         <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
2649 929: 
2650 930:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
2651 931:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ok</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
2652 932:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
2653 933:         <span class="ruby-keyword kw">else</span>
2654 934:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span>
2655 935:         <span class="ruby-keyword kw">end</span>
2656 936: 
2657 937:         [<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>]
2658 938:       <span class="ruby-keyword kw">end</span></pre>
2659                                         </div>
2660                                         
2661                                 </div>
2662
2663                                 
2664                         </div>
2665
2666                 
2667                         <div id="reset-method" class="method-detail ">
2668                                 <a name="M000464"></a>
2669
2670                                 <div class="method-heading">
2671                                 
2672                                         <span class="method-name">reset</span><span
2673                                                 class="method-args">()</span>
2674                                         <span class="method-click-advice">click to toggle source</span>
2675                                 
2676                                 </div>
2677
2678                                 <div class="method-description">
2679                                         
2680                                         <p>
2681 Resets various internal parts of the class, most importantly it clears out
2682 the cached discovery
2683 </p>
2684                                         
2685
2686                                         
2687                                         <div class="method-source-code"
2688                                                 id="reset-source">
2689 <pre>
2690      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 443</span>
2691 443:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
2692 444:         <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-keyword kw">nil</span>
2693 445:       <span class="ruby-keyword kw">end</span></pre>
2694                                         </div>
2695                                         
2696                                 </div>
2697
2698                                 
2699                         </div>
2700
2701                 
2702                         <div id="reset-filter-method" class="method-detail ">
2703                                 <a name="M000465"></a>
2704
2705                                 <div class="method-heading">
2706                                 
2707                                         <span class="method-name">reset_filter</span><span
2708                                                 class="method-args">()</span>
2709                                         <span class="method-click-advice">click to toggle source</span>
2710                                 
2711                                 </div>
2712
2713                                 <div class="method-description">
2714                                         
2715                                         <p>
2716 Reet the filter to an empty one
2717 </p>
2718                                         
2719
2720                                         
2721                                         <div class="method-source-code"
2722                                                 id="reset-filter-source">
2723 <pre>
2724      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 448</span>
2725 448:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset_filter</span>
2726 449:         <span class="ruby-ivar">@filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
2727 450:         <span class="ruby-identifier">agent_filter</span> <span class="ruby-ivar">@agent</span>
2728 451:       <span class="ruby-keyword kw">end</span></pre>
2729                                         </div>
2730                                         
2731                                 </div>
2732
2733                                 
2734                         </div>
2735
2736                 
2737                         <div id="rpc-result-from-reply-method" class="method-detail ">
2738                                 <a name="M000476"></a>
2739
2740                                 <div class="method-heading">
2741                                 
2742                                         <span class="method-name">rpc_result_from_reply</span><span
2743                                                 class="method-args">(agent, action, reply)</span>
2744                                         <span class="method-click-advice">click to toggle source</span>
2745                                 
2746                                 </div>
2747
2748                                 <div class="method-description">
2749                                         
2750                                         <p class="missing-docs">(Not documented)</p>
2751                                         
2752
2753                                         
2754                                         <div class="method-source-code"
2755                                                 id="rpc-result-from-reply-source">
2756 <pre>
2757      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 697</span>
2758 697:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">reply</span>)
2759 698:         <span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, {<span class="ruby-identifier">:sender</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:senderid</span>], <span class="ruby-identifier">:statuscode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>],
2760 699:                                    <span class="ruby-identifier">:statusmsg</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>], <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:data</span>]})
2761 700:       <span class="ruby-keyword kw">end</span></pre>
2762                                         </div>
2763                                         
2764                                 </div>
2765
2766                                 
2767                         </div>
2768
2769                 
2770                         <div id="validate-request-method" class="method-detail ">
2771                                 <a name="M000449"></a>
2772
2773                                 <div class="method-heading">
2774                                 
2775                                         <span class="method-name">validate_request</span><span
2776                                                 class="method-args">(action, args)</span>
2777                                         <span class="method-click-advice">click to toggle source</span>
2778                                 
2779                                 </div>
2780
2781                                 <div class="method-description">
2782                                         
2783                                         <p>
2784 For the provided arguments and action the input arguments get modified by
2785 supplying any defaults provided in the <a href="../DDL.html">DDL</a> for
2786 arguments that were not supplied in the request
2787 </p>
2788 <p>
2789 We then pass the modified arguments to the <a href="../DDL.html">DDL</a>
2790 for validation
2791 </p>
2792                                         
2793
2794                                         
2795                                         <div class="method-source-code"
2796                                                 id="validate-request-source">
2797 <pre>
2798      <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 165</span>
2799 165:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
2800 166:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No DDL found for agent %s cannot validate inputs&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@agent</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ddl</span>
2801 167: 
2802 168:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">set_default_input_arguments</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
2803 169:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">validate_rpc_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
2804 170:       <span class="ruby-keyword kw">end</span></pre>
2805                                         </div>
2806                                         
2807                                 </div>
2808
2809                                 
2810                         </div>
2811
2812                 
2813                 </div>
2814         
2815
2816         </div>
2817
2818
2819         <div id="rdoc-debugging-section-dump" class="debugging-section">
2820         
2821                 <p>Disabled; run with --debug to generate this.</p>
2822         
2823         </div>
2824
2825         <div id="validator-badges">
2826                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
2827                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
2828                         Rdoc Generator</a> 1.1.6</small>.</p>
2829         </div>
2830
2831 </body>
2832 </html>
2833