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:
parent
fd5fc63dd0
commit
1a410d85e7
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user