opennebula-cli 5.12.10 → 5.13.80.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +9 -4
  3. data/bin/oneacl +8 -5
  4. data/bin/onecluster +10 -7
  5. data/bin/onedatastore +10 -7
  6. data/bin/oneflow +85 -13
  7. data/bin/oneflow-template +45 -8
  8. data/bin/onegroup +10 -7
  9. data/bin/onehook +10 -7
  10. data/bin/onehost +8 -5
  11. data/bin/oneimage +99 -8
  12. data/bin/onemarket +10 -7
  13. data/bin/onemarketapp +117 -10
  14. data/bin/onesecgroup +13 -7
  15. data/bin/oneshowback +18 -10
  16. data/bin/onetemplate +12 -8
  17. data/bin/oneuser +30 -7
  18. data/bin/onevcenter +10 -18
  19. data/bin/onevdc +10 -7
  20. data/bin/onevm +146 -11
  21. data/bin/onevmgroup +13 -7
  22. data/bin/onevnet +8 -5
  23. data/bin/onevntemplate +11 -7
  24. data/bin/onevrouter +10 -7
  25. data/bin/onezone +10 -7
  26. data/lib/cli_helper.rb +4 -6
  27. data/lib/command_parser.rb +1 -1
  28. data/lib/one_helper/oneacct_helper.rb +8 -17
  29. data/lib/one_helper/oneacl_helper.rb +1 -1
  30. data/lib/one_helper/onecluster_helper.rb +1 -1
  31. data/lib/one_helper/onedatastore_helper.rb +11 -1
  32. data/lib/one_helper/oneflow_helper.rb +20 -5
  33. data/lib/one_helper/oneflowtemplate_helper.rb +28 -2
  34. data/lib/one_helper/onegroup_helper.rb +1 -1
  35. data/lib/one_helper/onehook_helper.rb +1 -1
  36. data/lib/one_helper/onehost_helper.rb +1 -5
  37. data/lib/one_helper/oneimage_helper.rb +7 -7
  38. data/lib/one_helper/onemarket_helper.rb +1 -1
  39. data/lib/one_helper/onemarketapp_helper.rb +494 -96
  40. data/lib/one_helper/onequota_helper.rb +1 -1
  41. data/lib/one_helper/onesecgroup_helper.rb +1 -1
  42. data/lib/one_helper/onetemplate_helper.rb +12 -1
  43. data/lib/one_helper/oneuser_helper.rb +11 -3
  44. data/lib/one_helper/onevcenter_helper.rb +176 -146
  45. data/lib/one_helper/onevdc_helper.rb +1 -1
  46. data/lib/one_helper/onevm_helper.rb +4 -3
  47. data/lib/one_helper/onevmgroup_helper.rb +1 -1
  48. data/lib/one_helper/onevnet_helper.rb +1 -1
  49. data/lib/one_helper/onevntemplate_helper.rb +1 -1
  50. data/lib/one_helper/onevrouter_helper.rb +1 -20
  51. data/lib/one_helper/onezone_helper.rb +12 -1
  52. data/lib/one_helper.rb +398 -37
  53. data/share/schemas/xsd/acct.xsd +179 -0
  54. data/share/schemas/xsd/acl_pool.xsd +22 -0
  55. data/share/schemas/xsd/api_info.xsd +43 -0
  56. data/share/schemas/xsd/cluster.xsd +34 -0
  57. data/share/schemas/xsd/cluster_pool.xsd +12 -0
  58. data/share/schemas/xsd/datastore.xsd +67 -0
  59. data/share/schemas/xsd/datastore_pool.xsd +12 -0
  60. data/share/schemas/xsd/document.xsd +42 -0
  61. data/share/schemas/xsd/document_pool.xsd +12 -0
  62. data/share/schemas/xsd/group.xsd +179 -0
  63. data/share/schemas/xsd/group_pool.xsd +194 -0
  64. data/share/schemas/xsd/hook.xsd +59 -0
  65. data/share/schemas/xsd/hook_message_api.xsd +14 -0
  66. data/share/schemas/xsd/hook_message_retry.xsd +12 -0
  67. data/share/schemas/xsd/hook_message_state.xsd +25 -0
  68. data/share/schemas/xsd/hook_pool.xsd +12 -0
  69. data/share/schemas/xsd/host.xsd +164 -0
  70. data/share/schemas/xsd/host_pool.xsd +12 -0
  71. data/share/schemas/xsd/image.xsd +123 -0
  72. data/share/schemas/xsd/image_pool.xsd +12 -0
  73. data/share/schemas/xsd/index.xsd +49 -0
  74. data/share/schemas/xsd/marketplace.xsd +44 -0
  75. data/share/schemas/xsd/marketplace_pool.xsd +12 -0
  76. data/share/schemas/xsd/marketplaceapp.xsd +56 -0
  77. data/share/schemas/xsd/marketplaceapp_pool.xsd +12 -0
  78. data/share/schemas/xsd/opennebula_configuration.xsd +412 -0
  79. data/share/schemas/xsd/raftstatus.xsd +18 -0
  80. data/share/schemas/xsd/security_group.xsd +74 -0
  81. data/share/schemas/xsd/security_group_pool.xsd +12 -0
  82. data/share/schemas/xsd/showback.xsd +29 -0
  83. data/share/schemas/xsd/user.xsd +186 -0
  84. data/share/schemas/xsd/user_pool.xsd +201 -0
  85. data/share/schemas/xsd/vdc.xsd +76 -0
  86. data/share/schemas/xsd/vdc_pool.xsd +12 -0
  87. data/share/schemas/xsd/vm.xsd +251 -0
  88. data/share/schemas/xsd/vm_group.xsd +59 -0
  89. data/share/schemas/xsd/vm_group_pool.xsd +12 -0
  90. data/share/schemas/xsd/vm_pool.xsd +114 -0
  91. data/share/schemas/xsd/vmtemplate.xsd +52 -0
  92. data/share/schemas/xsd/vmtemplate_pool.xsd +12 -0
  93. data/share/schemas/xsd/vnet.xsd +137 -0
  94. data/share/schemas/xsd/vnet_pool.xsd +85 -0
  95. data/share/schemas/xsd/vntemplate.xsd +50 -0
  96. data/share/schemas/xsd/vntemplate_pool.xsd +12 -0
  97. data/share/schemas/xsd/vrouter.xsd +49 -0
  98. data/share/schemas/xsd/vrouter_pool.xsd +12 -0
  99. data/share/schemas/xsd/zone.xsd +40 -0
  100. data/share/schemas/xsd/zone_pool.xsd +36 -0
  101. metadata +68 -7
  102. data/lib/one_helper/oneprovision_helper.rb +0 -362
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -57,11 +57,18 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
57
57
  d['NAME']
