opennebula-cli 5.8.0 → 5.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/oneflow +2 -2
- data/bin/onevm +2 -1
- data/bin/onezone +5 -0
- data/lib/cli_helper.rb +27 -6
- data/lib/one_helper.rb +18 -6
- data/lib/one_helper/oneprovision_helper.rb +2 -2
- data/lib/one_helper/onevm_helper.rb +12 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47059f335807d405140d9dab14153c81801884e2
|
4
|
+
data.tar.gz: 4701f2cf65db8d7d9369651586da00778f31f543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3891e1dd12ce654c048c2504cd994732cce51bdb090d65d6a0277934163209ba59fe99192962ca250bc08ecd8855f1c80eb47aa747c49032dc46e6eff425e72
|
7
|
+
data.tar.gz: 2026f29b2134d32baaef9fe620a2337f467bc8367d927d27be4c694de45f0c15d7ee3c90bc86aea257709b4030cc425a183a005ecbe45bd1388db7d596da732e
|
data/bin/oneflow
CHANGED
@@ -280,12 +280,12 @@ def show_service(client, args, options)
|
|
280
280
|
if !role['elasticity_policies'].nil? &&
|
281
281
|
!role['elasticity_policies'].empty? ||
|
282
282
|
!role['scheduled_policies'].nil? &&
|
283
|
-
!role['scheduled_policies'].
|
283
|
+
!role['scheduled_policies'].empty?
|
284
284
|
puts
|
285
285
|
puts 'ELASTICITY RULES'
|
286
286
|
|
287
287
|
if role['elasticity_policies'] &&
|
288
|
-
!role['elasticity_policies'].
|
288
|
+
!role['elasticity_policies'].empty?
|
289
289
|
puts
|
290
290
|
# puts 'ELASTICITY POLICIES'
|
291
291
|
CLIHelper::ShowTable.new(nil, self) do
|
data/bin/onevm
CHANGED
@@ -1054,7 +1054,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1054
1054
|
table = helper.format_pool(options)
|
1055
1055
|
pool = OpenNebula::VirtualMachinePool.new(OneVMHelper.get_client)
|
1056
1056
|
|
1057
|
-
rc = pool.info_search(:query
|
1057
|
+
rc = pool.info_search(:query => options[:search],
|
1058
|
+
:extended => options[:extended])
|
1058
1059
|
|
1059
1060
|
if !rc.nil?
|
1060
1061
|
puts rc.message
|
data/bin/onezone
CHANGED
@@ -114,6 +114,11 @@ CommandParser::CmdParser.new(ARGV) do
|
|
114
114
|
exit(-1)
|
115
115
|
end
|
116
116
|
|
117
|
+
if !%r{^(http|https):\/\/}.match(options[:server_rpc])
|
118
|
+
puts 'Wrong protocol specified. Only http or https allowed!'
|
119
|
+
exit(-1)
|
120
|
+
end
|
121
|
+
|
117
122
|
template = <<-EOT
|
118
123
|
SERVER = [
|
119
124
|
NAME="#{options[:server_name]}",
|
data/lib/cli_helper.rb
CHANGED
@@ -55,6 +55,14 @@ module CLIHelper
|
|
55
55
|
:description => "Filter data. An array is specified with\n"<<
|
56
56
|
" "*31<<"column=value pairs."
|
57
57
|
}
|
58
|
+
OPERATOR = {
|
59
|
+
:name => "operator",
|
60
|
+
:large => "--operator operator",
|
61
|
+
:format => String,
|
62
|
+
:description => "Logical operator used on filters: AND, OR."<<
|
63
|
+
" Default: AND."
|
64
|
+
}
|
65
|
+
|
58
66
|
#
|
59
67
|
#HEADER = {
|
60
68
|
# :name => "header",
|
@@ -82,7 +90,7 @@ module CLIHelper
|
|
82
90
|
}
|
83
91
|
|
84
92
|
#OPTIONS = [LIST, ORDER, FILTER, HEADER, DELAY]
|
85
|
-
OPTIONS = [LIST, LISTCONF, DELAY, FILTER, CSV_OPT, NO_PAGER]
|
93
|
+
OPTIONS = [LIST, LISTCONF, DELAY, FILTER, OPERATOR, CSV_OPT, NO_PAGER]
|
86
94
|
|
87
95
|
# Sets bold font
|
88
96
|
def CLIHelper.scr_bold
|
@@ -330,7 +338,7 @@ module CLIHelper
|
|
330
338
|
}
|
331
339
|
|
332
340
|
if options
|
333
|
-
filter_data!(res_data, options
|
341
|
+
filter_data!(res_data, options) if options[:filter]
|
334
342
|
sort_data!(res_data, options[:order]) if options[:order]
|
335
343
|
end
|
336
344
|
|
@@ -393,10 +401,16 @@ module CLIHelper
|
|
393
401
|
}.compact.join(' ')
|
394
402
|
end
|
395
403
|
|
396
|
-
def filter_data!(data,
|
404
|
+
def filter_data!(data, options)
|
397
405
|
# TBD: add more operators
|
398
406
|
# operators=/(==|=|!=|<|<=|>|>=)/
|
399
407
|
operators=/(=|!=)/
|
408
|
+
filter = options[:filter]
|
409
|
+
if options.key?(:operator)
|
410
|
+
log_operator = options[:operator].upcase
|
411
|
+
else
|
412
|
+
log_operator = "AND"
|
413
|
+
end
|
400
414
|
|
401
415
|
stems=filter.map do |s|
|
402
416
|
m=s.match(/^(.*?)#{operators}(.*?)$/)
|
@@ -427,12 +441,19 @@ module CLIHelper
|
|
427
441
|
stems.each do |s|
|
428
442
|
|
429
443
|
if d[s[:index]].public_send(s[:operator] == "=" ? "==" : s[:operator], s[:right])
|
430
|
-
|
431
|
-
|
444
|
+
if log_operator == "OR"
|
445
|
+
pass = true
|
446
|
+
break
|
447
|
+
end
|
448
|
+
else
|
449
|
+
pass = false
|
450
|
+
if log_operator == "AND"
|
451
|
+
break
|
452
|
+
end
|
432
453
|
end
|
433
454
|
end
|
434
455
|
|
435
|
-
|
456
|
+
pass
|
436
457
|
end
|
437
458
|
end
|
438
459
|
|
data/lib/one_helper.rb
CHANGED
@@ -391,6 +391,12 @@ EOT
|
|
391
391
|
:description => 'Overwrite the file'
|
392
392
|
}
|
393
393
|
|
394
|
+
EXTENDED={
|
395
|
+
:name => 'extended',
|
396
|
+
:large => '--extended',
|
397
|
+
:description => 'Show info extended (it only works with xml output)'
|
398
|
+
}
|
399
|
+
|
394
400
|
TEMPLATE_OPTIONS_VM = [TEMPLATE_NAME_VM] + TEMPLATE_OPTIONS + [DRY]
|
395
401
|
|
396
402
|
CAPACITY_OPTIONS_VM = [TEMPLATE_OPTIONS[0], TEMPLATE_OPTIONS[1],
|
@@ -399,7 +405,7 @@ EOT
|
|
399
405
|
UPDATECONF_OPTIONS_VM = TEMPLATE_OPTIONS[6..15] + [TEMPLATE_OPTIONS[2],
|
400
406
|
TEMPLATE_OPTIONS[17], TEMPLATE_OPTIONS[18]]
|
401
407
|
|
402
|
-
OPTIONS = XML, NUMERIC, KILOBYTES
|
408
|
+
OPTIONS = XML, EXTENDED, NUMERIC, KILOBYTES
|
403
409
|
|
404
410
|
class OneHelper
|
405
411
|
attr_accessor :client
|
@@ -593,7 +599,7 @@ EOT
|
|
593
599
|
size = $stdout.winsize[0] - 1
|
594
600
|
|
595
601
|
# ----------- First page, check if pager is needed -------------
|
596
|
-
rc = pool.get_page(size, 0)
|
602
|
+
rc = pool.get_page(size, 0, false)
|
597
603
|
ps = ""
|
598
604
|
|
599
605
|
return -1, rc.message if OpenNebula.is_error?(rc)
|
@@ -621,7 +627,7 @@ EOT
|
|
621
627
|
options[:noheader] = true
|
622
628
|
|
623
629
|
loop do
|
624
|
-
rc = pool.get_page(size, current)
|
630
|
+
rc = pool.get_page(size, current, false)
|
625
631
|
|
626
632
|
return -1, rc.message if OpenNebula.is_error?(rc)
|
627
633
|
|
@@ -666,11 +672,13 @@ EOT
|
|
666
672
|
# List pool in XML format, pagination is used in interactive output
|
667
673
|
#-----------------------------------------------------------------------
|
668
674
|
def list_pool_xml(pool, options, filter_flag)
|
675
|
+
extended = options.include?(:extended) && options[:extended]
|
676
|
+
|
669
677
|
if $stdout.isatty
|
670
678
|
size = $stdout.winsize[0] - 1
|
671
679
|
|
672
680
|
# ----------- First page, check if pager is needed -------------
|
673
|
-
rc = pool.get_page(size, 0)
|
681
|
+
rc = pool.get_page(size, 0, extended)
|
674
682
|
ps = ""
|
675
683
|
|
676
684
|
return -1, rc.message if OpenNebula.is_error?(rc)
|
@@ -698,7 +706,7 @@ EOT
|
|
698
706
|
current = size
|
699
707
|
|
700
708
|
loop do
|
701
|
-
rc = pool.get_page(size, current)
|
709
|
+
rc = pool.get_page(size, current, extended)
|
702
710
|
|
703
711
|
return -1, rc.message if OpenNebula.is_error?(rc)
|
704
712
|
|
@@ -717,7 +725,11 @@ EOT
|
|
717
725
|
|
718
726
|
stop_pager(ppid)
|
719
727
|
else
|
720
|
-
|
728
|
+
if pool.pool_name == "VM_POOL" && extended
|
729
|
+
rc = pool.info_all_extended
|
730
|
+
else
|
731
|
+
rc = pool.info
|
732
|
+
end
|
721
733
|
|
722
734
|
return -1, rc.message if OpenNebula.is_error?(rc)
|
723
735
|
|
@@ -93,12 +93,12 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
|
|
93
93
|
provision.configure(force)
|
94
94
|
end
|
95
95
|
|
96
|
-
def delete(provision_id, cleanup)
|
96
|
+
def delete(provision_id, cleanup, timeout)
|
97
97
|
provision = OneProvision::Provision.new(provision_id)
|
98
98
|
|
99
99
|
provision.refresh
|
100
100
|
|
101
|
-
provision.delete(cleanup)
|
101
|
+
provision.delete(cleanup, timeout)
|
102
102
|
end
|
103
103
|
|
104
104
|
#######################################################################
|
@@ -117,32 +117,36 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|
117
117
|
WEEKLY = {
|
118
118
|
:name => "weekly",
|
119
119
|
:large => "--weekly days",
|
120
|
-
:description => "
|
121
|
-
"
|
120
|
+
:description => "Repeats the schedule action the days of the week specified," \
|
121
|
+
"it can be a number between 0,6 separated with commas." \
|
122
|
+
"For example: onevm resume 0 --schedule \"09/23 14:15\" --weekly 0,2,4",
|
122
123
|
:format => String
|
123
124
|
}
|
124
125
|
|
125
126
|
MONTHLY = {
|
126
127
|
:name => "monthly",
|
127
128
|
:large => "--monthly days",
|
128
|
-
:description => "
|
129
|
-
"
|
129
|
+
:description => "Repeats the schedule action the days of the month specified," \
|
130
|
+
"it can be a number between 0,31 separated with commas." \
|
131
|
+
"For example: onevm resume 0 --schedule \"09/23 14:15\" --monthly 0,14",
|
130
132
|
:format => String
|
131
133
|
}
|
132
134
|
|
133
135
|
YEARLY = {
|
134
136
|
:name => "yearly",
|
135
137
|
:large => "--yearly days",
|
136
|
-
:description => "
|
137
|
-
"
|
138
|
+
:description => "Repeats the schedule action the days of the year specified," \
|
139
|
+
"it can be a number between 0,365 separated with commas." \
|
140
|
+
"For example: onevm resume 0 --schedule \"09/23 14:15\" --yearly 30,60",
|
138
141
|
:format => String
|
139
142
|
}
|
140
143
|
|
141
144
|
HOURLY = {
|
142
145
|
:name => "hourly",
|
143
146
|
:large => "--hourly hour",
|
144
|
-
:description => "
|
145
|
-
"
|
147
|
+
:description => "Repeats the schedule action each hours specified," \
|
148
|
+
"it can be a number between 0,168 separated with commas." \
|
149
|
+
"For example: onevm resume 0 --schedule \"09/23 14:15\" --hourly 1,5",
|
146
150
|
:format => Numeric
|
147
151
|
}
|
148
152
|
|
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: 5.8.
|
4
|
+
version: 5.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-07 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: 5.8.
|
19
|
+
version: 5.8.1
|
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: 5.8.
|
26
|
+
version: 5.8.1
|
27
27
|
description: Commands used to talk to OpenNebula
|
28
28
|
email: contact@opennebula.org
|
29
29
|
executables:
|