opennebula-cli 6.4.6 → 6.5.80.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +2 -2
  3. data/bin/oneacl +1 -1
  4. data/bin/onecluster +1 -1
  5. data/bin/onedatastore +1 -1
  6. data/bin/oneflow +2 -3
  7. data/bin/oneflow-template +2 -2
  8. data/bin/onegroup +1 -1
  9. data/bin/onehook +1 -1
  10. data/bin/onehost +1 -1
  11. data/bin/oneimage +52 -3
  12. data/bin/oneirb +1 -1
  13. data/bin/onelog +1 -1
  14. data/bin/onemarket +1 -1
  15. data/bin/onemarketapp +1 -1
  16. data/bin/onesecgroup +1 -1
  17. data/bin/oneshowback +2 -2
  18. data/bin/onetemplate +1 -1
  19. data/bin/oneuser +4 -4
  20. data/bin/onevcenter +2 -2
  21. data/bin/onevdc +1 -1
  22. data/bin/onevm +146 -161
  23. data/bin/onevmgroup +1 -1
  24. data/bin/onevnet +16 -4
  25. data/bin/onevntemplate +1 -1
  26. data/bin/onevrouter +1 -1
  27. data/bin/onezone +6 -2
  28. data/lib/cli_helper.rb +20 -20
  29. data/lib/command_parser.rb +1 -1
  30. data/lib/one_helper/oneacct_helper.rb +1 -1
  31. data/lib/one_helper/oneacl_helper.rb +1 -1
  32. data/lib/one_helper/onecluster_helper.rb +1 -1
  33. data/lib/one_helper/onedatastore_helper.rb +1 -1
  34. data/lib/one_helper/oneflow_helper.rb +2 -2
  35. data/lib/one_helper/oneflowtemplate_helper.rb +2 -2
  36. data/lib/one_helper/onegroup_helper.rb +1 -1
  37. data/lib/one_helper/onehook_helper.rb +1 -1
  38. data/lib/one_helper/onehost_helper.rb +15 -60
  39. data/lib/one_helper/oneimage_helper.rb +73 -12
  40. data/lib/one_helper/onemarket_helper.rb +1 -1
  41. data/lib/one_helper/onemarketapp_helper.rb +3 -3
  42. data/lib/one_helper/onequota_helper.rb +1 -1
  43. data/lib/one_helper/onesecgroup_helper.rb +1 -1
  44. data/lib/one_helper/onetemplate_helper.rb +1 -2
  45. data/lib/one_helper/oneuser_helper.rb +1 -1
  46. data/lib/one_helper/onevcenter_helper.rb +7 -7
  47. data/lib/one_helper/onevdc_helper.rb +1 -1
  48. data/lib/one_helper/onevm_helper.rb +68 -57
  49. data/lib/one_helper/onevmgroup_helper.rb +1 -1
  50. data/lib/one_helper/onevnet_helper.rb +37 -3
  51. data/lib/one_helper/onevntemplate_helper.rb +1 -1
  52. data/lib/one_helper/onevrouter_helper.rb +1 -1
  53. data/lib/one_helper/onezone_helper.rb +1 -1
  54. data/lib/one_helper.rb +7 -8
  55. data/share/schemas/xsd/acct.xsd +28 -0
  56. data/share/schemas/xsd/hook_message_state.xsd +5 -1
  57. data/share/schemas/xsd/host.xsd +3 -23
  58. data/share/schemas/xsd/image.xsd +18 -0
  59. data/share/schemas/xsd/opennebula_configuration.xsd +2 -0
  60. data/share/schemas/xsd/vm.xsd +30 -0
  61. data/share/schemas/xsd/vnet.xsd +28 -0
  62. data/share/schemas/xsd/vnet_pool.xsd +28 -0
  63. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24f7e3fc4b65f114d9882b4ac4d8070785c024e906974e6ea0b37f0284fabe09
