opennebula-cli 7.1.80.pre → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/oneacct +1 -1
- data/bin/oneacl +1 -1
- data/bin/onebackupjob +1 -1
- data/bin/onecluster +1 -1
- data/bin/onedatastore +1 -1
- data/bin/oneflow +1 -1
- data/bin/oneflow-template +1 -1
- data/bin/oneform +1 -1
- data/bin/onegroup +1 -1
- data/bin/onehook +1 -1
- data/bin/onehost +1 -1
- data/bin/oneimage +1 -1
- data/bin/oneirb +1 -1
- data/bin/onelog +1 -1
- data/bin/onemarket +1 -1
- data/bin/onemarketapp +1 -1
- data/bin/onesecgroup +1 -1
- data/bin/oneshowback +1 -1
- data/bin/onetemplate +1 -1
- data/bin/oneuser +1 -1
- data/bin/onevdc +1 -1
- data/bin/onevm +2 -2
- data/bin/onevmgroup +1 -1
- data/bin/onevnet +1 -1
- data/bin/onevntemplate +1 -1
- data/bin/onevrouter +1 -1
- data/bin/onezone +1 -1
- data/lib/cli_helper.rb +1 -1
- data/lib/command_parser.rb +135 -126
- data/lib/load_opennebula_paths.rb +5 -0
- data/lib/ods_helper.rb +541 -0
- data/lib/one_helper/oneacct_helper.rb +117 -109
- data/lib/one_helper/oneacl_helper.rb +1 -1
- data/lib/one_helper/onebackupjob_helper.rb +1 -1
- data/lib/one_helper/onecluster_helper.rb +1 -1
- data/lib/one_helper/onedatastore_helper.rb +87 -80
- data/lib/one_helper/oneflow_helper.rb +1 -1
- data/lib/one_helper/oneflowtemplate_helper.rb +1 -1
- data/lib/one_helper/oneform_helper.rb +1 -1
- 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 -1
- data/lib/one_helper/oneimage_helper.rb +1 -1
- data/lib/one_helper/onemarket_helper.rb +59 -58
- data/lib/one_helper/onemarketapp_helper.rb +1 -1
- data/lib/one_helper/onequota_helper.rb +240 -190
- data/lib/one_helper/onesecgroup_helper.rb +87 -85
- data/lib/one_helper/onetemplate_helper.rb +64 -64
- data/lib/one_helper/oneuser_helper.rb +2 -2
- data/lib/one_helper/onevdc_helper.rb +45 -45
- data/lib/one_helper/onevm_helper.rb +6 -8
- data/lib/one_helper/onevmgroup_helper.rb +65 -63
- data/lib/one_helper/onevnet_helper.rb +1 -1
- data/lib/one_helper/onevntemplate_helper.rb +43 -40
- data/lib/one_helper/onevrouter_helper.rb +86 -87
- data/lib/one_helper/onezone_helper.rb +98 -101
- data/lib/one_helper.rb +90 -71
- data/share/schemas/xsd/acct.xsd +3 -104
- data/share/schemas/xsd/cluster.xsd +4 -21
- data/share/schemas/xsd/datastore.xsd +4 -29
- data/share/schemas/xsd/document.xsd +3 -25
- data/share/schemas/xsd/group.xsd +2 -14
- data/share/schemas/xsd/group_pool.xsd +2 -14
- data/share/schemas/xsd/hook.xsd +2 -0
- data/share/schemas/xsd/host.xsd +5 -7
- data/share/schemas/xsd/image.xsd +2 -25
- data/share/schemas/xsd/marketplace.xsd +3 -22
- data/share/schemas/xsd/marketplaceapp.xsd +3 -25
- data/share/schemas/xsd/opennebula_configuration.xsd +3 -2
- data/share/schemas/xsd/requirements.xsd +3 -21
- data/share/schemas/xsd/security_group.xsd +6 -43
- data/share/schemas/xsd/shared.xsd +3 -3
- data/share/schemas/xsd/vdc.xsd +2 -7
- data/share/schemas/xsd/vm_group.xsd +3 -25
- data/share/schemas/xsd/vm_pool.xsd +2 -0
- data/share/schemas/xsd/vmtemplate.xsd +3 -25
- data/share/schemas/xsd/vnet.xsd +9 -67
- data/share/schemas/xsd/vnet_pool.xsd +8 -57
- data/share/schemas/xsd/vntemplate.xsd +3 -25
- data/share/schemas/xsd/vrouter.xsd +4 -32
- metadata +8 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2026, 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 #
|
|
@@ -18,58 +18,57 @@ require 'one_helper'
|
|
|
18
18
|
require 'opennebula/virtual_router'
|
|
19
19
|
require 'opennebula/virtual_router_pool'
|
|
20
20
|
|
|
21
|
+
# Helper class for VRouter commands
|
|
21
22
|
class OneVirtualRouterHelper < OpenNebulaHelper::OneHelper
|
|
22
23
|
|
|
23
24
|
ALL_TEMPLATE = {
|
|
24
|
-
:name =>
|
|
25
|
-
:large =>
|
|
26
|
-
:description =>
|
|
25
|
+
:name => 'all',
|
|
26
|
+
:large => '--all',
|
|
27
|
+
:description => 'Show all template data'
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
FLOAT = {
|
|
30
|
-
:name =>
|
|
31
|
-
:large =>
|
|
32
|
-
:description =>
|
|
31
|
+
:name => 'float',
|
|
32
|
+
:large => '--float',
|
|
33
|
+
:description => 'Makes this IP request a Floating one'
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
def self.rname
|
|
36
|
-
|
|
37
|
+
'VROUTER'
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
def self.conf_file
|
|
40
|
-
|
|
41
|
+
'onevrouter.yaml'
|
|
41
42
|
end
|
|
42
43
|
|
|
43
44
|
def format_pool(options)
|
|
44
45
|
config_file = self.class.table_conf
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
column :ID,
|
|
48
|
-
d[
|
|
47
|
+
CLIHelper::ShowTable.new(config_file, self) do
|
|
48
|
+
column :ID, 'ONE identifier for the Virtual Router', :size=>4 do |d|
|
|
49
|
+
d['ID']
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
column :NAME,
|
|
52
|
-
d[
|
|
52
|
+
column :NAME, 'Name of the Virtual Router', :left, :size=>27 do |d|
|
|
53
|
+
d['NAME']
|
|
53
54
|
end
|
|
54
55
|
|
|
55
|
-
column :USER,
|
|
56
|
-
|
|
56
|
+
column :USER, 'Username of the Virtual Router owner', :left,
|
|
57
|
+
:size=>15 do |d|
|
|
57
58
|
helper.user_name(d, options)
|
|
58
59
|
end
|
|
59
60
|
|
|
60
|
-
column :GROUP,
|
|
61
|
+
column :GROUP, 'Group of the Virtual Router', :left, :size=>15 do |d|
|
|
61
62
|
helper.group_name(d, options)
|
|
62
63
|
end
|
|
63
64
|
|
|
64
65
|
default :ID, :USER, :GROUP, :NAME
|
|
65
66
|
end
|
|
66
|
-
|
|
67
|
-
table
|
|
68
67
|
end
|
|
69
68
|
|
|
70
69
|
private
|
|
71
70
|
|
|
72
|
-
def factory(id=nil)
|
|
71
|
+
def factory(id = nil)
|
|
73
72
|
if id
|
|
74
73
|
OpenNebula::VirtualRouter.new_with_id(id, @client)
|
|
75
74
|
else
|
|
@@ -78,134 +77,134 @@ class OneVirtualRouterHelper < OpenNebulaHelper::OneHelper
|
|
|
78
77
|
end
|
|
79
78
|
end
|
|
80
79
|
|
|
81
|
-
def factory_pool(user_flag
|
|
80
|
+
def factory_pool(user_flag = -2)
|
|
82
81
|
OpenNebula::VirtualRouterPool.new(@client, user_flag)
|
|
83
82
|
end
|
|
84
83
|
|
|
85
84
|
def format_resource(obj, options = {})
|
|
86
|
-
str=
|
|
87
|
-
str_h1=
|
|
85
|
+
str='%-15s: %-20s'
|
|
86
|
+
str_h1='%-80s'
|
|
88
87
|
|
|
89
88
|
CLIHelper.print_header(
|
|
90
|
-
str_h1 % "VIRTUAL ROUTER #{obj['ID']} INFORMATION"
|
|
91
|
-
|
|
92
|
-
puts str
|
|
93
|
-
puts str
|
|
94
|
-
puts str
|
|
95
|
-
puts str
|
|
89
|
+
str_h1 % "VIRTUAL ROUTER #{obj['ID']} INFORMATION"
|
|
90
|
+
)
|
|
91
|
+
puts format(str, 'ID', obj.id.to_s)
|
|
92
|
+
puts format(str, 'NAME', obj.name)
|
|
93
|
+
puts format(str, 'USER', obj['UNAME'])
|
|
94
|
+
puts format(str, 'GROUP', obj['GNAME'])
|
|
95
|
+
puts format(str, 'LOCK', OpenNebulaHelper.level_lock_to_str(obj['LOCK/LOCKED']))
|
|
96
96
|
puts
|
|
97
97
|
|
|
98
|
-
CLIHelper.print_header(str_h1 %
|
|
98
|
+
CLIHelper.print_header(str_h1 % 'PERMISSIONS', false)
|
|
99
99
|
|
|
100
|
-
[
|
|
101
|
-
mask =
|
|
102
|
-
mask[0] =
|
|
103
|
-
mask[1] =
|
|
104
|
-
mask[2] =
|
|
100
|
+
['OWNER', 'GROUP', 'OTHER'].each do |e|
|
|
101
|
+
mask = '---'
|
|
102
|
+
mask[0] = 'u' if obj["PERMISSIONS/#{e}_U"] == '1'
|
|
103
|
+
mask[1] = 'm' if obj["PERMISSIONS/#{e}_M"] == '1'
|
|
104
|
+
mask[2] = 'a' if obj["PERMISSIONS/#{e}_A"] == '1'
|
|
105
105
|
|
|
106
|
-
puts str
|
|
107
|
-
|
|
106
|
+
puts format(str, e, mask)
|
|
107
|
+
end
|
|
108
108
|
|
|
109
|
-
if obj.has_elements?(
|
|
109
|
+
if obj.has_elements?('/VROUTER/TEMPLATE/NIC')
|
|
110
110
|
puts
|
|
111
|
-
CLIHelper.print_header(str_h1 %
|
|
111
|
+
CLIHelper.print_header(str_h1 % 'VIRTUAL ROUTER NICS', false)
|
|
112
112
|
|
|
113
|
-
nic_default = {
|
|
114
|
-
|
|
113
|
+
nic_default = { 'NETWORK' => '-',
|
|
114
|
+
'IP' => '-' }
|
|
115
115
|
|
|
116
116
|
array_id = 0
|
|
117
117
|
vm_nics = [obj.to_hash['VROUTER']['TEMPLATE']['NIC']].flatten.compact
|
|
118
|
-
vm_nics.each
|
|
119
|
-
|
|
120
|
-
next if nic.has_key?("CLI_DONE")
|
|
118
|
+
vm_nics.each do |nic|
|
|
119
|
+
next if nic.key?('CLI_DONE')
|
|
121
120
|
|
|
122
|
-
floating =
|
|
121
|
+
floating = nic.key?('FLOATING_IP') && nic['FLOATING_IP'].upcase == 'YES'
|
|
123
122
|
|
|
124
123
|
if floating
|
|
125
|
-
if nic.
|
|
126
|
-
ip6_link = {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
vm_nics.insert(array_id+1,ip6_link)
|
|
124
|
+
if nic.key?('IP6_LINK')
|
|
125
|
+
ip6_link = { 'IP' => nic.delete('IP6_LINK'),
|
|
126
|
+
'CLI_DONE' => true,
|
|
127
|
+
'DOUBLE_ENTRY' => true }
|
|
128
|
+
vm_nics.insert(array_id+1, ip6_link)
|
|
130
129
|
|
|
131
130
|
array_id += 1
|
|
132
131
|
end
|
|
133
132
|
|
|
134
|
-
if nic.
|
|
135
|
-
ip6_link = {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
vm_nics.insert(array_id+1,ip6_link)
|
|
133
|
+
if nic.key?('IP6_ULA')
|
|
134
|
+
ip6_link = { 'IP' => nic.delete('IP6_ULA'),
|
|
135
|
+
'CLI_DONE' => true,
|
|
136
|
+
'DOUBLE_ENTRY' => true }
|
|
137
|
+
vm_nics.insert(array_id+1, ip6_link)
|
|
139
138
|
|
|
140
139
|
array_id += 1
|
|
141
140
|
end
|
|
142
141
|
|
|
143
|
-
if nic.
|
|
144
|
-
ip6_link = {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
vm_nics.insert(array_id+1,ip6_link)
|
|
142
|
+
if nic.key?('IP6_GLOBAL')
|
|
143
|
+
ip6_link = { 'IP' => nic.delete('IP6_GLOBAL'),
|
|
144
|
+
'CLI_DONE' => true,
|
|
145
|
+
'DOUBLE_ENTRY' => true }
|
|
146
|
+
vm_nics.insert(array_id+1, ip6_link)
|
|
148
147
|
|
|
149
148
|
array_id += 1
|
|
150
149
|
end
|
|
151
150
|
else
|
|
152
|
-
nic.delete(
|
|
151
|
+
nic.delete('IP')
|
|
153
152
|
end
|
|
154
153
|
|
|
155
|
-
nic.merge!(nic_default) {|
|
|
154
|
+
nic.merge!(nic_default) {|_k, v1, _v2| v1 }
|
|
156
155
|
array_id += 1
|
|
157
|
-
|
|
156
|
+
end
|
|
158
157
|
|
|
159
158
|
CLIHelper::ShowTable.new(nil, self) do
|
|
160
|
-
column :ID,
|
|
161
|
-
if d[
|
|
162
|
-
|
|
159
|
+
column :ID, '', :size=>3 do |d|
|
|
160
|
+
if d['DOUBLE_ENTRY']
|
|
161
|
+
''
|
|
163
162
|
else
|
|
164
|
-
d[
|
|
163
|
+
d['NIC_ID']
|
|
165
164
|
end
|
|
166
165
|
end
|
|
167
166
|
|
|
168
|
-
column :NETWORK,
|
|
169
|
-
if d[
|
|
170
|
-
|
|
167
|
+
column :NETWORK, '', :left, :size=>20 do |d|
|
|
168
|
+
if d['DOUBLE_ENTRY']
|
|
169
|
+
''
|
|
171
170
|
else
|
|
172
|
-
d[
|
|
171
|
+
d['NETWORK']
|
|
173
172
|
end
|
|
174
173
|
end
|
|
175
174
|
|
|
176
|
-
column :MANAGEMENT,
|
|
177
|
-
if d[
|
|
178
|
-
|
|
175
|
+
column :MANAGEMENT, '', :left, :size=>10 do |d|
|
|
176
|
+
if d['DOUBLE_ENTRY']
|
|
177
|
+
''
|
|
179
178
|
else
|
|
180
|
-
if !d[
|
|
181
|
-
d[
|
|
179
|
+
if !d['VROUTER_MANAGEMENT'].nil?
|
|
180
|
+
d['VROUTER_MANAGEMENT']
|
|
182
181
|
else
|
|
183
|
-
|
|
182
|
+
'NO'
|
|
184
183
|
end
|
|
185
184
|
end
|
|
186
185
|
end
|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
d["IP"]
|
|
187
|
+
column :IP, '', :left, :adjust, :size=>15 do |d|
|
|
188
|
+
d['IP']
|
|
191
189
|
end
|
|
192
|
-
end.show(vm_nics,{})
|
|
190
|
+
end.show(vm_nics, {})
|
|
193
191
|
end
|
|
194
192
|
|
|
195
|
-
while obj.has_elements?(
|
|
196
|
-
obj.delete_element(
|
|
197
|
-
end
|
|
193
|
+
while obj.has_elements?('/VROUTER/TEMPLATE/NIC')
|
|
194
|
+
obj.delete_element('/VROUTER/TEMPLATE/NIC')
|
|
195
|
+
end unless options[:all]
|
|
198
196
|
|
|
199
197
|
puts
|
|
200
198
|
|
|
201
|
-
CLIHelper.print_header(str_h1 %
|
|
199
|
+
CLIHelper.print_header(str_h1 % 'TEMPLATE CONTENTS', false)
|
|
202
200
|
puts obj.template_str
|
|
203
201
|
|
|
204
202
|
puts
|
|
205
203
|
|
|
206
|
-
CLIHelper.print_header(
|
|
204
|
+
CLIHelper.print_header(format('%-15s', 'VIRTUAL MACHINES'))
|
|
207
205
|
obj.vm_ids.each do |id|
|
|
208
|
-
puts
|
|
206
|
+
puts format('%-15s', id)
|
|
209
207
|
end
|
|
210
208
|
end
|
|
209
|
+
|
|
211
210
|
end
|