opennebula-cli 6.0.1 → 6.1.90.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +13 -2
  3. data/bin/oneacl +13 -2
  4. data/bin/onecluster +13 -2
  5. data/bin/onedatastore +13 -2
  6. data/bin/oneflow +115 -11
  7. data/bin/oneflow-template +17 -7
  8. data/bin/onegroup +13 -2
  9. data/bin/onehook +17 -6
  10. data/bin/onehost +13 -2
  11. data/bin/oneimage +19 -8
  12. data/bin/onemarket +33 -2
  13. data/bin/onemarketapp +21 -10
  14. data/bin/onesecgroup +13 -2
  15. data/bin/oneshowback +13 -2
  16. data/bin/onetemplate +28 -8
  17. data/bin/oneuser +13 -2
  18. data/bin/onevcenter +29 -9
  19. data/bin/onevdc +13 -2
  20. data/bin/onevm +141 -36
  21. data/bin/onevmgroup +17 -6
  22. data/bin/onevnet +17 -6
  23. data/bin/onevntemplate +17 -6
  24. data/bin/onevrouter +17 -6
  25. data/bin/onezone +34 -3
  26. data/lib/one_helper/oneacct_helper.rb +5 -1
  27. data/lib/one_helper/onecluster_helper.rb +75 -42
  28. data/lib/one_helper/onemarket_helper.rb +12 -1
  29. data/lib/one_helper/onevcenter_helper.rb +2 -2
  30. data/lib/one_helper/onevm_helper.rb +118 -36
  31. data/lib/one_helper/onevnet_helper.rb +173 -151
  32. data/lib/one_helper/onezone_helper.rb +25 -5
  33. data/lib/one_helper.rb +119 -131
  34. data/share/schemas/xsd/api_info.xsd +2 -2
  35. data/share/schemas/xsd/hook_message_api.xsd +1 -1
  36. data/share/schemas/xsd/hook_message_state.xsd +1 -1
  37. data/share/schemas/xsd/host.xsd +21 -1
  38. data/share/schemas/xsd/marketplace.xsd +1 -0
  39. data/share/schemas/xsd/monitoring_data.xsd +23 -11
  40. data/share/schemas/xsd/opennebula_configuration.xsd +1 -0
  41. data/share/schemas/xsd/showback.xsd +1 -0
  42. data/share/schemas/xsd/vm.xsd +64 -10
  43. data/share/schemas/xsd/vm_pool.xsd +3 -26
  44. data/share/schemas/xsd/vnet.xsd +6 -1
  45. data/share/schemas/xsd/zone.xsd +1 -0
  46. data/share/schemas/xsd/zone_pool.xsd +2 -1
  47. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c5f86ca71a7d95f88aaf713683882a82f003992
4
- data.tar.gz: 95fe7015ea7b87889484f625cdcd615c4bab64c7
3
+ metadata.gz: a63f6a8df097aa2f01d3d2055ab3ac6ac9d7c760
4
+ data.tar.gz: d80893cb835b7cc47929fbf7df1b4ff57b383e80
5
5
  SHA512:
6
- metadata.gz: 0dd6fc9565cc444a6d2f6f19457e9f65913b776e73cfd8421fbfba4cd0e9f42318045e64cc9028201526bb35bf2838e863912276d6f3bd2ced3e05d8a86e0b85
7
- data.tar.gz: fc4625f40e75030009aaa17e7ffc02a54512d3858ca910054345b21c42e2f125e3ac521d39ea72c44d49a93b5773853ec60329be52ff076a7b998f21d5310f1a
6
+ metadata.gz: fa4b67191d1c4eac4018a357bd79789fae7ae70acfbdecd892b62b19f353e83f1f1854a1a8e56a1e1a6b84d65b84b806a6419a49cfb15ff6572bcb8e4619d47a
7
+ data.tar.gz: 45aa93131d687f5473d18514828630eafa933668877e4563aa560e7a3fda6d74ee18cd6b93270a02bf390c8d1fd5b342d388491983829dbfe291b73ffdfadb0c
data/bin/oneacct CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneacl CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onecluster CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onedatastore CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneflow CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -71,6 +82,14 @@ CommandParser::CmdParser.new(ARGV) do
71
82
  :description => 'Force flow necover delete'
72
83
  }
73
84
 
85
+ APPEND = {
86
+ :name => 'append',
87
+ :large => '--append',
88
+ :description => 'Append template to the current one'
89
+ }
90
+
91
+ FORMAT = [OpenNebulaHelper::JSON, OpenNebulaHelper::YAML]
92
+
74
93
  # create helper object
75
94
  helper = OneFlowHelper.new
76
95
 
@@ -111,7 +130,7 @@ CommandParser::CmdParser.new(ARGV) do
111
130
  List the available services
112
131
  EOT
113
132
 
