F #2671: Add oned search functionality. Add an index column to perform FTS searches server-side. New parameter has been added to the one.vmpool.info call, and --search option to CLI onevm list. This commits adds support for JAVA and migrator.

Co-authored-by: Christian González <cgonzalez@opennebula.systems>
This commit is contained in:
Ruben S. MonteroandChristian González committed 2019-01-30 00:10:18 +01:00
1 parent f3995775cc
commit 5f7fb402aa
26 files changed
+689 -104

No files matched your search

+7
View File
@@ -198,6 +198,13 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
:format => String
}
SEARCH = {
:name => "search",
:large => "--search search",
:description=> "query in KEY=VALUE format",
:format => String
}
def self.rname
"VM"
end
+22 -2
View File
@@ -1047,8 +1047,28 @@ CommandParser::CmdParser.new(ARGV) do
command :list, list_desc, [:filterflag, nil],
:options => CLIHelper::OPTIONS + OpenNebulaHelper::OPTIONS +
[OpenNebulaHelper::DESCRIBE] do
helper.list_pool(options, false, args[0])
[OpenNebulaHelper::DESCRIBE] + [OneVMHelper::SEARCH] do
if !options[:search]
helper.list_pool(options, false, args[0])
else
table = helper.format_pool(options)
pool = OpenNebula::VirtualMachinePool.new(OneVMHelper.get_client)
rc = pool.info_search(:query => options[:search])
if rc != nil
puts rc.message
exit -1
end
if options[:xml]
puts pool.to_xml
else
table.show(pool.to_hash, options)
end
return 0
end
end
show_desc = <<-EOT.unindent
-1
View File
@@ -30,7 +30,6 @@ $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
require 'command_parser'
require 'one_helper/onevntemplate_helper'
require 'one_helper/onevnet_helper'
require 'pry'
CommandParser::CmdParser.new(ARGV) do
usage '`onevntemplate` <command> [<args>] [<options>]'