1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

bug #847: New methods for OCA and onevnet option

This commit is contained in:
Ruben S. Montero 2011-10-10 23:27:51 +02:00
parent fd5fc63dd0
commit 1a410d85e7
2 changed files with 20 additions and 1 deletions

View File

@ -171,4 +171,15 @@ cmd=CommandParser::CmdParser.new(ARGV) do
:options=>OpenNebulaHelper::XML do
helper.show_resource(args[0],options)
end
update_desc = <<-EOT.unindent
Launches the system editor to modify and update the template contents
EOT
command :update, update_desc, :vnetid do
helper.perform_action(args[0],options,"modified") do |vnet|
str = OpenNebulaHelper.update_template(args[0], vnet)
vnet.update(str)
end
end
end

View File

@ -31,7 +31,8 @@ module OpenNebula
:delete => "vn.delete",
:addleases => "vn.addleases",
:rmleases => "vn.rmleases",
:chown => "vn.chown"
:chown => "vn.chown",
:update => "vn.update"
}
VN_TYPES=%w{RANGED FIXED}
@ -81,6 +82,13 @@ module OpenNebula
super(VN_METHODS[:allocate],description)
end
# Replaces the template contents
#
# +new_template+ New template contents
def update(new_template)
super(VN_METHODS[:update], new_template)
end
# Publishes the VirtualNetwork, to be used by other users
def publish
set_publish(true)