From 0e6add9dbac6a76c20f7fdb07085212e2936e181 Mon Sep 17 00:00:00 2001 From: juanmont Date: Wed, 15 Nov 2017 18:10:52 +0100 Subject: [PATCH] F #5552: Added possibility work with all resources in onedb command (#575) --- src/onedb/onedb | 10 +++++----- src/onedb/onedb_live.rb | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/onedb/onedb b/src/onedb/onedb index 16ddf60db7..486270f9fb 100755 --- a/src/onedb/onedb +++ b/src/onedb/onedb @@ -518,7 +518,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do change_body_desc = <<-EOT.unindent Changes a value from the body of an object. The possible objects are: vm, host, vnet, image, cluster, document, group, marketplace, - marketplaceapp, secgroup, template, vrouter or zone + marketplaceapp, secgroup, template, vrouter, datastore, user, vmgroup, vdc or zone You can filter the objects to modify using one of these options: @@ -605,8 +605,8 @@ cmd=CommandParser::CmdParser.new(ARGV) do update_body_desc = <<-EOT.unindent Update body of an object. The possible objects are: vm, host, vnet, image, cluster, document, group, marketplace, - marketplaceapp, secgroup, template, vrouter or zone. Objects are - specified by their ID: + marketplaceapp, secgroup, template, vrouter, datastore, user, vmgroup, vdc or zone. + Objects are specified by their ID: * --id: object id, example: 156 For example to update the XML document of VM 23: @@ -638,8 +638,8 @@ cmd=CommandParser::CmdParser.new(ARGV) do show_body_desc = <<-EOT.unindent Show body of an object. The possible objects are: vm, host, vnet, image, cluster, document, group, marketplace, - marketplaceapp, secgroup, template, vrouter or zone. Objects are - specified by their ID: + marketplaceapp, secgroup, template, vrouter, datastore, user, vmgroup, vdc or zone. + Objects are specified by their ID: * --id: object id, example: 156 For example to show the XML document of VM 23: diff --git a/src/onedb/onedb_live.rb b/src/onedb/onedb_live.rb index bd1f97bc42..8da0bc0621 100644 --- a/src/onedb/onedb_live.rb +++ b/src/onedb/onedb_live.rb @@ -327,6 +327,26 @@ class OneDBLive object = OpenNebula::ZonePool.new(client) federate = true + when :datastore + table = 'datastore_pool' + object = OpenNebula::DatastorePool.new(client) + federate = false + + when :user + table = 'user_pool' + object = OpenNebula::UserPool.new(client) + federate = false + + when :vmgroup + table = 'vmgroup_pool' + object = OpenNebula::VMGroupPool.new(client) + federate = false + + when :vdc + table = 'vdc_pool' + object = OpenNebula::VdcPool.new(client) + federate = false + else raise "Object type '#{object}' not supported" end