58
58
  end
59
59
 
60
+ column :STARTTIME, 'Start time of the Service', :size => 15 do |d|
61
+ d.extend(CLIHelper::HashWithSearch)
62
+ d = d.dsearch('TEMPLATE/BODY')
63
+
64
+ OpenNebulaHelper.time_to_str(d['start_time'])
65
+ end
66
+
60
67
  column :STAT, 'State', :size => 11, :left => true do |d|
61
68
  Service.state_str(d['TEMPLATE']['BODY']['state'])
62
69
  end
63
70
 
64
- default :ID, :USER, :GROUP, :NAME, :STAT
71
+ default :ID, :USER, :GROUP, :NAME, :STARTTIME, :STAT
65
72
  end
66
73
  end
67
74
 
@@ -74,6 +81,8 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
74
81
 
75
82
  if CloudClient.is_error?(response)
76
83
  [response.code.to_i, response.to_s]
84
+ elsif options[:yaml]
85
+ [0, JSON.parse(response.body).to_yaml(:indent => 4)]
77
86
  else
78
87
  array_list = JSON.parse(response.body)
79
88
  array_list = array_list['DOCUMENT_POOL']['DOCUMENT']
@@ -93,6 +102,8 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
93
102
  else
94
103
  [0, JSON.pretty_generate(array_list)]
95
104
  end
105
+ elsif options[:yaml]
106
+ [0, array_list.to_yaml(:indent => 4)]
96
107
  else
97
108
  format_service_pool.show(array_list)
98
109
 
@@ -139,6 +150,8 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
139
150
  else
140
151
  if options[:json]
141
152
  [0, response.body]
153
+ elsif options[:yaml]
154
+ [0, JSON.parse(response.body).to_yaml(:indent => 4)]
142
155
  else
143
156
  str_h1 = '%-80s'
144
157
  document = JSON.parse(response.body)['DOCUMENT']
@@ -260,9 +273,10 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
260
273
  #
261
274
  # @param document [Hash] Service document information
262
275
  def print_service_info(document)
263
- str = '%-20s: %-20s'
264
- str_h1 = '%-80s'
265
- template = document['TEMPLATE']['BODY']
276
+ str = '%-20s: %-20s'
277
+ str_h1 = '%-80s'
278
+ template = document['TEMPLATE']['BODY']
279
+ start_time = OpenNebulaHelper.time_to_str(template['start_time'])
266
280
 
267
281
  puts Kernel.format(str, 'ID', document['ID'])
268
282
  puts Kernel.format(str, 'NAME', document['NAME'])
@@ -273,6 +287,7 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
273
287
  puts Kernel.format(str,
274
288
  'SERVICE STATE',
275
289
  Service.state_str(template['state']))
290
+ puts Kernel.format(str, 'START TIME', start_time)
276
291
 
277
292
  if template['shutdown_action']
278
293
  puts Kernel.format(str, 'SHUTDOWN', template['shutdown_action'])
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -57,7 +57,16 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
57
57
  d['NAME']
58
58
  end
59
59
 
