Class: Vcloud::QueryRunner
- Inherits:
-
Object
- Object
- Vcloud::QueryRunner
- Defined in:
- lib/vcloud/core/query_runner.rb
Instance Method Summary collapse
- #available_query_types ⇒ Object
-
#initialize ⇒ QueryRunner
constructor
A new instance of QueryRunner.
- #run(type = nil, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ QueryRunner
Returns a new instance of QueryRunner.
4 5 6 |
# File 'lib/vcloud/core/query_runner.rb', line 4 def initialize @fsi = Vcloud::Fog::ServiceInterface.new end |
Instance Method Details
#available_query_types ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vcloud/core/query_runner.rb', line 12 def available_query_types query_list = @fsi.get_execute_query() query_list[:Link].select do |link| link[:rel] == 'down' end.map do |link| href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) [query['type'].first, query['format'].first] end end |
#run(type = nil, options = {}) ⇒ Object
8 9 10 |
# File 'lib/vcloud/core/query_runner.rb', line 8 def run(type=nil, ={}) get_all_results(type, ) end |