X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fmcollective%2Fddl%2Fdataddl.rb;fp=lib%2Fmcollective%2Fddl%2Fdataddl.rb;h=1f7cdcda4ac8f1ff3cdfb0ac71b627634dae9dfc;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/ddl/dataddl.rb b/lib/mcollective/ddl/dataddl.rb new file mode 100644 index 0000000..1f7cdcd --- /dev/null +++ b/lib/mcollective/ddl/dataddl.rb @@ -0,0 +1,56 @@ +module MCollective + module DDL + # A DDL file for the data query plugins. + # + # Query plugins can today take only one input by convention in the DDL that + # is called :query, otherwise the input is identical to the standard input. + # + # metadata :name => "Agent", + # :description => "Meta data about installed MColletive Agents", + # :author => "R.I.Pienaar ", + # :license => "ASL 2.0", + # :version => "1.0", + # :url => "http://marionette-collective.org/", + # :timeout => 1 + # + # dataquery :description => "Agent Meta Data" do + # input :query, + # :prompt => "Agent Name", + # :description => "Valid agent name", + # :type => :string, + # :validation => /^[\w\_]+$/, + # :maxlength => 20 + # + # [:license, :timeout, :description, :url, :version, :author].each do |item| + # output item, + # :description => "Agent #{item}", + # :display_as => item.to_s.capitalize + # end + # end + class DataDDL input[:description], + :input => {}, + :output => {}} + + @current_entity = :data + block.call if block_given? + @current_entity = nil + end + + def input(argument, properties) + raise "The only valid input name for a data query is 'query'" if argument != :query + + super + end + + # Returns the interface for the data query + def dataquery_interface + @entities[:data] || {} + end + end + end +end