60
- default :ID, :USER, :GROUP, :NAME
60
+ column :REGTIME,
61
+ 'Registration time of the Service Template',
62
+ :size => 15 do |d|
63
+ d.extend(CLIHelper::HashWithSearch)
64
+ d = d.dsearch('TEMPLATE/BODY')
65
+
66
+ OpenNebulaHelper.time_to_str(d['registration_time'])
67
+ end
68
+
69
+ default :ID, :USER, :GROUP, :NAME, :REGTIME
61
70
  end
62
71
  end
63
72
 
@@ -73,6 +82,8 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
73
82
  else
74
83
  if options[:json]
75
84
  [0, response.body]
85
+ elsif options[:yaml]
86
+ [0, JSON.parse(response.body).to_yaml(:indent => 4)]
76
87
  else
77
88
  documents = JSON.parse(response.body)['DOCUMENT_POOL']
78
89
  format_service_template_pool.show(documents['DOCUMENT'])
@@ -120,12 +131,17 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
120
131
  else
121
132
  if options[:json]
122
133
  [0, response.body]
134
+ elsif options[:yaml]
135
+ [0, JSON.parse(response.body).to_yaml(:indent => 4)]
123
136
  else
124
137
  str = '%-20s: %-20s'
125
138
  str_h1 = '%-80s'
126
139
 
127
140
  document = JSON.parse(response.body)['DOCUMENT']
128
141
  template = document['TEMPLATE']['BODY']
142
+ reg_time = OpenNebulaHelper.time_to_str(
143
+ template['registration_time']
144
+ )
129
145
 
130
146
  CLIHelper.print_header(
131
147
  str_h1 % "SERVICE TEMPLATE #{document['ID']} INFORMATION"
@@ -135,6 +151,7 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
135
151
  puts Kernel.format str, 'NAME', document['NAME']
136
152
  puts Kernel.format str, 'USER', document['UNAME']
137
153
  puts Kernel.format str, 'GROUP', document['GNAME']
154
+ puts Kernel.format str, 'REGISTRATION TIME', reg_time
138
155
 
139
156
  puts
140
157
 
@@ -309,4 +326,13 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
309
326
  answers
310
327
  end
311
328
 
329
+ def factory(id = nil)
330
+ if id
331
+ OpenNebula::ServiceTemplate.new_with_id(id, @client)
332
+ else
333
+ xml = OpenNebula::ServiceTemplate.build_xml
334
+ OpenNebula::ServiceTemplate.new(xml, @client)
335
+ end
336
+ end
337
+
312
338
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -222,10 +222,6 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
222
222
  end
223
223
  end
224
224
 
225
- column :PROVIDER, 'Host provider', :left, :size => 6 do |d|
226
- d['TEMPLATE']['PM_MAD'].nil? ? '-' : d['TEMPLATE']['PM_MAD']
227
- end
228
-
229
225
  column :STAT, 'Host status', :left, :size => 6 do |d|
230
226
  OneHostHelper.state_to_str(d['STATE'])
231
227
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -22,7 +22,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
22
22
 
23
23
  # This list contains prefixes that should skip adding user home to the path
24
24
  # This must have the same content as the case $FROM in downloader.sh
25
- PREFIXES = %w[http https ssh s3 rbd vcenter lxd docker]
25
+ PREFIXES = %w[http https ssh s3 rbd vcenter lxd docker dockerfile]
26
26
 
27
27
  TEMPLATE_OPTIONS=[
28
28
  {
@@ -98,9 +98,9 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
98
98
  end
99
99
  },
100
100
  {
101
- :name => 'driver',
102
- :large => '--driver driver',
103
- :description => 'Driver to use image (raw, qcow2, tap:aio:...)',
101
+ :name => 'format',
102
+ :large => '--format format',
103
+ :description => 'Format of the image (raw, qcow2, ...)',
104
104
  :format => String
105
105
  },
106
106
  {
@@ -295,7 +295,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
295
295
  str_h1='%-80s'
296
296
 
297
297
  path = image['PATH']
298
- fstype = image['FSTYPE']
298
+ iformat = image['FORMAT']
299
299
 
300
300
  size = OpenNebulaHelper.unit_to_str(image['SIZE'].to_i, {}, 'M')
301
301
  lock = OpenNebulaHelper.level_lock_to_str(image['LOCK/LOCKED'])
@@ -314,7 +314,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
314
314
  puts format(str, 'PERSISTENT', pers)
315
315
  puts format(str, 'SOURCE', image['SOURCE'])
316
316
  puts format(str, 'PATH', path) if path && !path.empty?
317
- puts format(str, 'FSTYPE', fstype) if fstype && !fstype.empty?
317
+ puts format(str, 'FORMAT', iformat) if iformat && !iformat.empty?
318
318
  puts format(str, 'SIZE', size)
319
319
  puts format(str, 'STATE', image.short_state_str)
320
320
  puts format(str, 'RUNNING_VMS', image['RUNNING_VMS'])
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #