mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
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:
1 parent
f3995775cc
commit
5f7fb402aa
26 files changed
+689
-104
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
@@ -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>]'
|
||||
|
||||
Reference in new issue
Block a user