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.
- checksums.yaml +4 -4
- data/bin/oneacct +9 -4
- data/bin/oneacl +8 -5
- data/bin/onecluster +10 -7
- data/bin/onedatastore +10 -7
- data/bin/oneflow +85 -13
- data/bin/oneflow-template +45 -8
- data/bin/onegroup +10 -7
- data/bin/onehook +10 -7
- data/bin/onehost +8 -5
- data/bin/oneimage +99 -8
- data/bin/onemarket +10 -7
- data/bin/onemarketapp +117 -10
- data/bin/onesecgroup +13 -7
- data/bin/oneshowback +18 -10
- data/bin/onetemplate +12 -8
- data/bin/oneuser +30 -7
- data/bin/onevcenter +10 -18
- data/bin/onevdc +10 -7
- data/bin/onevm +146 -11
- data/bin/onevmgroup +13 -7
- data/bin/onevnet +8 -5
- data/bin/onevntemplate +11 -7
- data/bin/onevrouter +10 -7
- data/bin/onezone +10 -7
- data/lib/cli_helper.rb +4 -6
- data/lib/command_parser.rb +1 -1
- data/lib/one_helper/oneacct_helper.rb +8 -17
- data/lib/one_helper/oneacl_helper.rb +1 -1
- data/lib/one_helper/onecluster_helper.rb +1 -1
- data/lib/one_helper/onedatastore_helper.rb +11 -1
- data/lib/one_helper/oneflow_helper.rb +20 -5
- data/lib/one_helper/oneflowtemplate_helper.rb +28 -2
- data/lib/one_helper/onegroup_helper.rb +1 -1
- data/lib/one_helper/onehook_helper.rb +1 -1
- data/lib/one_helper/onehost_helper.rb +1 -5
- data/lib/one_helper/oneimage_helper.rb +7 -7
- data/lib/one_helper/onemarket_helper.rb +1 -1
- data/lib/one_helper/onemarketapp_helper.rb +494 -96
- data/lib/one_helper/onequota_helper.rb +1 -1
- data/lib/one_helper/onesecgroup_helper.rb +1 -1
- data/lib/one_helper/onetemplate_helper.rb +12 -1
- data/lib/one_helper/oneuser_helper.rb +11 -3
- data/lib/one_helper/onevcenter_helper.rb +176 -146
- data/lib/one_helper/onevdc_helper.rb +1 -1
- data/lib/one_helper/onevm_helper.rb +4 -3
- data/lib/one_helper/onevmgroup_helper.rb +1 -1
- data/lib/one_helper/onevnet_helper.rb +1 -1
- data/lib/one_helper/onevntemplate_helper.rb +1 -1
- data/lib/one_helper/onevrouter_helper.rb +1 -20
- data/lib/one_helper/onezone_helper.rb +12 -1
- data/lib/one_helper.rb +398 -37
- data/share/schemas/xsd/acct.xsd +179 -0
- data/share/schemas/xsd/acl_pool.xsd +22 -0
- data/share/schemas/xsd/api_info.xsd +43 -0
- data/share/schemas/xsd/cluster.xsd +34 -0
- data/share/schemas/xsd/cluster_pool.xsd +12 -0
- data/share/schemas/xsd/datastore.xsd +67 -0
- data/share/schemas/xsd/datastore_pool.xsd +12 -0
- data/share/schemas/xsd/document.xsd +42 -0
- data/share/schemas/xsd/document_pool.xsd +12 -0
- data/share/schemas/xsd/group.xsd +179 -0
- data/share/schemas/xsd/group_pool.xsd +194 -0
- data/share/schemas/xsd/hook.xsd +59 -0
- data/share/schemas/xsd/hook_message_api.xsd +14 -0
- data/share/schemas/xsd/hook_message_retry.xsd +12 -0
- data/share/schemas/xsd/hook_message_state.xsd +25 -0
- data/share/schemas/xsd/hook_pool.xsd +12 -0
- data/share/schemas/xsd/host.xsd +164 -0
- data/share/schemas/xsd/host_pool.xsd +12 -0
- data/share/schemas/xsd/image.xsd +123 -0
- data/share/schemas/xsd/image_pool.xsd +12 -0
- data/share/schemas/xsd/index.xsd +49 -0
- data/share/schemas/xsd/marketplace.xsd +44 -0
- data/share/schemas/xsd/marketplace_pool.xsd +12 -0
- data/share/schemas/xsd/marketplaceapp.xsd +56 -0
- data/share/schemas/xsd/marketplaceapp_pool.xsd +12 -0
- data/share/schemas/xsd/opennebula_configuration.xsd +412 -0
- data/share/schemas/xsd/raftstatus.xsd +18 -0
- data/share/schemas/xsd/security_group.xsd +74 -0
- data/share/schemas/xsd/security_group_pool.xsd +12 -0
- data/share/schemas/xsd/showback.xsd +29 -0
- data/share/schemas/xsd/user.xsd +186 -0
- data/share/schemas/xsd/user_pool.xsd +201 -0
- data/share/schemas/xsd/vdc.xsd +76 -0
- data/share/schemas/xsd/vdc_pool.xsd +12 -0
- data/share/schemas/xsd/vm.xsd +251 -0
- data/share/schemas/xsd/vm_group.xsd +59 -0
- data/share/schemas/xsd/vm_group_pool.xsd +12 -0
- data/share/schemas/xsd/vm_pool.xsd +114 -0
- data/share/schemas/xsd/vmtemplate.xsd +52 -0
- data/share/schemas/xsd/vmtemplate_pool.xsd +12 -0
- data/share/schemas/xsd/vnet.xsd +137 -0
- data/share/schemas/xsd/vnet_pool.xsd +85 -0
- data/share/schemas/xsd/vntemplate.xsd +50 -0
- data/share/schemas/xsd/vntemplate_pool.xsd +12 -0
- data/share/schemas/xsd/vrouter.xsd +49 -0
- data/share/schemas/xsd/vrouter_pool.xsd +12 -0
- data/share/schemas/xsd/zone.xsd +40 -0
- data/share/schemas/xsd/zone_pool.xsd +36 -0
- metadata +68 -7
- data/lib/one_helper/oneprovision_helper.rb +0 -362
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
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
|
264
|
-
str_h1
|
265
|
-
template
|
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-
|
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
|
-
|
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-
|
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-
|
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-
|
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-
|
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 => '
|
102
|
-
:large => '--
|
103
|
-
:description => '
|
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
|
-
|
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, '
|
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-
|
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 #
|