114
- command :list, list_desc, :options => OpenNebulaHelper::FORMAT do
133
+ command :list, list_desc, :options => FORMAT do
115
134
  helper.list_service_pool(helper.client(options), options)
116
135
  end
117
136
 
@@ -135,10 +154,7 @@ CommandParser::CmdParser.new(ARGV) do
135
154
  Show detailed information of a given service
136
155
  EOT
137
156
 
138
- command :show,
139
- show_desc,
140
- :service_id,
141
- :options => OpenNebulaHelper::FORMAT do
157
+ command :show, show_desc, :service_id, :options => FORMAT do
142
158
  helper.format_resource(helper.client(options), args[0], options)
143
159
  end
144
160
 
@@ -354,7 +370,11 @@ CommandParser::CmdParser.new(ARGV) do
354
370
  be launched to modify the current content.
355
371
  EOT
356
372
 
357
- command :update, update_desc, :service_id, [:file, nil] do
373
+ command :update,
374
+ update_desc,
375
+ :service_id,
376
+ [:file, nil],
377
+ :options => APPEND do
358
378
  service_id = args[0]
359
379
  client = helper.client(options)
360
380
 
@@ -372,8 +392,10 @@ CommandParser::CmdParser.new(ARGV) do
372
392
  tmp = Tempfile.new(service_id.to_s)
373
393
  path = tmp.path
374
394
 
375
- tmp.write(JSON.pretty_generate(template))
376
- tmp.flush
395
+ unless options[:append]
396
+ tmp.write(JSON.pretty_generate(template))
397
+ tmp.flush
398
+ end
377
399
 
378
400
  if ENV['EDITOR']
379
401
  editor_path = ENV['EDITOR']
@@ -392,7 +414,17 @@ CommandParser::CmdParser.new(ARGV) do
392
414
  end
393
415
  end
394
416
 
395
- response = client.put("#{RESOURCE_PATH}/#{service_id}", File.read(path))
417
+ if options[:append]
418
+ req = {}
419
+ req['append'] = true
420
+ req['template'] = File.read(path)
421
+
422
+ response = client.put("#{RESOURCE_PATH}/#{service_id}",
423
+ req.to_json)
424
+ else
425
+ response = client.put("#{RESOURCE_PATH}/#{service_id}",
426
+ File.read(path))
427
+ end
396
428
 
397
429
  if CloudClient.is_error?(response)
398
430
  [response.code.to_i, response.to_s]
@@ -417,4 +449,76 @@ CommandParser::CmdParser.new(ARGV) do
417
449
  0
418
450
  end
419
451
  end
452
+
453
+ ###
454
+
455
+ add_role_desc = <<-EOT.unindent
456
+ Add new role to running service
457
+ EOT
458
+
459
+ command :'add-role', add_role_desc, :service_id, [:file, nil] do
460
+ service_id = args[0]
461
+ client = helper.client(options)
462
+
463
+ if args[1]
464
+ path = args[1]
465
+ else
466
+ tmp = Tempfile.new(service_id.to_s)
467
+ path = tmp.path
468
+
469
+ if ENV['EDITOR']
470
+ editor_path = ENV['EDITOR']
471
+ else
472
+ editor_path = OpenNebulaHelper::EDITOR_PATH
473
+ end
474
+
475
+ system("#{editor_path} #{path}")
476
+
477
+ unless $CHILD_STATUS.exitstatus.zero?
478
+ STDERR.puts 'Editor not defined'
479
+ exit(-1)
480
+ end
481
+
482
+ tmp.close
483
+ end
484
+
485
+ params = {}
486
+ params[:role] = File.read(path)
487
+ params[:add] = true
488
+ json = Service.build_json_action('add_role', params)
489
+
490
+ response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
491
+ json)
492
+
493
+ if CloudClient.is_error?(response)
494
+ [response.code.to_i, response.to_s]
495
+ else
496
+ 0
497
+ end
498
+ end
499
+
500
+ ###
501
+
502
+ remove_role_desc = <<-EOT.unindent
503
+ Remove role from running service
504
+ EOT
505
+
506
+ command :'remove-role', remove_role_desc, :service_id, :role_name do
507
+ service_id = args[0]
508
+ client = helper.client(options)
509
+
510
+ params = {}
511
+ params[:role] = args[1]
512
+ params[:add] = false
513
+ json = Service.build_json_action('remove_role', params)
514
+
515
+ response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
516
+ json)
517
+
518
+ if CloudClient.is_error?(response)
519
+ [response.code.to_i, response.to_s]
520
+ else
521
+ 0
522
+ end
523
+ end
420
524
  end
data/bin/oneflow-template CHANGED
@@ -28,14 +28,25 @@ else
28
28
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
29
29
  end
30
30
 
31
+ # %%RUBYGEMS_SETUP_BEGIN%%
31
32
  if File.directory?(GEMS_LOCATION)