4
- data.tar.gz: c62e9e17681129253e72bffe09fd6b0986e00387a6080b3f4ecf4b4c64a83fde
3
+ metadata.gz: fcdc66bd05f8d1764a49ddc05846af9544aec14538d28361836286a637db4762
4
+ data.tar.gz: c29bd48679f35bd2ad33535cb6c89c6d960eb79b9e16c19d4294c0f1646a8b77
5
5
  SHA512:
6
- metadata.gz: 407a8a954b45b0657c6b3797d6a1640f76c6ecbb6f06c0cecfe661d16386fbd9f9ab37ec71f0391b80def5359f8bb6f6e40429e66a74acebf753aba3154da27d
7
- data.tar.gz: 25d0ff8779579f32954cebde7485caa758334283736b7958257071cf08b79891135fd280124574df025d79eac911bdd5ca936c94e959182118da593b354cf36e
6
+ metadata.gz: c9dffa57c55ca6b21db509f772754baea08f83e8313d58c76b2655a1cce55e824ef24245b971a04fa77c304ce649e5da7b9cc80e241b5d3e01a2ba22db2e6698
7
+ data.tar.gz: 3e77e5c5e2b9622c54c60e7bda07767092ab72d33a7563fb164d6da99f7befd398f19ce28b0c92281bda54a795cad5fb34222842e43c37b2d6f4f298518a8e42
data/bin/oneacct CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -75,7 +75,7 @@ CommandParser::CmdParser.new(ARGV) do
75
75
  exit(0)
76
76
  end
77
77
 
78
- filter_flag = options[:userfilter] || VirtualMachinePool::INFO_ALL
78
+ filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL)
79
79
  if options[:start_time]
80
80
  start_time = options[:start_time].to_i
81
81
  else
data/bin/oneacl CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onecluster CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onedatastore CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/oneflow CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -79,7 +79,7 @@ CommandParser::CmdParser.new(ARGV) do
79
79
  DELETE = {
80
80
  :name => 'delete',
81
81
  :large => '--delete',
82
- :description => 'Force flow recover delete'
82
+ :description => 'Force flow necover delete'
83
83
  }
84
84
 
85
85
  APPEND = {
@@ -162,7 +162,6 @@ CommandParser::CmdParser.new(ARGV) do
162
162
 
163
163
  delete_desc = <<-EOT.unindent
164
164
  Delete a given service
165
- To force service removal please use 'oneflow recover --delete <service_id>' command
166
165
  EOT
167
166
 
168
167
  command :delete, delete_desc, [:range, :service_id_list] do
data/bin/oneflow-template CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -78,7 +78,7 @@ CommandParser::CmdParser.new(ARGV) do
78
78
 
79
79
  RECURSIVE = {
80
80
  :name => 'recursive',
81
- :short => '-R',
81
+ :short => '-r',
82
82
  :large => '--recursive',
83
83
  :description => 'Clone the template recursively (templates and images)'
84
84
  }
data/bin/onegroup CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onehook CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onehost CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/oneimage CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -94,6 +94,18 @@ CommandParser::CmdParser.new(ARGV) do
94
94
  :description => 'Do not add context when building from Dockerfile'
95
95
  }
96
96
 
97
+ NO_IP = {
98
+ :name => 'no_ip',
99
+ :large => '--no_ip',
100
+ :description => 'Do not keep NIC addresses (MAC, IP and IP6)'
101
+ }
102
+
103
+ NO_NIC = {
104
+ :name => 'no_nic',
105
+ :large => '--no_nic',
106
+ :description => 'Do not keep network mappings'
107
+ }
108
+
97
109
  ########################################################################
98
110
  # Global Options
99
111
  ########################################################################
@@ -251,9 +263,11 @@ CommandParser::CmdParser.new(ARGV) do
251
263
  Deletes the given Image
252
264
  EOT
253
265
 
254
- command :delete, delete_desc, [:range, :imageid_list] do
266
+ command :delete, delete_desc, [:range, :imageid_list],
267
+ :options => [OpenNebulaHelper::FORCE] do
268
+ force = (options[:force] == true)
255
269
  helper.perform_actions(args[0], options, 'deleting') do |image|
256
- image.delete
270
+ image.delete(force)
257
271
  end
258
272
  end
259
273
 
