opennebula-cli 6.0.2 → 6.0.3
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/oneflow +72 -0
- data/bin/onemarket +20 -0
- data/bin/onevm +6 -2
- data/lib/one_helper.rb +8 -6
- data/lib/one_helper/onemarket_helper.rb +12 -1
- data/lib/one_helper/onevm_helper.rb +6 -5
- data/share/schemas/xsd/api_info.xsd +2 -2
- data/share/schemas/xsd/hook_message_api.xsd +1 -1
- data/share/schemas/xsd/hook_message_state.xsd +1 -1
- data/share/schemas/xsd/marketplace.xsd +1 -0
- data/share/schemas/xsd/zone_pool.xsd +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d71d6197859d846259af7cb730330d8d29a03e89
|
4
|
+
data.tar.gz: 515adb9afa80cf52f7ab93ac9a582af9bc38afc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02cfddcd26f6d496448f69653ad05f463eebf60cb5d40a956319faaed2f9b4829db13e75b9154168e3a0597a3cf2f20739229ce9758b2ce537f535c9f5a5e644
|
7
|
+
data.tar.gz: 8409cabd907844035d833f9d37b37dc08c15bf0afd276a1772c303ffa6d1a6e004985f4eefa5d440590d93f5910f209fee68bef5238aa8e206c6f806d82865e4
|
data/bin/oneflow
CHANGED
@@ -428,4 +428,76 @@ CommandParser::CmdParser.new(ARGV) do
|
|
428
428
|
0
|
429
429
|
end
|
430
430
|
end
|
431
|
+
|
432
|
+
###
|
433
|
+
|
434
|
+
add_role_desc = <<-EOT.unindent
|
435
|
+
Add new role to running service
|
436
|
+
EOT
|
437
|
+
|
438
|
+
command :'add-role', add_role_desc, :service_id, [:file, nil] do
|
439
|
+
service_id = args[0]
|
440
|
+
client = helper.client(options)
|
441
|
+
|
442
|
+
if args[1]
|
443
|
+
path = args[1]
|
444
|
+
else
|
445
|
+
tmp = Tempfile.new(service_id.to_s)
|
446
|
+
path = tmp.path
|
447
|
+
|
448
|
+
if ENV['EDITOR']
|
449
|
+
editor_path = ENV['EDITOR']
|
450
|
+
else
|
451
|
+
editor_path = OpenNebulaHelper::EDITOR_PATH
|
452
|
+
end
|
453
|
+
|
454
|
+
system("#{editor_path} #{path}")
|
455
|
+
|
456
|
+
unless $CHILD_STATUS.exitstatus.zero?
|
457
|
+
STDERR.puts 'Editor not defined'
|
458
|
+
exit(-1)
|
459
|
+
end
|
460
|
+
|
461
|
+
tmp.close
|
462
|
+
end
|
463
|
+
|
464
|
+
params = {}
|
465
|
+
params[:role] = File.read(path)
|
466
|
+
params[:add] = true
|
467
|
+
json = Service.build_json_action('add_role', params)
|
468
|
+
|
469
|
+
response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
|
470
|
+
json)
|
471
|
+
|
472
|
+
if CloudClient.is_error?(response)
|
473
|
+
[response.code.to_i, response.to_s]
|
474
|
+
else
|
475
|
+
0
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
479
|
+
###
|
480
|
+
|
481
|
+
remove_role_desc = <<-EOT.unindent
|
482
|
+
Remove role from running service
|
483
|
+
EOT
|
484
|
+
|
485
|
+
command :'remove-role', remove_role_desc, :service_id, :role_name do
|
486
|
+
service_id = args[0]
|
487
|
+
client = helper.client(options)
|
488
|
+
|
489
|
+
params = {}
|
490
|
+
params[:role] = args[1]
|
491
|
+
params[:add] = false
|
492
|
+
json = Service.build_json_action('remove_role', params)
|
493
|
+
|
494
|
+
response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
|
495
|
+
json)
|
496
|
+
|
497
|
+
if CloudClient.is_error?(response)
|
498
|
+
[response.code.to_i, response.to_s]
|
499
|
+
else
|
500
|
+
0
|
501
|
+
end
|
502
|
+
end
|
431
503
|
end
|
data/bin/onemarket
CHANGED
@@ -199,4 +199,24 @@ CommandParser::CmdParser.new(ARGV) do
|
|
199
199
|
o.rename(args[1])
|
200
200
|
end
|
201
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
|
202
222
|
end
|
data/bin/onevm
CHANGED
@@ -1616,7 +1616,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1616
1616
|
system("ssh #{opts} #{login}@#{ip} -p #{port} #{cmd}")
|
1617
1617
|
end
|
1618
1618
|
|
1619
|
+
# rubocop:disable Style/SpecialGlobalVars
|
1619
1620
|
$?.exitstatus
|
1621
|
+
# rubocop:enable Style/SpecialGlobalVars
|
1620
1622
|
end
|
1621
1623
|
|
1622
1624
|
port_desc = <<-EOT.unindent
|
@@ -1670,14 +1672,16 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1670
1672
|
i_end_p = Integer(i_range[1].split('/')[0])
|
1671
1673
|
|
1672
1674
|
if args[1].nil?
|
1673
|
-
|
1675
|
+
start_r = Array(e_start_p..e_end_p)
|
1676
|
+
end_r = Array(i_start_p..i_end_p)
|
1677
|
+
|
1678
|
+
start_r.zip(end_r) do |p1, p2|
|
1674
1679
|
puts "#{ip}@#{p1} -> #{p2}"
|
1675
1680
|
end
|
1676
1681
|
else
|
1677
1682
|
puts "#{ip}@#{e_start_p + Integer(args[1]) - 1} -> #{args[1]}"
|
1678
1683
|
end
|
1679
1684
|
end
|
1680
|
-
|
1681
1685
|
end
|
1682
1686
|
|
1683
1687
|
# Deprecated commands
|
data/lib/one_helper.rb
CHANGED
@@ -1893,8 +1893,10 @@ EOT
|
|
1893
1893
|
if options[:size]
|
1894
1894
|
ar << ', SIZE = ' << options[:size]
|
1895
1895
|
else
|
1896
|
-
|
1897
|
-
|
1896
|
+
unless options[:ip6]
|
1897
|
+
STDERR.puts 'Address range needs to specify size (-s size)'
|
1898
|
+
exit(-1)
|
1899
|
+
end
|
1898
1900
|
end
|
1899
1901
|
|
1900
1902
|
if options[:ip6]
|
@@ -2164,10 +2166,10 @@ EOT
|
|
2164
2166
|
when 'number', 'number-float'
|
2165
2167
|
if type == 'number'
|
2166
2168
|
header += 'Integer: '
|
2167
|
-
exp = INT_EXP
|
2169
|
+
exp = OneTemplateHelper::INT_EXP
|
2168
2170
|
else
|
2169
2171
|
header += 'Float: '
|
2170
|
-
exp = FLOAT_EXP
|
2172
|
+
exp = OneTemplateHelper::FLOAT_EXP
|
2171
2173
|
end
|
2172
2174
|
|
2173
2175
|
begin
|
@@ -2193,13 +2195,13 @@ EOT
|
|
2193
2195
|
end
|
2194
2196
|
|
2195
2197
|
if type == 'range'
|
2196
|
-
exp = INT_EXP
|
2198
|
+
exp = OneTemplateHelper::INT_EXP
|
2197
2199
|
min = min.to_i
|
2198
2200
|
max = max.to_i
|
2199
2201
|
|
2200
2202
|
header += "Integer in the range [#{min}..#{max}]: "
|
2201
2203
|
else
|
2202
|
-
exp = FLOAT_EXP
|
2204
|
+
exp = OneTemplateHelper::FLOAT_EXP
|
2203
2205
|
min = min.to_f
|
2204
2206
|
max = max.to_f
|
2205
2207
|
|
@@ -36,6 +36,12 @@ class OneMarketPlaceHelper < OpenNebulaHelper::OneHelper
|
|
36
36
|
"onemarket.yaml"
|
37
37
|
end
|
38
38
|
|
39
|
+
def self.state_to_str(id)
|
40
|
+
state_str = MarketPlace::MARKETPLACE_STATES[id.to_i]
|
41
|
+
|
42
|
+
MarketPlace::SHORT_MARKETPLACE_STATES[state_str]
|
43
|
+
end
|
44
|
+
|
39
45
|
def format_pool(options)
|
40
46
|
config_file = self.class.table_conf
|
41
47
|
|
@@ -86,7 +92,11 @@ class OneMarketPlaceHelper < OpenNebulaHelper::OneHelper
|
|
86
92
|
d["ZONE_ID"]
|
87
93
|
end
|
88
94
|
|
89
|
-
|
95
|
+
column :STAT, 'Markeplace status', :left, :size => 4 do |d|
|
96
|
+
OneMarketPlaceHelper.state_to_str(d['STATE'])
|
97
|
+
end
|
98
|
+
|
99
|
+
default :ID, :NAME, :SIZE, :AVAIL, :APPS, :MAD, :ZONE, :STAT
|
90
100
|
end
|
91
101
|
|
92
102
|
table
|
@@ -116,6 +126,7 @@ class OneMarketPlaceHelper < OpenNebulaHelper::OneHelper
|
|
116
126
|
puts str % ["NAME", market.name]
|
117
127
|
puts str % ["USER", market['UNAME']]
|
118
128
|
puts str % ["GROUP", market['GNAME']]
|
129
|
+
puts str % ["STATE", market.state_str]
|
119
130
|
|
120
131
|
puts str % ["MARKET_MAD", market['MARKET_MAD']]
|
121
132
|
puts
|
@@ -124,7 +124,8 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|
124
124
|
:name => 'weekly',
|
125
125
|
:large => '--weekly days',
|
126
126
|
:description => 'Repeats the schedule action the days of the week ' \
|
127
|
-
'specified, it can be a number between 0
|
127
|
+
'specified, it can be a number between 0 (Sunday) to 6 (Saturday) ' \
|
128
|
+
'separated with commas. ' \
|
128
129
|
'For example: onevm resume 0 --schedule "09/23 14:15" --weekly 0,2,4',
|
129
130
|
:format => String
|
130
131
|
}
|
@@ -133,8 +134,8 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|
133
134
|
:name => 'monthly',
|
134
135
|
:large => '--monthly days',
|
135
136
|
:description => 'Repeats the schedule action the days of the month ' \
|
136
|
-
'specified, it can be a number between
|
137
|
-
'For example: onevm resume 0 --schedule "09/23 14:15" --monthly
|
137
|
+
'specified, it can be a number between 1,31 separated with commas. ' \
|
138
|
+
'For example: onevm resume 0 --schedule "09/23 14:15" --monthly 1,14',
|
138
139
|
:format => String
|
139
140
|
}
|
140
141
|
|
@@ -142,7 +143,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|
142
143
|
:name => 'yearly',
|
143
144
|
:large => '--yearly days',
|
144
145
|
:description => 'Repeats the schedule action the days of the year ' \
|
145
|
-
'specified, it can be a number between 0,365 separated with commas.' \
|
146
|
+
'specified, it can be a number between 0,365 separated with commas. ' \
|
146
147
|
'For example: onevm resume 0 --schedule "09/23 14:15" --yearly 30,60',
|
147
148
|
:format => String
|
148
149
|
}
|
@@ -151,7 +152,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|
151
152
|
:name => 'hourly',
|
152
153
|
:large => '--hourly hour',
|
153
154
|
:description => 'Repeats the schedule action each hours specified,' \
|
154
|
-
'it can be a number between 0,168 separated with commas.' \
|
155
|
+
'it can be a number between 0,168 separated with commas. ' \
|
155
156
|
'For example: onevm resume 0 --schedule "09/23 14:15" --hourly 1,5',
|
156
157
|
:format => Numeric
|
157
158
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- The information sent to the hook when $API is used in an API Hook
|
2
|
+
<!-- The information sent to the hook when $API is used in an API Hook follow the following schema -->
|
3
3
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
|
4
4
|
<xs:element name="CALL_INFO">
|
5
5
|
<xs:complexType>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<xs:complexType>
|
14
14
|
<xs:sequence>
|
15
15
|
<xs:element name="POSITION" type="xs:integer"/>
|
16
|
-
<xs:element name="TYPE" type="xs:
|
16
|
+
<xs:element name="TYPE" type="xs:string">
|
17
17
|
<xs:simpleType>
|
18
18
|
<xs:restriction base="xs:string">
|
19
19
|
<xs:enumeration value="IN"/>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<xs:sequence>
|
7
7
|
<xs:element name="HOOK_TYPE" type="xs:string" fixed="API"/>
|
8
8
|
<xs:element name="CALL" type="xs:string"/>
|
9
|
-
<!-- CALL_INFO type is defined in
|
9
|
+
<!-- CALL_INFO type is defined in api_info.xsd -->
|
10
10
|
<xs:element ref="CALL_INFO" maxOccurs="unbounded" minOccurs="0"/>
|
11
11
|
</xs:sequence>
|
12
12
|
</xs:complexType>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<xs:element name="STATE" type="xs:string"/>
|
17
17
|
<xs:element name="LCM_STATE" type="xs:string" maxOccurs="1" minOccurs="0"/>
|
18
18
|
<xs:element name="REMOTE_HOST" type="xs:string" maxOccurs="1" minOccurs="0"/>
|
19
|
-
<!-- The template of the resource (VM or Host) is
|
19
|
+
<!-- The template of the resource (VM or Host) is included here -->
|
20
20
|
<xs:element ref="HOST" maxOccurs="1" minOccurs="0"/>
|
21
21
|
<xs:element ref="VM" maxOccurs="1" minOccurs="0"/>
|
22
22
|
</xs:sequence>
|
@@ -10,6 +10,7 @@
|
|
10
10
|
<xs:element name="UNAME" type="xs:string"/>
|
11
11
|
<xs:element name="GNAME" type="xs:string"/>
|
12
12
|
<xs:element name="NAME" type="xs:string"/>
|
13
|
+
<xs:element name="STATE" type="xs:integer"/>
|
13
14
|
<xs:element name="MARKET_MAD" type="xs:string"/>
|
14
15
|
<xs:element name="ZONE_ID" type="xs:string"/>
|
15
16
|
<xs:element name="TOTAL_MB" type="xs:integer"/>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
3
3
|
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
4
4
|
<xs:element name="ZONE_POOL">
|
5
|
-
<xs:element name="ZONE">
|
5
|
+
<xs:element name="ZONE" minOccurs="1" maxOccurs="unbounded">
|
6
6
|
<xs:complexType>
|
7
7
|
<xs:sequence>
|
8
8
|
<xs:element name="ID" type="xs:integer"/>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opennebula
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.
|
19
|
+
version: 6.0.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.0.
|
26
|
+
version: 6.0.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +45,7 @@ executables:
|
|
45
45
|
- oneacl
|
46
46
|
- onecluster
|
47
47
|
- onedatastore
|
48
|
+
- oneflow
|
48
49
|
- oneflow-template
|
49
50
|
- onegroup
|
50
51
|
- onehook
|
@@ -58,12 +59,11 @@ executables:
|
|
58
59
|
- oneuser
|
59
60
|
- onevcenter
|
60
61
|
- onevdc
|
61
|
-
- onevm
|
62
62
|
- onevmgroup
|
63
63
|
- onevnet
|
64
64
|
- onevntemplate
|
65
65
|
- onevrouter
|
66
|
-
-
|
66
|
+
- onevm
|
67
67
|
- onezone
|
68
68
|
extensions: []
|
69
69
|
extra_rdoc_files: []
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- share/schemas/xsd/marketplace_pool.xsd
|
94
94
|
- share/schemas/xsd/marketplaceapp.xsd
|
95
95
|
- share/schemas/xsd/marketplaceapp_pool.xsd
|
96
|
-
- share/schemas/xsd/monitoring_data.xsd
|
97
96
|
- share/schemas/xsd/opennebula_configuration.xsd
|
98
97
|
- share/schemas/xsd/raftstatus.xsd
|
99
98
|
- share/schemas/xsd/security_group.xsd
|
@@ -103,10 +102,8 @@ files:
|
|
103
102
|
- share/schemas/xsd/user_pool.xsd
|
104
103
|
- share/schemas/xsd/vdc.xsd
|
105
104
|
- share/schemas/xsd/vdc_pool.xsd
|
106
|
-
- share/schemas/xsd/vm.xsd
|
107
105
|
- share/schemas/xsd/vm_group.xsd
|
108
106
|
- share/schemas/xsd/vm_group_pool.xsd
|
109
|
-
- share/schemas/xsd/vm_pool.xsd
|
110
107
|
- share/schemas/xsd/vmtemplate.xsd
|
111
108
|
- share/schemas/xsd/vmtemplate_pool.xsd
|
112
109
|
- share/schemas/xsd/vnet.xsd
|
@@ -115,12 +112,16 @@ files:
|
|
115
112
|
- share/schemas/xsd/vntemplate_pool.xsd
|
116
113
|
- share/schemas/xsd/vrouter.xsd
|
117
114
|
- share/schemas/xsd/vrouter_pool.xsd
|
115
|
+
- share/schemas/xsd/monitoring_data.xsd
|
116
|
+
- share/schemas/xsd/vm.xsd
|
117
|
+
- share/schemas/xsd/vm_pool.xsd
|
118
118
|
- share/schemas/xsd/zone.xsd
|
119
119
|
- share/schemas/xsd/zone_pool.xsd
|
120
120
|
- bin/oneacct
|
121
121
|
- bin/oneacl
|
122
122
|
- bin/onecluster
|
123
123
|
- bin/onedatastore
|
124
|
+
- bin/oneflow
|
124
125
|
- bin/oneflow-template
|
125
126
|
- bin/onegroup
|
126
127
|
- bin/onehook
|
@@ -134,12 +135,11 @@ files:
|
|
134
135
|
- bin/oneuser
|
135
136
|
- bin/onevcenter
|
136
137
|
- bin/onevdc
|
137
|
-
- bin/onevm
|
138
138
|
- bin/onevmgroup
|
139
139
|
- bin/onevnet
|
140
140
|
- bin/onevntemplate
|
141
141
|
- bin/onevrouter
|
142
|
-
- bin/
|
142
|
+
- bin/onevm
|
143
143
|
- bin/onezone
|
144
144
|
- lib/cli_helper.rb
|
145
145
|
- lib/command_parser.rb
|
@@ -162,11 +162,11 @@ files:
|
|
162
162
|
- lib/one_helper/oneuser_helper.rb
|
163
163
|
- lib/one_helper/onevcenter_helper.rb
|
164
164
|
- lib/one_helper/onevdc_helper.rb
|
165
|
-
- lib/one_helper/onevm_helper.rb
|
166
165
|
- lib/one_helper/onevmgroup_helper.rb
|
167
166
|
- lib/one_helper/onevnet_helper.rb
|
168
167
|
- lib/one_helper/onevntemplate_helper.rb
|
169
168
|
- lib/one_helper/onevrouter_helper.rb
|
169
|
+
- lib/one_helper/onevm_helper.rb
|
170
170
|
- lib/one_helper/onezone_helper.rb
|
171
171
|
- NOTICE
|
172
172
|
- LICENSE
|