32
33
  real_gems_path = File.realpath(GEMS_LOCATION)
33
34
  if !defined?(Gem) || Gem.path != [real_gems_path]
34
35
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
35
- require 'rubygems'
36
- Gem.use_paths(real_gems_path)
36
+
37
+ # Suppress warnings from Rubygems
38
+ # https://github.com/OpenNebula/one/issues/5379
39
+ begin
40
+ verb = $VERBOSE
41
+ $VERBOSE = nil
42
+ require 'rubygems'
43
+ Gem.use_paths(real_gems_path)
44
+ ensure
45
+ $VERBOSE = verb
46
+ end
37
47
  end
38
48
  end
49
+ # %%RUBYGEMS_SETUP_END%%
39
50
 
40
51
  $LOAD_PATH << RUBY_LIB_LOCATION
41
52
  $LOAD_PATH << ONEFLOW_LOCATION
@@ -93,6 +104,8 @@ CommandParser::CmdParser.new(ARGV) do
93
104
  'deleting service template'
94
105
  }
95
106
 
107
+ FORMAT = [OpenNebulaHelper::JSON, OpenNebulaHelper::YAML]
108
+
96
109
  usage '`oneflow-template` <command> [<args>] [<options>]'
97
110
  version OpenNebulaHelper::ONE_VERSION
98
111
 
@@ -130,7 +143,7 @@ CommandParser::CmdParser.new(ARGV) do
130
143
  List the available Service Templates
131
144
  EOT
132
145
 
133
- command :list, list_desc, :options => OpenNebulaHelper::FORMAT do
146
+ command :list, list_desc, :options => FORMAT do
134
147
  helper.list_service_template_pool(helper.client(options), options)
135
148
  end
136
149
 
@@ -158,10 +171,7 @@ CommandParser::CmdParser.new(ARGV) do
158
171
  Show detailed information of a given Service Template
159
172
  EOT
160
173
 
161
- command :show,
162
- show_desc,
163
- :templateid,
164
- :options => OpenNebulaHelper::FORMAT do
174
+ command :show, show_desc, :templateid, :options => FORMAT do
165
175
  helper.format_resource(helper.client(options), args[0], options)
166
176
  end
167
177
 
data/bin/onegroup CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onehook CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -254,9 +265,9 @@ CommandParser::CmdParser.new(ARGV) do
254
265
  [Admin]: locks only Admin actions.
255
266
  EOT
256
267
 
257
- command :lock, lock_desc, :hookid,
268
+ command :lock, lock_desc, [:range, :hookid_list],
258
269
  :options => [USE, MANAGE, ADMIN, ALL] do
259
- helper.perform_action(args[0], options, 'Hook locked') do |t|
270
+ helper.perform_actions(args[0], options, 'Hook locked') do |t|
260
271
  if !options[:use].nil?
261
272
  level = 1
262
273
  elsif !options[:manage].nil?
@@ -277,8 +288,8 @@ CommandParser::CmdParser.new(ARGV) do
277
288
  Valid states are: All.
278
289
  EOT
279
290
 
280
- command :unlock, unlock_desc, :hookid do
281
- helper.perform_action(args[0], options, 'Hook unlocked') do |t|
291
+ command :unlock, unlock_desc, [:range, :hookid_list] do
292
+ helper.perform_actions(args[0], options, 'Hook unlocked') do |t|
282
293
  t.unlock
283
294
  end
284
295
  end
data/bin/onehost CHANGED
@@ -28,14 +28,25 @@ else
28
28
  REMOTES_LOCATION = ONE_LOCATION + '/var/remotes/'
29
29
  end
30
30
 
31
+ # %%RUBYGEMS_SETUP_BEGIN%%
31
32
  if File.directory?(GEMS_LOCATION)
32
33
  real_gems_path = File.realpath(GEMS_LOCATION)
33
34
  if !defined?(Gem) || Gem.path != [real_gems_path]
34
35
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
35
- require 'rubygems'
36
- Gem.use_paths(real_gems_path)
36
+
37
+ # Suppress warnings from Rubygems
38
+ # https://github.com/OpenNebula/one/issues/5379
39
+ begin
40
+ verb = $VERBOSE
41
+ $VERBOSE = nil
42
+ require 'rubygems'
43
+ Gem.use_paths(real_gems_path)
44
+ ensure
45
+ $VERBOSE = verb
46
+ end
37
47
  end
38
48
  end
49
+ # %%RUBYGEMS_SETUP_END%%
39
50
 
40
51
  $LOAD_PATH << RUBY_LIB_LOCATION
41
52
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneimage CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -149,8 +160,8 @@ CommandParser::CmdParser.new(ARGV) do
149
160
 
150
161
  oneimage create -d 1 --name ubuntu --path /tmp/ubuntu.qcow2 \\
