Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / Data.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
8         <title>Module: MCollective::Data</title>
9
10         <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
12         <script src="../js/jquery.js" type="text/javascript"
13                 charset="utf-8"></script>
14         <script src="../js/thickbox-compressed.js" type="text/javascript"
15                 charset="utf-8"></script>
16         <script src="../js/quicksearch.js" type="text/javascript"
17                 charset="utf-8"></script>
18         <script src="../js/darkfish.js" type="text/javascript"
19                 charset="utf-8"></script>
20
21 </head>
22 <body class="module">
23
24         <div id="metadata">
25                 <div id="file-metadata">
26                         <div id="file-list-section" class="section">
27                                 <h3 class="section-header">In Files</h3>
28                                 <div class="section-body">
29                                         <ul>
30                                         
31                                                 <li><a href="../lib/mcollective/data/base_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/data/base.rb">lib/mcollective/data/base.rb</a></li>
33                                         
34                                                 <li><a href="../lib/mcollective/data/result_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
35                                                         class="thickbox" title="lib/mcollective/data/result.rb">lib/mcollective/data/result.rb</a></li>
36                                         
37                                                 <li><a href="../lib/mcollective/data_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38                                                         class="thickbox" title="lib/mcollective/data.rb">lib/mcollective/data.rb</a></li>
39                                         
40                                         </ul>
41                                 </div>
42                         </div>
43
44                         
45                 </div>
46
47                 <div id="class-metadata">
48
49                         <!-- Parent Class -->
50                         
51
52                         <!-- Namespace Contents -->
53                         
54                         <div id="namespace-list-section" class="section">
55                                 <h3 class="section-header">Namespace</h3>
56                                 <ul class="link-list">
57                                         
58                                         <li><span class="type">CLASS</span> <a href="Data/Base.html">MCollective::Data::Base</a></li>
59                                         
60                                         <li><span class="type">CLASS</span> <a href="Data/Result.html">MCollective::Data::Result</a></li>
61                                         
62                                 </ul>
63                         </div>
64                         
65
66                         <!-- Method Quickref -->
67                         
68                         <div id="method-list-section" class="section">
69                                 <h3 class="section-header">Methods</h3>
70                                 <ul class="link-list">
71                                         
72                                         <li><a href="#M000488">::[]</a></li>
73                                         
74                                         <li><a href="#M000490">::ddl</a></li>
75                                         
76                                         <li><a href="#M000492">::ddl_has_output?</a></li>
77                                         
78                                         <li><a href="#M000493">::ddl_transform_input</a></li>
79                                         
80                                         <li><a href="#M000491">::ddl_validate</a></li>
81                                         
82                                         <li><a href="#M000486">::load_data_sources</a></li>
83                                         
84                                         <li><a href="#M000489">::method_missing</a></li>
85                                         
86                                         <li><a href="#M000487">::pluginname</a></li>
87                                         
88                                 </ul>
89                         </div>
90                         
91
92                         <!-- Included Modules -->
93                         
94                 </div>
95
96                 <div id="project-metadata">
97                         
98                         
99                         <div id="fileindex-section" class="section project-section">
100                                 <h3 class="section-header">Files</h3>
101                                 <ul>
102                                 
103                                         <li class="file"><a href="../COPYING.html">COPYING</a></li>
104                                 
105                                         <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
106                                 
107                                         <li class="file"><a href="../README.html">README</a></li>
108                                 
109                                         <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
110                                 
111                                         <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
112                                 
113                                         <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
114                                 
115                                         <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
116                                 
117                                         <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
118                                 
119                                         <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
120                                 
121                                         <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
122                                 
123                                         <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
124                                 
125                                         <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
126                                 
127                                         <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
128                                 
129                                         <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
130                                 
131                                         <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
132                                 
133                                         <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
134                                 
135                                         <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
136                                 
137                                         <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
138                                 
139                                         <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
140                                 
141                                         <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
142                                 
143                                 </ul>
144                         </div>
145                         
146
147                         <div id="classindex-section" class="section project-section">
148                                 <h3 class="section-header">Class Index
149                                         <span class="search-toggle"><img src="../images/find.png"
150                                                 height="16" width="16" alt="[+]"
151                                                 title="show/hide quicksearch" /></span></h3>
152                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
153                                 <fieldset>
154                                         <legend>Quicksearch</legend>
155                                         <input type="text" name="quicksearch" value=""
156                                                 class="quicksearch-field" />
157                                 </fieldset>
158                                 </form>
159
160                                 <ul class="link-list">
161                                 
162                                         <li><a href="../MCollective.html">MCollective</a></li>
163                                 
164                                         <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
165                                 
166                                         <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
167                                 
168                                         <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
169                                 
170                                         <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
171                                 
172                                         <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
173                                 
174                                         <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
175                                 
176                                         <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
177                                 
178                                         <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
179                                 
180                                         <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
181                                 
182                                         <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
183                                 
184                                         <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
185                                 
186                                         <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
187                                 
188                                         <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
189                                 
190                                         <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
191                                 
192                                         <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
193                                 
194                                         <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
195                                 
196                                         <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
197                                 
198                                         <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
199                                 
200                                         <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
201                                 
202                                         <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
203                                 
204                                         <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
205                                 
206                                         <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
207                                 
208                                         <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
209                                 
210                                         <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
211                                 
212                                         <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
213                                 
214                                         <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
215                                 
216                                         <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
217                                 
218                                         <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
219                                 
220                                         <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
221                                 
222                                         <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
223                                 
224                                         <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
225                                 
226                                         <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
227                                 
228                                         <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
229                                 
230                                         <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
231                                 
232                                         <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
233                                 
234                                         <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
235                                 
236                                         <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
237                                 
238                                         <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
239                                 
240                                         <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
241                                 
242                                         <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
243                                 
244                                         <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
245                                 
246                                         <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
247                                 
248                                         <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
249                                 
250                                         <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
251                                 
252                                         <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
253                                 
254                                         <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
255                                 
256                                         <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
257                                 
258                                         <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
259                                 
260                                         <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
261                                 
262                                         <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
263                                 
264                                         <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
265                                 
266                                         <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
267                                 
268                                         <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
269                                 
270                                         <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
271                                 
272                                         <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
273                                 
274                                         <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
275                                 
276                                         <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
277                                 
278                                         <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
279                                 
280                                         <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
281                                 
282                                         <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
283                                 
284                                         <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
285                                 
286                                         <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
287                                 
288                                         <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
289                                 
290                                         <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
291                                 
292                                         <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
293                                 
294                                         <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
295                                 
296                                         <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
297                                 
298                                         <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
299                                 
300                                         <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
301                                 
302                                         <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
303                                 
304                                         <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
305                                 
306                                         <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
307                                 
308                                         <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
309                                 
310                                         <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
311                                 
312                                         <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
313                                 
314                                         <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
315                                 
316                                         <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
317                                 
318                                         <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
319                                 
320                                         <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
321                                 
322                                         <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
323                                 
324                                         <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
325                                 
326                                         <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
327                                 
328                                         <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
329                                 
330                                         <li><a href="../Array.html">Array</a></li>
331                                 
332                                         <li><a href="../Dir.html">Dir</a></li>
333                                 
334                                         <li><a href="../Object.html">Object</a></li>
335                                 
336                                         <li><a href="../String.html">String</a></li>
337                                 
338                                         <li><a href="../Symbol.html">Symbol</a></li>
339                                 
340                                 </ul>
341                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
342                         </div>
343
344                         
345                 </div>
346         </div>
347
348         <div id="documentation">
349                 <h1 class="module">MCollective::Data</h1>
350
351                 <div id="description">
352                         
353                 </div>
354
355                 <!-- Constants -->
356                 
357
358                 <!-- Attributes -->
359                 
360
361                 <!-- Methods -->
362                 
363                 <div id="public-class-method-details" class="method-section section">
364                         <h3 class="section-header">Public Class Methods</h3>
365
366                 
367                         <div id="--method" class="method-detail ">
368                                 <a name="M000488"></a>
369
370                                 <div class="method-heading">
371                                 
372                                         <span class="method-name">[]</span><span
373                                                 class="method-args">(plugin)</span>
374                                         <span class="method-click-advice">click to toggle source</span>
375                                 
376                                 </div>
377
378                                 <div class="method-description">
379                                         
380                                         <p class="missing-docs">(Not documented)</p>
381                                         
382
383                                         
384                                         <div class="method-source-code"
385                                                 id="--source">
386 <pre>
387     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 26</span>
388 26:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">plugin</span>)
389 27:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>)]
390 28:     <span class="ruby-keyword kw">end</span></pre>
391                                         </div>
392                                         
393                                 </div>
394
395                                 
396                         </div>
397
398                 
399                         <div id="ddl-method" class="method-detail ">
400                                 <a name="M000490"></a>
401
402                                 <div class="method-heading">
403                                 
404                                         <span class="method-name">ddl</span><span
405                                                 class="method-args">(plugin)</span>
406                                         <span class="method-click-advice">click to toggle source</span>
407                                 
408                                 </div>
409
410                                 <div class="method-description">
411                                         
412                                         <p class="missing-docs">(Not documented)</p>
413                                         
414
415                                         
416                                         <div class="method-source-code"
417                                                 id="ddl-source">
418 <pre>
419     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 37</span>
420 37:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl</span>(<span class="ruby-identifier">plugin</span>)
421 38:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>), <span class="ruby-identifier">:data</span>)
422 39:     <span class="ruby-keyword kw">end</span></pre>
423                                         </div>
424                                         
425                                 </div>
426
427                                 
428                         </div>
429
430                 
431                         <div id="ddl-has-output--method" class="method-detail ">
432                                 <a name="M000492"></a>
433
434                                 <div class="method-heading">
435                                 
436                                         <span class="method-name">ddl_has_output?</span><span
437                                                 class="method-args">(ddl, output)</span>
438                                         <span class="method-click-advice">click to toggle source</span>
439                                 
440                                 </div>
441
442                                 <div class="method-description">
443                                         
444                                         <p class="missing-docs">(Not documented)</p>
445                                         
446
447                                         
448                                         <div class="method-source-code"
449                                                 id="ddl-has-output--source">
450 <pre>
451     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 62</span>
452 62:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_has_output?</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">output</span>)
453 63:       <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">:output</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">output</span>.<span class="ruby-identifier">to_sym</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">false</span>
454 64:     <span class="ruby-keyword kw">end</span></pre>
455                                         </div>
456                                         
457                                 </div>
458
459                                 
460                         </div>
461
462                 
463                         <div id="ddl-transform-input-method" class="method-detail ">
464                                 <a name="M000493"></a>
465
466                                 <div class="method-heading">
467                                 
468                                         <span class="method-name">ddl_transform_input</span><span
469                                                 class="method-args">(ddl, input)</span>
470                                         <span class="method-click-advice">click to toggle source</span>
471                                 
472                                 </div>
473
474                                 <div class="method-description">
475                                         
476                                         <p>
477 For an input where the <a href="DDL.html">DDL</a> requests a boolean or
478 some number this will convert the input to the right type where possible
479 else just returns the origin input unedited
480 </p>
481 <p>
482 if anything here goes wrong just return the input value this is not really
483 the end of the world or anything since all that will happen is that <a
484 href="DDL.html">DDL</a> validation will fail and the user will get an
485 error, no need to be too defensive here
486 </p>
487                                         
488
489                                         
490                                         <div class="method-source-code"
491                                                 id="ddl-transform-input-source">
492 <pre>
493     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 74</span>
494 74:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_transform_input</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">input</span>)
495 75:       <span class="ruby-keyword kw">begin</span>
496 76:         <span class="ruby-identifier">type</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">:query</span>][<span class="ruby-identifier">:type</span>]
497 77: 
498 78:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
499 79:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:boolean</span>
500 80:             <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">string_to_boolean</span>(<span class="ruby-identifier">input</span>)
501 81: 
502 82:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:number</span>, <span class="ruby-identifier">:integer</span>, <span class="ruby-identifier">:float</span>
503 83:             <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">string_to_number</span>(<span class="ruby-identifier">input</span>)
504 84:         <span class="ruby-keyword kw">end</span>
505 85:       <span class="ruby-keyword kw">rescue</span>
506 86:       <span class="ruby-keyword kw">end</span>
507 87: 
508 88:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">input</span>
509 89:     <span class="ruby-keyword kw">end</span></pre>
510                                         </div>
511                                         
512                                 </div>
513
514                                 
515                         </div>
516
517                 
518                         <div id="ddl-validate-method" class="method-detail ">
519                                 <a name="M000491"></a>
520
521                                 <div class="method-heading">
522                                 
523                                         <span class="method-name">ddl_validate</span><span
524                                                 class="method-args">(ddl, argument)</span>
525                                         <span class="method-click-advice">click to toggle source</span>
526                                 
527                                 </div>
528
529                                 <div class="method-description">
530                                         
531                                         <p class="missing-docs">(Not documented)</p>
532                                         
533
534                                         
535                                         <div class="method-source-code"
536                                                 id="ddl-validate-source">
537 <pre>
538     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 41</span>
539 41:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">argument</span>)
540 42:       <span class="ruby-identifier">name</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:name</span>]
541 43:       <span class="ruby-identifier">query</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>]
542 44: 
543 45:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC31</span>, <span class="ruby-value str">&quot;No dataquery has been defined in the DDL for data plugin '%{plugin}'&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>)  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">query</span>
544 46: 
545 47:       <span class="ruby-identifier">input</span> = <span class="ruby-identifier">query</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:input</span>, {})
546 48:       <span class="ruby-identifier">output</span> = <span class="ruby-identifier">query</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:output</span>, {})
547 49: 
548 50:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC32</span>, <span class="ruby-value str">&quot;No output has been defined in the DDL for data plugin %{plugin}&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">empty?</span>
549 51: 
550 52:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:query</span>]
551 53:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argument</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:query</span>][<span class="ruby-identifier">:optional</span>]
552 54: 
553 55:         <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">validate_input_argument</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">:query</span>, <span class="ruby-identifier">argument</span>)
554 56:       <span class="ruby-keyword kw">else</span>
555 57:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC33</span>, <span class="ruby-value str">&quot;No data plugin argument was declared in the '%{plugin}' DDL but an input was supplied&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argument</span>
556 58:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
557 59:       <span class="ruby-keyword kw">end</span>
558 60:     <span class="ruby-keyword kw">end</span></pre>
559                                         </div>
560                                         
561                                 </div>
562
563                                 
564                         </div>
565
566                 
567                         <div id="load-data-sources-method" class="method-detail ">
568                                 <a name="M000486"></a>
569
570                                 <div class="method-heading">
571                                 
572                                         <span class="method-name">load_data_sources</span><span
573                                                 class="method-args">()</span>
574                                         <span class="method-click-advice">click to toggle source</span>
575                                 
576                                 </div>
577
578                                 <div class="method-description">
579                                         
580                                         <p class="missing-docs">(Not documented)</p>
581                                         
582
583                                         
584                                         <div class="method-source-code"
585                                                 id="load-data-sources-source">
586 <pre>
587     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 6</span>
588  6:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_data_sources</span>
589  7:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find_and_load</span>(<span class="ruby-value str">&quot;data&quot;</span>)
590  8: 
591  9:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/_data$/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin</span><span class="ruby-operator">|</span>
592 10:         <span class="ruby-keyword kw">begin</span>
593 11:           <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">plugin</span>].<span class="ruby-identifier">class</span>.<span class="ruby-identifier">activate?</span>
594 12:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Disabling data plugin %s due to plugin activation policy&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>)
595 13:             <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>)
596 14:           <span class="ruby-keyword kw">end</span>
597 15:         <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>
598 16:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Disabling data plugin %s due to exception #{e.class}: #{e}&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>)
599 17:           <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>)
600 18:         <span class="ruby-keyword kw">end</span>
601 19:       <span class="ruby-keyword kw">end</span>
602 20:     <span class="ruby-keyword kw">end</span></pre>
603                                         </div>
604                                         
605                                 </div>
606
607                                 
608                         </div>
609
610                 
611                         <div id="method-missing-method" class="method-detail ">
612                                 <a name="M000489"></a>
613
614                                 <div class="method-heading">
615                                 
616                                         <span class="method-name">method_missing</span><span
617                                                 class="method-args">(method, *args)</span>
618                                         <span class="method-click-advice">click to toggle source</span>
619                                 
620                                 </div>
621
622                                 <div class="method-description">
623                                         
624                                         <p>
625 Data.package(&#8220;httpd&#8221;).architecture
626 </p>
627                                         
628
629                                         
630                                         <div class="method-source-code"
631                                                 id="method-missing-source">
632 <pre>
633     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 31</span>
634 31:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
635 32:       <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">method</span>))
636 33: 
637 34:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">method</span>)].<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>)
638 35:     <span class="ruby-keyword kw">end</span></pre>
639                                         </div>
640                                         
641                                 </div>
642
643                                 
644                         </div>
645
646                 
647                         <div id="pluginname-method" class="method-detail ">
648                                 <a name="M000487"></a>
649
650                                 <div class="method-heading">
651                                 
652                                         <span class="method-name">pluginname</span><span
653                                                 class="method-args">(plugin)</span>
654                                         <span class="method-click-advice">click to toggle source</span>
655                                 
656                                 </div>
657
658                                 <div class="method-description">
659                                         
660                                         <p class="missing-docs">(Not documented)</p>
661                                         
662
663                                         
664                                         <div class="method-source-code"
665                                                 id="pluginname-source">
666 <pre>
667     <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 22</span>
668 22:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>)
669 23:       <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/_data$/i</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;%s_data&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
670 24:     <span class="ruby-keyword kw">end</span></pre>
671                                         </div>
672                                         
673                                 </div>
674
675                                 
676                         </div>
677
678                 
679                 </div>
680         
681
682         </div>
683
684
685         <div id="rdoc-debugging-section-dump" class="debugging-section">
686         
687                 <p>Disabled; run with --debug to generate this.</p>
688         
689         </div>
690
691         <div id="validator-badges">
692                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
693                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
694                         Rdoc Generator</a> 1.1.6</small>.</p>
695         </div>
696
697 </body>
698 </html>
699