@@ -410,6 +424,41 @@ CommandParser::CmdParser.new(ARGV) do
410
424
  end
411
425
  end
412
426
 
427
+ restore_desc = <<-EOT.unindent
428
+ Restore a backup image. It will restore the associated VM template to the VM template pool and
429
+ the disk images to the selected image datastore.
430
+ EOT
431
+
432
+ command :restore,
433
+ restore_desc,
434
+ :imageid,
435
+ :options => [OneDatastoreHelper::DATASTORE, NO_NIC, NO_IP] do
436
+ helper.perform_action(args[0], options, 'vm backup restored') do |o|
437
+ if options[:datastore].nil?
438
+ STDERR.puts 'Datastore to restore the backup is mandatory: '
439
+ STDERR.puts "\t -d datastore_id | name"
440
+ exit(-1)
441
+ end
442
+
443
+ restore_opts = ''
444
+
445
+ restore_opts << "NO_NIC=\"YES\"\n" if options[:no_nic]
446
+ restore_opts << "NO_IP=\"YES\"\n" if options[:no_ip]
447
+
448
+ rc = o.restore(options[:datastore].to_i, restore_opts)
449
+
450
+ if !OpenNebula.is_error?(rc)
451
+ ids = rc.split(' ')
452
+
453
+ puts "VM Template: #{ids[0]}" if ids[0]
454
+ puts "Images: #{ids[1..-1].join(' ')}" if ids.length > 1
455
+ else
456
+ puts rc.message
457
+ exit(-1)
458
+ end
459
+ end
460
+ end
461
+
413
462
  list_desc = <<-EOT.unindent
414
463
  Lists Images in the pool
415
464
  EOT
data/bin/oneirb CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onelog CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onemarket CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onemarketapp CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/onesecgroup CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/oneshowback CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -77,7 +77,7 @@ CommandParser::CmdParser.new(ARGV) do
77
77
  exit(0)
78
78
  end
79
79
 
80
- filter_flag = options[:userfilter] || VirtualMachinePool::INFO_ALL
80
+ filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL)
81
81
 
82
82
  start_month = -1
83
83
  start_year = -1
data/bin/onetemplate CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
data/bin/oneuser CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -603,7 +603,7 @@ CommandParser::CmdParser.new(ARGV) do
603
603
 
604
604
  command :passwdsearch, passwdsearch_desc, :driver, :password,
605
605
  :options => [CLIHelper::CSV_OPT, OpenNebulaHelper::XML] do
606
- options[:list] = ['ID', 'NAME', 'AUTH', 'PASSWORD']
606
+ options[:list] = %w[ID NAME AUTH PASSWORD]
607
607
  options[:filter] = ["AUTH=#{args[0]}", "PASSWORD=#{args[1]}"]
608
608
 
609
609
  helper.list_pool(options)
@@ -620,7 +620,7 @@ CommandParser::CmdParser.new(ARGV) do
620
620
  Example, request a valid token for a generic driver (e.g. core auth, LDAP...):
621
621
  oneuser token-create my_user --time 3600
622
622
 
623
- Example, request a group specific token (new resources will be created in that
623
+ Example, request a group spefici token (new resources will be created in that
624
624
  group and only resources that belong to that group will be listed):
625
625
  oneuser token-create my_user --group <id|group>
626
626
 
@@ -708,7 +708,7 @@ CommandParser::CmdParser.new(ARGV) do
708
708
 
709
709
  tokens = helper.find_token(user, token_hint, group, false)
710
710
 
711
- if tokens.empty?
711
+ if tokens.length.zero?
712
712
  exit_with_code 1, 'No valid tokens found.'
713
713
  end
714
714
 
data/bin/onevcenter CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -261,7 +261,7 @@ CommandParser::CmdParser.new(ARGV) do
261
261
  Examples:
262
262
  - importing first datastore
263
263
 
264
- onevcenter import -o templates -h <host_id>
264
+ onevcenter list -o templates -h <host_id>
265
265
 
266
266
  - importing 2 concrete templates:
267
267
 
data/bin/onevdc CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #