From 1788425c94663bb55140dc03132b69a7f1acf2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Nov 2011 18:27:04 +0100 Subject: [PATCH] Feature #863: Add new vn_mad to ruby oca and onehost command --- src/cli/one_helper/onehost_helper.rb | 1 + src/cli/onehost | 5 +++-- src/oca/ruby/OpenNebula/Host.rb | 16 ++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cli/one_helper/onehost_helper.rb b/src/cli/one_helper/onehost_helper.rb index 2a23aab046..d517978664 100644 --- a/src/cli/one_helper/onehost_helper.rb +++ b/src/cli/one_helper/onehost_helper.rb @@ -59,6 +59,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper puts str % ["STATE", host.state_str] puts str % ["IM_MAD", host['IM_MAD']] puts str % ["VM_MAD", host['VM_MAD']] + puts str % ["VN_MAD", host['VN_MAD']] puts str % ["TM_MAD", host['TM_MAD']] puts diff --git a/src/cli/onehost b/src/cli/onehost index 6f7b5f5c81..adf060ba36 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -60,9 +60,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do Creates a new Host EOT - command :create, create_desc, :hostname, :im_mad, :vmm_mad, :tm_mad do + command :create, create_desc, :hostname, :im_mad, :vmm_mad, :vnm_mad, + :tm_mad do helper.create_resource(options) do |host| - host.allocate(args[0], args[1], args[2], args[3]) + host.allocate(args[0], args[1], args[2], args[3], args[4]) end end diff --git a/src/oca/ruby/OpenNebula/Host.rb b/src/oca/ruby/OpenNebula/Host.rb index 24f205663c..7a66b9ee86 100644 --- a/src/oca/ruby/OpenNebula/Host.rb +++ b/src/oca/ruby/OpenNebula/Host.rb @@ -78,15 +78,15 @@ module OpenNebula # Allocates a new Host in OpenNebula # - # +hostname+ A string containing the name of the new Host. + # @param hostname [String] Name of the new Host. + # @param im [String] Name of the im_driver + # @param vmm [String] Name of the vmm_driver + # @param tm [String] Name of the tm_driver # - # +im+ A string containing the name of the im_driver - # - # +vmm+ A string containing the name of the vmm_driver - # - # +tm+ A string containing the name of the tm_driver - def allocate(hostname,im,vmm,tm) - super(HOST_METHODS[:allocate],hostname,im,vmm,tm) + # @return [Integer, OpenNebula::Error] the new VM ID in case of + # success, error otherwise + def allocate(hostname,im,vmm,vnm,tm) + super(HOST_METHODS[:allocate],hostname,im,vmm,vnm,tm) end # Deletes the Host