151
162
  --prefix sd --type OS --driver qcow2 \\
152
- --description "A OS plain installation \\
153
- --persistent"
163
+ --description "A OS plain installation" \\
164
+ --persistent
154
165
 
155
166
  - a datablock image of 400MB:
156
167
 
@@ -434,9 +445,9 @@ CommandParser::CmdParser.new(ARGV) do
434
445
  [Admin]: locks only Admin actions.
435
446
  EOT
436
447
 
437
- command :lock, lock_desc, :imageid,
448
+ command :lock, lock_desc, [:range, :imageid_list],
438
449
  :options => [USE, MANAGE, ADMIN, ALL] do
439
- helper.perform_action(args[0], options, 'Image locked') do |i|
450
+ helper.perform_actions(args[0], options, 'Image locked') do |i|
440
451
  if !options[:use].nil?
441
452
  level = 1
442
453
  elsif !options[:manage].nil?
@@ -457,8 +468,8 @@ CommandParser::CmdParser.new(ARGV) do
457
468
  Valid states are: All.
458
469
  EOT
459
470
 
460
- command :unlock, unlock_desc, :imageid do
461
- helper.perform_action(args[0], options, 'Image unlocked') do |i|
471
+ command :unlock, unlock_desc, [:range, :imageid_list] do
472
+ helper.perform_actions(args[0], options, 'Image unlocked') do |i|
462
473
  i.unlock
463
474
  end
464
475
  end
data/bin/onemarket CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -188,4 +199,24 @@ CommandParser::CmdParser.new(ARGV) do
188
199
  o.rename(args[1])
189
200
  end
190
201
  end
202
+
203
+ enable_desc = <<-EOT.unindent
204
+ Enables the marketplace
205
+ EOT
206
+
207
+ command :enable, enable_desc, [:range, :marketplaceid_list] do
208
+ helper.perform_actions(args[0], options, 'enabled') do |obj|
209
+ obj.enable
210
+ end
211
+ end
212
+
213
+ disable_desc = <<-EOT.unindent
214
+ Disables the marketplace. Remove all its apps.
215
+ EOT
216
+
217
+ command :disable, disable_desc, [:range, :marketplaceid_list] do
218
+ helper.perform_actions(args[0], options, 'disabled') do |obj|
219
+ obj.disable
220
+ end
221
+ end
191
222
  end
data/bin/onemarketapp CHANGED
@@ -28,14 +28,25 @@ else
28
28
  VAR_LOCATION = ONE_LOCATION + '/var'
29
29
  end
30
30
 
31
+ # %%RUBYGEMS_SETUP_BEGIN%%
31
32
  if File.directory?(GEMS_LOCATION)
32
33
  real_gems_path = File.realpath(GEMS_LOCATION)
33
34
  if !defined?(Gem) || Gem.path != [real_gems_path]
34
35
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
35
- require 'rubygems'
36
- Gem.use_paths(real_gems_path)
36
+
37
+ # Suppress warnings from Rubygems
38
+ # https://github.com/OpenNebula/one/issues/5379
39
+ begin
40
+ verb = $VERBOSE
41
+ $VERBOSE = nil
42
+ require 'rubygems'
43
+ Gem.use_paths(real_gems_path)
44
+ ensure
45
+ $VERBOSE = verb
46
+ end
37
47
  end
38
48
  end
49
+ # %%RUBYGEMS_SETUP_END%%
39
50
 
40
51
  $LOAD_PATH << RUBY_LIB_LOCATION
41
52
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -438,11 +449,11 @@ CommandParser::CmdParser.new(ARGV) do
438
449
  [Admin]: locks only Admin actions.
439
450
  EOT
440
451
 
441
- command :lock, lock_desc, :appid,
452
+ command :lock, lock_desc, [:range, :appid_list],
442
453
  :options => [USE, MANAGE, ADMIN, ALL] do
443
- helper.perform_action(args[0],
444
- options,
445
- 'MarketPlaceApp locked') do |app|
454
+ helper.perform_actions(args[0],
455
+ options,
456
+ 'MarketPlaceApp locked') do |app|
446
457
  if !options[:use].nil?
447
458
  level = 1
448
459
  elsif !options[:manage].nil?
@@ -463,10 +474,10 @@ CommandParser::CmdParser.new(ARGV) do
463
474
  Valid states are: All.
464
475
  EOT
465
476
 
466
- command :unlock, unlock_desc, :appid do
467
- helper.perform_action(args[0],
468
- options,
469
- 'MarketPlaceApp unlocked') do |app|
477
+ command :unlock, unlock_desc, [:range, :appid_list] do
478
+ helper.perform_actions(args[0],
479
+ options,
480
+ 'MarketPlaceApp unlocked') do |app|
470
481
  app.unlock
471
482
  end
472
483
  end
data/bin/onesecgroup CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'