mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
parent
0b02454b39
commit
cd35ad4eaa
@ -339,7 +339,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
rescue StandardError => e
|
||||
STDERR.puts e
|
||||
end
|
||||
helper.perform_actions(args[0], options, 'flush') do |host|
|
||||
helper.perform_actions(args[0], options, 'flushing') do |host|
|
||||
host.flush action
|
||||
end
|
||||
end
|
||||
|
@ -234,7 +234,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
command :clone, clone_desc, :imageid, :name,
|
||||
:options => [OneDatastoreHelper::DATASTORE] do
|
||||
helper.perform_action(args[0], options, 'cloned') do |image|
|
||||
helper.perform_action(args[0], options, 'cloning') do |image|
|
||||
ds_id = options[:datastore] || -1 # -1 clones to self
|
||||
res = image.clone(args[1], ds_id)
|
||||
|
||||
@ -252,7 +252,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
EOT
|
||||
|
||||
command :delete, delete_desc, [:range, :imageid_list] do
|
||||
helper.perform_actions(args[0], options, 'deleted') do |image|
|
||||
helper.perform_actions(args[0], options, 'deleting') do |image|
|
||||
image.delete
|
||||
end
|
||||
end
|
||||
@ -382,7 +382,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
EOT
|
||||
|
||||
command :'snapshot-delete', snapshot_delete_desc, :imageid, :snapshot_id do
|
||||
helper.perform_action(args[0], options, 'snapshot deleted') do |o|
|
||||
helper.perform_action(args[0], options, 'deleting snapshot') do |o|
|
||||
o.snapshot_delete(args[1].to_i)
|
||||
end
|
||||
end
|
||||
@ -392,7 +392,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
EOT
|
||||
|
||||
command :'snapshot-revert', snapshot_revert_desc, :imageid, :snapshot_id do
|
||||
helper.perform_action(args[0], options, 'image state reverted') do |o|
|
||||
helper.perform_action(args[0], options, 'reverting image state') do |o|
|
||||
o.snapshot_revert(args[1].to_i)
|
||||
end
|
||||
end
|
||||
@ -405,7 +405,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
snapshot_flatten_desc,
|
||||
:imageid,
|
||||
:snapshot_id do
|
||||
helper.perform_action(args[0], options, 'snapshot flattened') do |o|
|
||||
helper.perform_action(args[0], options, 'flattening snapshot') do |o|
|
||||
o.snapshot_flatten(args[1].to_i)
|
||||
end
|
||||
end
|
||||
|
@ -284,7 +284,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
EOT
|
||||
|
||||
command :export, export_desc, :appid, :name, :options => EXPORT_OPTIONS do
|
||||
helper.perform_action(args[0], options, 'exported') do |obj|
|
||||
helper.perform_action(args[0], options, 'exporting') do |obj|
|
||||
tag ="tag=#{options[:tag]}" if options[:tag]
|
||||
|
||||
obj.extend(MarketPlaceAppExt)
|
||||
@ -325,7 +325,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
command :download, download_desc, :appid, :path,
|
||||
:options => [OpenNebulaHelper::FORCE] do
|
||||
helper.perform_action(args[0], options, 'downloaded') do
|
||||
helper.perform_action(args[0], options, 'downloading') do
|
||||
download_args = [:marketplaceapp, args[0], args[1], options[:force]]
|
||||
OpenNebulaHelper.download_resource_sunstone(*download_args)
|
||||
end
|
||||
|
@ -517,7 +517,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
if !options[:schedule].nil?
|
||||
helper.schedule_actions(args[0], options, command_name)
|
||||
else
|
||||
helper.perform_actions(args[0], options, 'terminated') do |vm|
|
||||
helper.perform_actions(args[0], options, 'terminating') do |vm|
|
||||
vm.terminate(options[:hard] == true)
|
||||
end
|
||||
end
|
||||
@ -833,7 +833,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
template << ' ]'
|
||||
end
|
||||
|
||||
helper.perform_action(args[0], options, 'Attach disk') do |vm|
|
||||
helper.perform_action(args[0], options, 'Attaching disk') do |vm|
|
||||
vm.disk_attach(template)
|
||||
end
|
||||
end
|
||||
@ -847,7 +847,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
command :"disk-detach", disk_detach_desc, :vmid, :diskid do
|
||||
diskid = args[1].to_i
|
||||
|
||||
helper.perform_action(args[0], options, 'Detach disk') do |vm|
|
||||
helper.perform_action(args[0], options, 'Detaching disk') do |vm|
|
||||
vm.disk_detach(diskid)
|
||||
end
|
||||
end
|
||||
@ -910,7 +910,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
end
|
||||
end
|
||||
|
||||
helper.perform_action(args[0], options, 'Attach NIC') do |vm|
|
||||
helper.perform_action(args[0], options, 'Attaching NIC') do |vm|
|
||||
vm.nic_attach(template)
|
||||
end
|
||||
end
|
||||
@ -924,7 +924,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
command :"nic-detach", nic_detach_desc, :vmid, :nicid do
|
||||
nicid = args[1].to_i
|
||||
|
||||
helper.perform_action(args[0], options, 'Detach NIC') do |vm|
|
||||
helper.perform_action(args[0], options, 'Detaching NIC') do |vm|
|
||||
vm.nic_detach(nicid)
|
||||
end
|
||||
end
|
||||
@ -939,7 +939,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
nic_id = args[1].to_i
|
||||
sg_id = args[2].to_i
|
||||
|
||||
helper.perform_action(args[0], options, 'Attach SG') do |vm|
|
||||
helper.perform_action(args[0], options, 'Attaching SG') do |vm|
|
||||
vm.sg_attach(nic_id, sg_id)
|
||||
end
|
||||
end
|
||||
@ -954,7 +954,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
nic_id = args[1].to_i
|
||||
sg_id = args[2].to_i
|
||||
|
||||
helper.perform_action(args[0], options, 'Detach SG') do |vm|
|
||||
helper.perform_action(args[0], options, 'Detaching SG') do |vm|
|
||||
vm.sg_detach(nic_id, sg_id)
|
||||
end
|
||||
end
|
||||
@ -1047,7 +1047,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
helper.schedule_actions(args[0], options, @comm_name)
|
||||
else
|
||||
helper.perform_actions(args[0], options, 'snapshot created') do |o|
|
||||
helper.perform_actions(args[0], options, 'creating snapshot') do |o|
|
||||
o.snapshot_create(args[1])
|
||||
end
|
||||
end
|
||||
@ -1071,7 +1071,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
helper.schedule_actions([args[0]], options, @comm_name)
|
||||
else
|
||||
helper.perform_action(args[0], options, 'snapshot reverted') do |o|
|
||||
helper.perform_action(args[0], options, 'reverting snapshot') do |o|
|
||||
o.snapshot_revert(args[1].to_i)
|
||||
end
|
||||
end
|
||||
@ -1095,7 +1095,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
helper.schedule_actions([args[0]], options, @comm_name)
|
||||
else
|
||||
helper.perform_action(args[0], options, 'snapshot deleted') do |o|
|
||||
helper.perform_action(args[0], options, 'deleting snapshot') do |o|
|
||||
o.snapshot_delete(args[1])
|
||||
end
|
||||
end
|
||||
@ -1123,7 +1123,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
helper.schedule_actions([args[0]], options, @comm_name)
|
||||
else
|
||||
helper.perform_action(args[0], options,
|
||||
'disk snapshot created') do |o|
|
||||
'creating disk snapshot') do |o|
|
||||
o.disk_snapshot_create(args[1].to_i, args[2])
|
||||
end
|
||||
end
|
||||
@ -1150,7 +1150,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
helper.schedule_actions([args[0]], options, @comm_name)
|
||||
else
|
||||
helper.perform_action(args[0], options,
|
||||
'disk snapshot reverted') do |o|
|
||||
'reverting disk snapshot') do |o|
|
||||
o.disk_snapshot_revert(args[1].to_i, args[2].to_i)
|
||||
end
|
||||
end
|
||||
@ -1177,7 +1177,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
helper.schedule_actions([args[0]], options, @comm_name)
|
||||
else
|
||||
helper.perform_action(args[0], options,
|
||||
'disk snapshot deleted') do |o|
|
||||
'deleting disk snapshot') do |o|
|
||||
o.disk_snapshot_delete(args[1].to_i, args[2].to_i)
|
||||
end
|
||||
end
|
||||
@ -1213,7 +1213,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
command :"disk-resize", disk_resize_desc,
|
||||
:vmid, :diskid, :size do
|
||||
helper.perform_action(args[0], options, 'disk resized') do |o|
|
||||
helper.perform_action(args[0], options, 'resizing disk') do |o|
|
||||
o.info
|
||||
size = o["/VM/TEMPLATE/DISK[DISK_ID='#{args[1]}']/SIZE"].to_i
|
||||
|
||||
|
@ -176,7 +176,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
EOT
|
||||
|
||||
command :delete, delete_desc, [:range, :vnetid_list] do
|
||||
helper.perform_actions(args[0], options, 'deleted') do |vn|
|
||||
helper.perform_actions(args[0], options, 'deleting') do |vn|
|
||||
vn.delete
|
||||
end
|
||||
end
|
||||
@ -187,7 +187,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
command :addar, addar_desc, :vnetid, [:file, nil],
|
||||
:options => STD_OPTIONS + OneVNetHelper::ADDAR_OPTIONS do
|
||||
helper.perform_action(args[0], options, 'lease added') do |vn|
|
||||
helper.perform_action(args[0], options, 'address range added') do |vn|
|
||||
if args[1]
|
||||
ar = File.read(args[1])
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user