opennebula-cli 5.8.0 → 5.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe049a40201dabb3ab6af5af5a94dfe86c3bd260
4
- data.tar.gz: 26e453a1dbc3b0501da198b80a481d4fa6c5a99a
3
+ metadata.gz: 47059f335807d405140d9dab14153c81801884e2
4
+ data.tar.gz: 4701f2cf65db8d7d9369651586da00778f31f543
5
5
  SHA512:
6
- metadata.gz: 910e873ea0a7024ef4eaa70c6247b7c09c2a92c2e1e04b726eea74ab1cf5700e0f522c9c84d576f8d97b7c79d5c859e071d2abac46294b9488dda866fbed1a4d
7
- data.tar.gz: bf953b9791f13555de9ee1818f92fb429859c391d510ff1fb614d22dbfc3cbd430c3b2222055770c04441ffd428a49d40eb73bdc9e9a1a19a3bba7ba09dcb2de
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'].emtpty?
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'].emtpty?
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 => options[:search])
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[:filter]) if options[:filter]
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, filter)
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
- pass=false
431
- break
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
- !pass
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
- rc = pool.info
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 => "Schedules this action to be executed after" \
121
- "the given time. For example: onevm resume 0 --schedule \"09/23 14:15\"",
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 => "Schedules this action to be executed after" \
129
- "the given time. For example: onevm resume 0 --schedule \"09/23 14:15\"",
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 => "Schedules this action to be executed after" \
137
- "the given time. For example: onevm resume 0 --schedule \"09/23 14:15\"",
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 => "Schedules this action to be executed after" \
145
- "the given time. For example: onevm resume 0 --schedule \"09/23 14:15\"",
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.0
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-02-26 00:00:00.000000000 Z
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.0
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.0
26
+ version: 5.8.1
27
27
  description: Commands used to talk to OpenNebula
28
28
  email: contact@opennebula.org
29
29
  executables: