X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FDDL%2FBase.html;fp=doc%2Fclasses%2FMCollective%2FDDL%2FBase.html;h=7625233ad3718af446509bef1f6eb289fc3b8b2f;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=0ffb57dfd9739c80e89561ec8d78f3a69ad5afc2;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/DDL/Base.html b/doc/MCollective/DDL/Base.html similarity index 53% rename from doc/classes/MCollective/DDL/Base.html rename to doc/MCollective/DDL/Base.html index 0ffb57d..7625233 100644 --- a/doc/classes/MCollective/DDL/Base.html +++ b/doc/MCollective/DDL/Base.html @@ -1,85 +1,364 @@ - - - + + - Class: MCollective::DDL::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::Base
In: - - lib/mcollective/ddl/base.rb - -
-
Parent: - Object -
-
- - -
+ + Class: MCollective::DDL::Base + -
+ + + + -
-

+ + + +

+
+
+

In Files

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

Parent

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

Included Modules

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

Class Index + [+]

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

MCollective::DDL::Base

+ +
+

The base class for all kinds of DDL files. DDL files when run gets parsed and builds up a hash of the basic primitive types, ideally restricted so it can be converted to @@ -88,119 +367,147 @@ laster on.

The Hash being built should be stored in @entities, the format is generally -not prescribed but there‘s a definite feel to how DDL files look so study the agent and discovery ones to see how the structure applies to very different use cases.

For every plugin type you should have a single word name - that corresponds to the directory in the libdir where these plugins live. If you need -anything above and beyond ‘metadata’ in your plugin DDL then add a PlugintypeDDL class here and add your specific behaviors to those.

-
- - -
- -
-

Methods

- -
- findddlfile   - help   - input   - loadddlfile   - metadata   - new   - output   - requires   - template_for_plugintype   - usage   - validate_input_argument   - validate_requirements   -
-
- -
- - - -
-

Included Modules

- - -
- -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
entities [R] 
meta [R] 
pluginname [R] 
plugintype [R] 
requirements [R] 
usage [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+
+ + + + + + +
+

Attributes

+ + +
+ + +
+ meta[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ entities[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ pluginname[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ plugintype[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ usage[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ requirements[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(plugin, plugintype=:agent, loadddl=true) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 24
 24:       def initialize(plugin, plugintype=:agent, loadddl=true)
@@ -213,27 +520,40 @@ specific behaviors to those.
 31:         @requirements = {}
 32: 
 33:         loadddlfile if loadddl
-34:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
+34: end +
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + findddlfile(ddlname=nil, ddltype=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 89
  89:       def findddlfile(ddlname=nil, ddltype=nil)
@@ -248,26 +568,31 @@ specific behaviors to those.
  98:           end
  99:         end
 100:         return false
-101:       end
-
-
-
-
- -
- - - - -
-

-Generates help using the template based on -the data created with metadata and input. +101: end +

+ +
+ + +
+ + +
+ + +
+ + help(template=nil) + click to toggle source + +
+ +
+ +

+Generates help using the template based on the data created with metadata +and input.

If no template name is provided one will be chosen based on the plugin @@ -275,9 +600,11 @@ type. If the provided template path is not absolute then the template will be loaded either from the config dir and if that does not exist, default to /etc/mcollective

-

[Source]

-
+ + + +
     # File lib/mcollective/ddl/base.rb, line 44
 44:       def help(template=nil)
@@ -297,32 +624,39 @@ be loaded either from the config dir and if that does not exist, default to
 58: 
 59:         erb = ERB.new(template, 0, '%')
 60:         erb.result(binding)
-61:       end
-
-
-
-
- -
- - - - -
-

-Registers an input argument for a given -action +61: end +

+ +
+ + +
+ + +
+ + +
+ + input(argument, properties) + click to toggle source + +
+ +
+ +

+Registers an input argument for a given action

See the documentation for action for how to use this

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 153
 153:       def input(argument, properties)
@@ -353,25 +687,34 @@ See the documentation for action for how to use this
 178: 
 179:             @entities[entity][:input][argument][:list] = properties[:list]
 180:         end
-181:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+181: end +
+ +
+ + +
+ + +
+ + +
+ + loadddlfile() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 81
 81:       def loadddlfile
@@ -380,28 +723,36 @@ See the documentation for action for how to use this
 84:         else
 85:           raise_code(:PLMC40, "Can't find DDL for %{type} plugin '%{name}'", :debug, :type => @plugintype, :name => @pluginname)
 86:         end
-87:       end
-
-
-
-
- -
- - - - -
-

+87: end +

+ +
+ + +
+ + +
+ + +
+ + metadata(meta) + click to toggle source + +
+ +
+ +

Registers meta data for the introspection hash

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 215
 215:       def metadata(meta)
@@ -410,32 +761,39 @@ Registers meta data for the introspection hash
 218:         end
 219: 
 220:         @meta = meta
-221:       end
-
-
-
-
- -
- - - - -
-

-Registers an output argument for a given -action +221: end +

+ +
+ + +
+ + +
+ + +
+ + output(argument, properties) + click to toggle source + +
+ +
+ +

+Registers an output argument for a given action

See the documentation for action for how to use this

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 186
 186:       def output(argument, properties)
@@ -448,25 +806,34 @@ See the documentation for action for how to use this
 193:         @entities[action][:output][argument] = {:description => properties[:description],
 194:                                                 :display_as  => properties[:display_as],
 195:                                                 :default     => properties[:default]}
-196:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+196: end +
+ +
+ + +
+ + +
+ + +
+ + requires(requirement) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 198
 198:       def requires(requirement)
@@ -483,25 +850,34 @@ See the documentation for action for how to use this
 209:         end
 210: 
 211:         validate_requirements
-212:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+212: end +
+ +
+ + +
+ + +
+ + +
+ + template_for_plugintype() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 67
 67:       def template_for_plugintype
@@ -516,47 +892,62 @@ See the documentation for action for how to use this
 76:             return "metadata-help.erb"
 77:           end
 78:         end
-79:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+79: end +
+ +
+ + +
+ + +
+ + +
+ + usage(usage_text) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 63
 63:       def usage(usage_text)
 64:         @usage = usage_text
-65:       end
-
-
-
-
- -
- - - - -
-

-validate strings, lists and booleans, we‘ll add more types of +65: end +

+ +
+ + +
+ + +
+ + +
+ + validate_input_argument(input, key, argument) + click to toggle source + +
+ +
+ +

+validate strings, lists and booleans, we’ll add more types of validators when all the use cases are clear

@@ -568,9 +959,11 @@ safe assumption, just to skip them. :string can have maxlength and regex. A maxlength of 0 will bypasss checks :list has a array of valid values

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 127
 127:       def validate_input_argument(input, key, argument)
@@ -594,25 +987,34 @@ safe assumption, just to skip them.
 145:         return true
 146:       rescue => e
 147:         DDL.validation_fail!(:PLMC21, "Cannot validate input '%{input}': %{error}", :debug, :input => key, :error => e.to_s)
-148:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+148: end +
+ +
+ + +
+ + +
+ + +
+ + validate_requirements() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 103
 103:       def validate_requirements
@@ -628,22 +1030,33 @@ safe assumption, just to skip them.
 113:         end
 114: 
 115:         true
-116:       end
-
-
-
-
+116: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
-
-

[Validate]

-
+
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + +