Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / Discovery.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::Discovery</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/discovery_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/discovery.rb">lib/mcollective/discovery.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="#M000141">::new</a></li>
63                                         
64                                         <li><a href="#M000148">#check_capabilities</a></li>
65                                         
66                                         <li><a href="#M000147">#ddl</a></li>
67                                         
68                                         <li><a href="#M000156">#discover</a></li>
69                                         
70                                         <li><a href="#M000146">#discovery_class</a></li>
71                                         
72                                         <li><a href="#M000145">#discovery_method</a></li>
73                                         
74                                         <li><a href="#M000155">#discovery_timeout</a></li>
75                                         
76                                         <li><a href="#M000142">#find_known_methods</a></li>
77                                         
78                                         <li><a href="#M000144">#force_direct_mode?</a></li>
79                                         
80                                         <li><a href="#M000149">#force_discovery_method_by_filter</a></li>
81                                         
82                                         <li><a href="#M000143">#has_method?</a></li>
83                                         
84                                         <li><a href="#M000150">#timeout_for_compound_filter</a></li>
85                                         
86                                 </ul>
87                         </div>
88                         
89
90                         <!-- Included Modules -->
91                         
92                 </div>
93
94                 <div id="project-metadata">
95                         
96                         
97                         <div id="fileindex-section" class="section project-section">
98                                 <h3 class="section-header">Files</h3>
99                                 <ul>
100                                 
101                                         <li class="file"><a href="../COPYING.html">COPYING</a></li>
102                                 
103                                         <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
104                                 
105                                         <li class="file"><a href="../README.html">README</a></li>
106                                 
107                                         <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
108                                 
109                                         <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
110                                 
111                                         <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
112                                 
113                                         <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
114                                 
115                                         <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
116                                 
117                                         <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
118                                 
119                                         <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
120                                 
121                                         <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
122                                 
123                                         <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
124                                 
125                                         <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
126                                 
127                                         <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
128                                 
129                                         <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
130                                 
131                                         <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
132                                 
133                                         <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
134                                 
135                                         <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
136                                 
137                                         <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
138                                 
139                                         <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
140                                 
141                                 </ul>
142                         </div>
143                         
144
145                         <div id="classindex-section" class="section project-section">
146                                 <h3 class="section-header">Class Index
147                                         <span class="search-toggle"><img src="../images/find.png"
148                                                 height="16" width="16" alt="[+]"
149                                                 title="show/hide quicksearch" /></span></h3>
150                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
151                                 <fieldset>
152                                         <legend>Quicksearch</legend>
153                                         <input type="text" name="quicksearch" value=""
154                                                 class="quicksearch-field" />
155                                 </fieldset>
156                                 </form>
157
158                                 <ul class="link-list">
159                                 
160                                         <li><a href="../MCollective.html">MCollective</a></li>
161                                 
162                                         <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
163                                 
164                                         <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
165                                 
166                                         <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
167                                 
168                                         <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
169                                 
170                                         <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
171                                 
172                                         <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
173                                 
174                                         <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
175                                 
176                                         <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
177                                 
178                                         <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
179                                 
180                                         <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
181                                 
182                                         <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
183                                 
184                                         <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
185                                 
186                                         <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
187                                 
188                                         <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
189                                 
190                                         <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
191                                 
192                                         <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
193                                 
194                                         <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
195                                 
196                                         <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
197                                 
198                                         <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
199                                 
200                                         <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
201                                 
202                                         <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
203                                 
204                                         <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
205                                 
206                                         <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
207                                 
208                                         <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
209                                 
210                                         <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
211                                 
212                                         <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
213                                 
214                                         <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
215                                 
216                                         <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
217                                 
218                                         <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
219                                 
220                                         <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
221                                 
222                                         <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
223                                 
224                                         <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
225                                 
226                                         <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
227                                 
228                                         <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
229                                 
230                                         <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
231                                 
232                                         <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
233                                 
234                                         <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
235                                 
236                                         <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
237                                 
238                                         <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
239                                 
240                                         <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
241                                 
242                                         <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
243                                 
244                                         <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
245                                 
246                                         <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
247                                 
248                                         <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
249                                 
250                                         <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
251                                 
252                                         <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
253                                 
254                                         <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
255                                 
256                                         <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
257                                 
258                                         <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
259                                 
260                                         <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
261                                 
262                                         <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
263                                 
264                                         <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
265                                 
266                                         <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
267                                 
268                                         <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
269                                 
270                                         <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
271                                 
272                                         <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
273                                 
274                                         <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
275                                 
276                                         <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
277                                 
278                                         <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
279                                 
280                                         <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
281                                 
282                                         <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
283                                 
284                                         <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
285                                 
286                                         <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
287                                 
288                                         <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
289                                 
290                                         <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
291                                 
292                                         <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
293                                 
294                                         <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
295                                 
296                                         <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
297                                 
298                                         <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
299                                 
300                                         <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
301                                 
302                                         <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
303                                 
304                                         <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
305                                 
306                                         <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
307                                 
308                                         <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
309                                 
310                                         <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
311                                 
312                                         <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
313                                 
314                                         <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
315                                 
316                                         <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
317                                 
318                                         <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
319                                 
320                                         <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
321                                 
322                                         <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
323                                 
324                                         <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
325                                 
326                                         <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
327                                 
328                                         <li><a href="../Array.html">Array</a></li>
329                                 
330                                         <li><a href="../Dir.html">Dir</a></li>
331                                 
332                                         <li><a href="../Object.html">Object</a></li>
333                                 
334                                         <li><a href="../String.html">String</a></li>
335                                 
336                                         <li><a href="../Symbol.html">Symbol</a></li>
337                                 
338                                 </ul>
339                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
340                         </div>
341
342                         
343                 </div>
344         </div>
345
346         <div id="documentation">
347                 <h1 class="class">MCollective::Discovery</h1>
348
349                 <div id="description">
350                         
351                 </div>
352
353                 <!-- Constants -->
354                 
355
356                 <!-- Attributes -->
357                 
358
359                 <!-- Methods -->
360                 
361                 <div id="public-class-method-details" class="method-section section">
362                         <h3 class="section-header">Public Class Methods</h3>
363
364                 
365                         <div id="new-method" class="method-detail ">
366                                 <a name="M000141"></a>
367
368                                 <div class="method-heading">
369                                 
370                                         <span class="method-name">new</span><span
371                                                 class="method-args">(client)</span>
372                                         <span class="method-click-advice">click to toggle source</span>
373                                 
374                                 </div>
375
376                                 <div class="method-description">
377                                         
378                                         <p class="missing-docs">(Not documented)</p>
379                                         
380
381                                         
382                                         <div class="method-source-code"
383                                                 id="new-source">
384 <pre>
385    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 3</span>
386 3:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">client</span>)
387 4:       <span class="ruby-ivar">@known_methods</span> = <span class="ruby-identifier">find_known_methods</span>
388 5:       <span class="ruby-ivar">@default_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">default_discovery_method</span>
389 6:       <span class="ruby-ivar">@client</span> = <span class="ruby-identifier">client</span>
390 7:     <span class="ruby-keyword kw">end</span></pre>
391                                         </div>
392                                         
393                                 </div>
394
395                                 
396                         </div>
397
398                 
399                 </div>
400         
401                 <div id="public-instance-method-details" class="method-section section">
402                         <h3 class="section-header">Public Instance Methods</h3>
403
404                 
405                         <div id="check-capabilities-method" class="method-detail ">
406                                 <a name="M000148"></a>
407
408                                 <div class="method-heading">
409                                 
410                                         <span class="method-name">check_capabilities</span><span
411                                                 class="method-args">(filter)</span>
412                                         <span class="method-click-advice">click to toggle source</span>
413                                 
414                                 </div>
415
416                                 <div class="method-description">
417                                         
418                                         <p>
419 <a href="Agent.html">Agent</a> filters are always present no matter what,
420 so we cant raise an error if the capabilities suggest the discovery method
421 cant do agents we just have to rely on the discovery plugin to not do
422 stupid things in the presense of a agent filter
423 </p>
424                                         
425
426                                         
427                                         <div class="method-source-code"
428                                                 id="check-capabilities-source">
429 <pre>
430     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 62</span>
431 62:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_capabilities</span>(<span class="ruby-identifier">filter</span>)
432 63:       <span class="ruby-identifier">capabilities</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">discovery_interface</span>[<span class="ruby-identifier">:capabilities</span>]
433 64: 
434 65:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:classes</span>)
435 66:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use class filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>].<span class="ruby-identifier">empty?</span>
436 67:       <span class="ruby-keyword kw">end</span>
437 68: 
438 69:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:facts</span>)
439 70:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use fact filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>].<span class="ruby-identifier">empty?</span>
440 71:       <span class="ruby-keyword kw">end</span>
441 72: 
442 73:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:identity</span>)
443 74:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use identity filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">empty?</span>
444 75:       <span class="ruby-keyword kw">end</span>
445 76: 
446 77:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:compound</span>)
447 78:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use compound filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
448 79:       <span class="ruby-keyword kw">end</span>
449 80:     <span class="ruby-keyword kw">end</span></pre>
450                                         </div>
451                                         
452                                 </div>
453
454                                 
455                         </div>
456
457                 
458                         <div id="ddl-method" class="method-detail ">
459                                 <a name="M000147"></a>
460
461                                 <div class="method-heading">
462                                 
463                                         <span class="method-name">ddl</span><span
464                                                 class="method-args">()</span>
465                                         <span class="method-click-advice">click to toggle source</span>
466                                 
467                                 </div>
468
469                                 <div class="method-description">
470                                         
471                                         <p class="missing-docs">(Not documented)</p>
472                                         
473
474                                         
475                                         <div class="method-source-code"
476                                                 id="ddl-source">
477 <pre>
478     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 47</span>
479 47:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ddl</span>
480 48:       <span class="ruby-ivar">@ddl</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">:discovery</span>)
481 49: 
482 50:       <span class="ruby-comment cmt"># if the discovery method got changed we might have an old DDL cached</span>
483 51:       <span class="ruby-comment cmt"># this will detect that and reread the correct DDL from disk</span>
484 52:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:name</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">discovery_method</span>
485 53:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">:discovery</span>)
486 54:       <span class="ruby-keyword kw">end</span>
487 55: 
488 56:       <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ddl</span>
489 57:     <span class="ruby-keyword kw">end</span></pre>
490                                         </div>
491                                         
492                                 </div>
493
494                                 
495                         </div>
496
497                 
498                         <div id="discover-method" class="method-detail ">
499                                 <a name="M000156"></a>
500
501                                 <div class="method-heading">
502                                 
503                                         <span class="method-name">discover</span><span
504                                                 class="method-args">(filter, timeout, limit)</span>
505                                         <span class="method-click-advice">click to toggle source</span>
506                                 
507                                 </div>
508
509                                 <div class="method-description">
510                                         
511                                         <p class="missing-docs">(Not documented)</p>
512                                         
513
514                                         
515                                         <div class="method-source-code"
516                                                 id="discover-source">
517 <pre>
518      <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 127</span>
519 127:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">limit</span>)
520 128:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Limit has to be an integer&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>)
521 129: 
522 130:       <span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">filter</span>)
523 131: 
524 132:       <span class="ruby-identifier">check_capabilities</span>(<span class="ruby-identifier">filter</span>)
525 133: 
526 134:       <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discovery_class</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">filter</span>), <span class="ruby-identifier">limit</span>, <span class="ruby-ivar">@client</span>)
527 135: 
528 136:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">limit</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
529 137:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discovered</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">limit</span>]
530 138:       <span class="ruby-keyword kw">else</span>
531 139:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discovered</span>
532 140:       <span class="ruby-keyword kw">end</span>
533 141:     <span class="ruby-keyword kw">end</span></pre>
534                                         </div>
535                                         
536                                 </div>
537
538                                 
539                         </div>
540
541                 
542                         <div id="discovery-class-method" class="method-detail ">
543                                 <a name="M000146"></a>
544
545                                 <div class="method-heading">
546                                 
547                                         <span class="method-name">discovery_class</span><span
548                                                 class="method-args">()</span>
549                                         <span class="method-click-advice">click to toggle source</span>
550                                 
551                                 </div>
552
553                                 <div class="method-description">
554                                         
555                                         <p class="missing-docs">(Not documented)</p>
556                                         
557
558                                         
559                                         <div class="method-source-code"
560                                                 id="discovery-class-source">
561 <pre>
562     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 39</span>
563 39:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_class</span>
564 40:       <span class="ruby-identifier">method</span> = <span class="ruby-identifier">discovery_method</span>.<span class="ruby-identifier">capitalize</span>
565 41: 
566 42:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;MCollective::Discovery::#{method}&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">method</span>)
567 43: 
568 44:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">method</span>)
569 45:     <span class="ruby-keyword kw">end</span></pre>
570                                         </div>
571                                         
572                                 </div>
573
574                                 
575                         </div>
576
577                 
578                         <div id="discovery-method-method" class="method-detail ">
579                                 <a name="M000145"></a>
580
581                                 <div class="method-heading">
582                                 
583                                         <span class="method-name">discovery_method</span><span
584                                                 class="method-args">()</span>
585                                         <span class="method-click-advice">click to toggle source</span>
586                                 
587                                 </div>
588
589                                 <div class="method-description">
590                                         
591                                         <p class="missing-docs">(Not documented)</p>
592                                         
593
594                                         
595                                         <div class="method-source-code"
596                                                 id="discovery-method-source">
597 <pre>
598     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 21</span>
599 21:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_method</span>
600 22:       <span class="ruby-identifier">method</span> = <span class="ruby-value str">&quot;mc&quot;</span>
601 23: 
602 24:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>]
603 25:         <span class="ruby-identifier">method</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>]
604 26:       <span class="ruby-keyword kw">else</span>
605 27:         <span class="ruby-identifier">method</span> = <span class="ruby-ivar">@default_method</span>
606 28:       <span class="ruby-keyword kw">end</span>
607 29: 
608 30:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown discovery method %s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">has_method?</span>(<span class="ruby-identifier">method</span>)
609 31: 
610 32:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
611 33:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Custom discovery methods require direct addressing mode&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>
612 34:       <span class="ruby-keyword kw">end</span>
613 35: 
614 36:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">method</span>
615 37:     <span class="ruby-keyword kw">end</span></pre>
616                                         </div>
617                                         
618                                 </div>
619
620                                 
621                         </div>
622
623                 
624                         <div id="discovery-timeout-method" class="method-detail ">
625                                 <a name="M000155"></a>
626
627                                 <div class="method-heading">
628                                 
629                                         <span class="method-name">discovery_timeout</span><span
630                                                 class="method-args">(timeout, filter)</span>
631                                         <span class="method-click-advice">click to toggle source</span>
632                                 
633                                 </div>
634
635                                 <div class="method-description">
636                                         
637                                         <p class="missing-docs">(Not documented)</p>
638                                         
639
640                                         
641                                         <div class="method-source-code"
642                                                 id="discovery-timeout-source">
643 <pre>
644      <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 117</span>
645 117:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">filter</span>)
646 118:       <span class="ruby-identifier">timeout</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">timeout</span>
647 119: 
648 120:       <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>)
649 121:         <span class="ruby-identifier">timeout</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">timeout_for_compound_filter</span>(<span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>])
650 122:       <span class="ruby-keyword kw">else</span>
651 123:         <span class="ruby-identifier">timeout</span>
652 124:       <span class="ruby-keyword kw">end</span>
653 125:     <span class="ruby-keyword kw">end</span></pre>
654                                         </div>
655                                         
656                                 </div>
657
658                                 
659                         </div>
660
661                 
662                         <div id="find-known-methods-method" class="method-detail ">
663                                 <a name="M000142"></a>
664
665                                 <div class="method-heading">
666                                 
667                                         <span class="method-name">find_known_methods</span><span
668                                                 class="method-args">()</span>
669                                         <span class="method-click-advice">click to toggle source</span>
670                                 
671                                 </div>
672
673                                 <div class="method-description">
674                                         
675                                         <p class="missing-docs">(Not documented)</p>
676                                         
677
678                                         
679                                         <div class="method-source-code"
680                                                 id="find-known-methods-source">
681 <pre>
682     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 9</span>
683  9:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_known_methods</span>
684 10:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">&quot;discovery&quot;</span>)
685 11:     <span class="ruby-keyword kw">end</span></pre>
686                                         </div>
687                                         
688                                 </div>
689
690                                 
691                         </div>
692
693                 
694                         <div id="force-direct-mode--method" class="method-detail ">
695                                 <a name="M000144"></a>
696
697                                 <div class="method-heading">
698                                 
699                                         <span class="method-name">force_direct_mode?</span><span
700                                                 class="method-args">()</span>
701                                         <span class="method-click-advice">click to toggle source</span>
702                                 
703                                 </div>
704
705                                 <div class="method-description">
706                                         
707                                         <p class="missing-docs">(Not documented)</p>
708                                         
709
710                                         
711                                         <div class="method-source-code"
712                                                 id="force-direct-mode--source">
713 <pre>
714     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 17</span>
715 17:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">force_direct_mode?</span>
716 18:       <span class="ruby-identifier">discovery_method</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;mc&quot;</span>
717 19:     <span class="ruby-keyword kw">end</span></pre>
718                                         </div>
719                                         
720                                 </div>
721
722                                 
723                         </div>
724
725                 
726                         <div id="force-discovery-method-by-filter-method" class="method-detail ">
727                                 <a name="M000149"></a>
728
729                                 <div class="method-heading">
730                                 
731                                         <span class="method-name">force_discovery_method_by_filter</span><span
732                                                 class="method-args">(filter)</span>
733                                         <span class="method-click-advice">click to toggle source</span>
734                                 
735                                 </div>
736
737                                 <div class="method-description">
738                                         
739                                         <p>
740 checks if compound filters are used and then forces the &#8216;mc&#8217;
741 discovery plugin
742 </p>
743                                         
744
745                                         
746                                         <div class="method-source-code"
747                                                 id="force-discovery-method-by-filter-source">
748 <pre>
749     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 83</span>
750 83:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">filter</span>)
751 84:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
752 85:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
753 86:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;Switching to mc discovery method because compound filters are used&quot;</span>
754 87:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>] = <span class="ruby-value str">&quot;mc&quot;</span>
755 88: 
756 89:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
757 90:         <span class="ruby-keyword kw">end</span>
758 91:       <span class="ruby-keyword kw">end</span>
759 92: 
760 93:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
761 94:     <span class="ruby-keyword kw">end</span></pre>
762                                         </div>
763                                         
764                                 </div>
765
766                                 
767                         </div>
768
769                 
770                         <div id="has-method--method" class="method-detail ">
771                                 <a name="M000143"></a>
772
773                                 <div class="method-heading">
774                                 
775                                         <span class="method-name">has_method?</span><span
776                                                 class="method-args">(method)</span>
777                                         <span class="method-click-advice">click to toggle source</span>
778                                 
779                                 </div>
780
781                                 <div class="method-description">
782                                         
783                                         <p class="missing-docs">(Not documented)</p>
784                                         
785
786                                         
787                                         <div class="method-source-code"
788                                                 id="has-method--source">
789 <pre>
790     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 13</span>
791 13:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_method?</span>(<span class="ruby-identifier">method</span>)
792 14:       <span class="ruby-ivar">@known_methods</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method</span>)
793 15:     <span class="ruby-keyword kw">end</span></pre>
794                                         </div>
795                                         
796                                 </div>
797
798                                 
799                         </div>
800
801                 
802                         <div id="timeout-for-compound-filter-method" class="method-detail ">
803                                 <a name="M000150"></a>
804
805                                 <div class="method-heading">
806                                 
807                                         <span class="method-name">timeout_for_compound_filter</span><span
808                                                 class="method-args">(compound_filter)</span>
809                                         <span class="method-click-advice">click to toggle source</span>
810                                 
811                                 </div>
812
813                                 <div class="method-description">
814                                         
815                                         <p>
816 if a compound filter is specified and it has any function then we read the
817 <a href="DDL.html">DDL</a> for each of those plugins and sum up the timeout
818 declared in the <a href="DDL.html">DDL</a>
819 </p>
820                                         
821
822                                         
823                                         <div class="method-source-code"
824                                                 id="timeout-for-compound-filter-source">
825 <pre>
826      <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 99</span>
827  99:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timeout_for_compound_filter</span>(<span class="ruby-identifier">compound_filter</span>)
828 100:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">empty?</span>
829 101: 
830 102:       <span class="ruby-identifier">timeout</span> = <span class="ruby-value">0</span>
831 103: 
832 104:       <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filter</span><span class="ruby-operator">|</span>
833 105:         <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
834 106:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>]
835 107:             <span class="ruby-identifier">pluginname</span> = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;name&quot;</span>])
836 108:             <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>, <span class="ruby-identifier">:data</span>)
837 109:             <span class="ruby-identifier">timeout</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>]
838 110:           <span class="ruby-keyword kw">end</span>
839 111:         <span class="ruby-keyword kw">end</span>
840 112:       <span class="ruby-keyword kw">end</span>
841 113: 
842 114:       <span class="ruby-identifier">timeout</span>
843 115:     <span class="ruby-keyword kw">end</span></pre>
844                                         </div>
845                                         
846                                 </div>
847
848                                 
849                         </div>
850
851                 
852                 </div>
853         
854
855         </div>
856
857
858         <div id="rdoc-debugging-section-dump" class="debugging-section">
859         
860                 <p>Disabled; run with --debug to generate this.</p>
861         
862         </div>
863
864         <div id="validator-badges">
865                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
866                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
867                         Rdoc Generator</a> 1.1.6</small>.</p>
868         </div>
869
870 </body>
871 </html>
872