opennebula-cli 6.6.1 → 6.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37f8dd6d06bf545de5c8bcf9d9e8197856b452034d22554ed16e3229ecefbec2
4
- data.tar.gz: 2ad8583c107fc4ee73cab873c87f1a8ff6e8973f6bf1b230fda8ac09890f0f1b
3
+ metadata.gz: 7e74dc25cf00cc6c901701dcfef74bb0d5f34145ca4ce12d3a2aae23f4f0ce83
4
+ data.tar.gz: fabdc4659737fb9adc7219d04b0057034ad04503f1c28e68912c748f02405952
5
5
  SHA512:
6
- metadata.gz: e1faa197784299af5b92897d19ea3defef548567c0106bec432cd37e7cd8487be6c1d00efcc886283a3387ffc9d77ad528f62e09ea63ba99a8cc2a9b14f30f6f
7
- data.tar.gz: 6c34366bfa1e4917ad1f930915bc229b1fae6af303ad7a1c050977dadac9b991cc0b2f8016ec67c23fd7122e7bf8cd471aa17a00b1e205332a81bc2b39d343a7
6
+ metadata.gz: a2cd0831f008fb2b52ea545c2d1615a8cc0e31e376199e6b52dab49553b1677e6628dbafd0fde22544562d4c8bea00572ce1b20e353dc45e096e5f721d5a35c9
7
+ data.tar.gz: 10d16e841304506cb3978fd67d8349e7f7684bbe70fc2f7351a2fcc1129f41af9a626a8580099f24415d879d280b1e085ce7b29ff523e35b13e6c04d66e0a71d
data/bin/oneacl CHANGED
@@ -113,7 +113,7 @@ CommandParser::CmdParser.new(ARGV) do
113
113
  end
114
114
 
115
115
  list_desc = <<-EOT.unindent
116
- Lists the ACL rule set
116
+ Lists the ACL rule set. #{OneAclHelper.list_layout_help}
117
117
  EOT
118
118
 
119
119
  command :list, list_desc, :options => [CLIHelper::OPTIONS,
data/bin/onecluster CHANGED
@@ -121,7 +121,7 @@ CommandParser::CmdParser.new(ARGV) do
121
121
  end
122
122
 
123
123
  list_desc = <<-EOT.unindent
124
- Lists Clusters in the pool
124
+ Lists Clusters in the pool. #{OneClusterHelper.list_layout_help}
125
125
  EOT
126
126
 
127
127
  command :list, list_desc, :options => list_options do
data/bin/onedatastore CHANGED
@@ -163,7 +163,7 @@ CommandParser::CmdParser.new(ARGV) do
163
163
  end
164
164
 
165
165
  list_desc = <<-EOT.unindent
166
- Lists Datastores in the pool
166
+ Lists Datastores in the pool. #{OneDatastoreHelper.list_layout_help}
167
167
  EOT
168
168
 
169
169
  command :list, list_desc, :options => list_options do
data/bin/oneflow-template CHANGED
@@ -61,6 +61,7 @@ require 'command_parser'
61
61
  require 'opennebula/oneflow_client'
62
62
  require 'cli_helper'
63
63
  require 'one_helper/oneflowtemplate_helper'
64
+ require 'one_helper/onetemplate_helper'
64
65
 
65
66
  USER_AGENT = 'CLI'
66
67
 
@@ -78,7 +79,7 @@ CommandParser::CmdParser.new(ARGV) do
78
79
 
79
80
  RECURSIVE = {
80
81
  :name => 'recursive',
81
- :short => '-r',
82
+ :short => '-R',
82
83
  :large => '--recursive',
83
84
  :description => 'Clone the template recursively (templates and images)'
84
85
  }
@@ -253,14 +254,18 @@ CommandParser::CmdParser.new(ARGV) do
253
254
  break
254
255
  end
255
256
 
257
+ params['merge_template'] = {}
256
258
  body = JSON.parse(response.body)['DOCUMENT']['TEMPLATE']['BODY']
257
259
 
258
- params['merge_template'] = helper.custom_attrs(
259
- body['custom_attrs']
260
- )
260
+ # Check global custom attributes
261
+ custom_attrs = helper.custom_attrs(body['custom_attrs'])
262
+ params['merge_template'].merge!(custom_attrs) unless custom_attrs.nil?
261
263
 
262
- params['merge_template'] = {} unless params['merge_template']
264
+ # Check role level custom attributes
265
+ custom_role_attrs = helper.custom_role_attrs(body['roles'])
266
+ params['merge_template'].merge!(custom_role_attrs) unless custom_role_attrs.nil?
263
267
 
268
+ # Check vnets attributes
264
269
  vnets = helper.networks(body['networks'])
265
270
  params['merge_template'].merge!(vnets) unless vnets.nil?
266
271
  end
data/bin/onegroup CHANGED
@@ -168,7 +168,7 @@ CommandParser::CmdParser.new(ARGV) do
168
168
  end
169
169
 
170
170
  list_desc = <<-EOT.unindent
171
- Lists Groups in the pool
171
+ Lists Groups in the pool. #{OneGroupHelper.list_layout_help}
172
172
  EOT
173
173
 
174
174
  command :list, list_desc, :options => list_options do
data/bin/onehook CHANGED
@@ -229,7 +229,7 @@ CommandParser::CmdParser.new(ARGV) do
229
229
  end
230
230
 
231
231
  list_desc = <<-EOT.unindent
232
- Lists Hooks in the pool
232
+ Lists Hooks in the pool. #{OneHookHelper.list_layout_help}
233
233
  EOT
234
234
 
235
235
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onehost CHANGED
@@ -297,7 +297,7 @@ CommandParser::CmdParser.new(ARGV) do
297
297
  end
298
298
 
299
299
  list_desc = <<-EOT.unindent
300
- Lists Hosts in the pool
300
+ Lists Hosts in the pool. #{OneHostHelper.list_layout_help}
301
301
  EOT
302
302
 
303
303
  command :list, list_desc,
data/bin/oneimage CHANGED
@@ -478,7 +478,7 @@ CommandParser::CmdParser.new(ARGV) do
478
478
  end
479
479
 
480
480
  list_desc = <<-EOT.unindent
481
- Lists Images in the pool
481
+ Lists Images in the pool. #{OneImageHelper.list_layout_help}
482
482
  EOT
483
483
 
484
484
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onemarket CHANGED
@@ -156,7 +156,7 @@ CommandParser::CmdParser.new(ARGV) do
156
156
  end
157
157
 
158
158
  list_desc = <<-EOT.unindent
159
- Lists Marketplaces
159
+ Lists Marketplaces. #{OneMarketPlaceHelper.list_layout_help}
160
160
  EOT
161
161
 
162
162
  command :list, list_desc, :options => list_options do
data/bin/onemarketapp CHANGED
@@ -403,7 +403,7 @@ CommandParser::CmdParser.new(ARGV) do
403
403
  end
404
404
 
405
405
  list_desc = <<-EOT.unindent
406
- Lists marketplace apps
406
+ Lists marketplace apps. #{OneMarketPlaceAppHelper.list_layout_help}
407
407
  EOT
408
408
 
409
409
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onesecgroup CHANGED
@@ -224,7 +224,7 @@ CommandParser::CmdParser.new(ARGV) do
224
224
  end
225
225
 
226
226
  list_desc = <<-EOT.unindent
227
- Lists Security Group in the pool
227
+ Lists Security Group in the pool. #{OneSecurityGroupHelper.list_layout_help}
228
228
  EOT
229
229
 
230
230
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onetemplate CHANGED
@@ -404,7 +404,7 @@ CommandParser::CmdParser.new(ARGV) do
404
404
  end
405
405
 
406
406
  list_desc = <<-EOT.unindent
407
- Lists Templates in the pool
407
+ Lists Templates in the pool. #{OneTemplateHelper.list_layout_help}
408
408
  EOT
409
409
 
410
410
  rename_desc = <<-EOT.unindent
data/bin/oneuser CHANGED
@@ -562,7 +562,7 @@ CommandParser::CmdParser.new(ARGV) do
562
562
  end
563
563
 
564
564
  list_desc = <<-EOT.unindent
565
- Lists Users in the pool
565
+ Lists Users in the pool. #{OneUserHelper.list_layout_help}
566
566
  EOT
567
567
 
568
568
  command :list, list_desc, :options => list_options do
data/bin/onevdc CHANGED
@@ -300,7 +300,7 @@ CommandParser::CmdParser.new(ARGV) do
300
300
  end
301
301
 
302
302
  list_desc = <<-EOT.unindent
303
- Lists VDCs in the pool
303
+ Lists VDCs in the pool. #{OneVdcHelper.list_layout_help}
304
304
  EOT
305
305
 
306
306
  command :list, list_desc, :options => list_options do
data/bin/onevm CHANGED
@@ -1278,7 +1278,7 @@ CommandParser::CmdParser.new(ARGV) do
1278
1278
  end
1279
1279
 
1280
1280
  list_desc = <<-EOT.unindent
1281
- Lists VMs in the pool
1281
+ Lists VMs in the pool. #{OneVMHelper.list_layout_help}
1282
1282
  EOT
1283
1283
 
1284
1284
  command :list, list_desc, [:filterflag, nil],
@@ -1485,11 +1485,11 @@ CommandParser::CmdParser.new(ARGV) do
1485
1485
  create_chart_desc = <<-EOT.unindent
1486
1486
  Adds a charter to the VM, these are some consecutive scheduled actions
1487
1487
 
1488
- You can configure the actions in /etc/one/cli/onevm.yaml
1488
+ You can configure the actions in #{OneVMHelper.conf_file}
1489
1489
  EOT
1490
1490
 
1491
1491
  command :'create-chart', create_chart_desc, :vmid do
1492
- charters = helper.get_charters
1492
+ charters = helper.charters
1493
1493
 
1494
1494
  if charters.nil?
1495
1495
  STDERR.puts 'No charters found on configuration file'
@@ -1512,10 +1512,7 @@ CommandParser::CmdParser.new(ARGV) do
1512
1512
  action.to_s,
1513
1513
  time[:warning][:time] + acc_w)
1514
1514
 
1515
- if OpenNebula.is_error?(rc)
1516
- STDERR.puts rc.message
1517
- exit(-1)
1518
- end
1515
+ exit(-1) if rc < 0
1519
1516
 
1520
1517
  acc_t += time[:time].to_i
1521
1518
  acc_w += time[:warning][:time].to_i
@@ -1578,7 +1575,7 @@ CommandParser::CmdParser.new(ARGV) do
1578
1575
  reset = options[:reset] == true
1579
1576
 
1580
1577
  if !options[:schedule].nil?
1581
- options[:args] = options[:datastore]
1578
+ options[:args] = "#{options[:datastore]},#{reset ? 1 : 0}"
1582
1579
 
1583
1580
  helper.schedule_actions([args[0]], options, @comm_name)
1584
1581
  else
@@ -1594,6 +1591,25 @@ CommandParser::CmdParser.new(ARGV) do
1594
1591
  end
1595
1592
  end
1596
1593
 
1594
+ backup_cancel_desc = <<-EOT.unindent
1595
+ Cancels an active VM backup operation
1596
+
1597
+ States: RUNNING, POWEROFF
1598
+ EOT
1599
+
1600
+ command :'backup-cancel',
1601
+ backup_cancel_desc,
1602
+ :vmid do
1603
+ helper.perform_action(args[0], options, 'Canceling backup') do |vm|
1604
+ rc = vm.backup_cancel
1605
+
1606
+ if OpenNebula.is_error?(rc)
1607
+ STDERR.puts "Error canceling VM backup: #{rc.message}"
1608
+ exit(-1)
1609
+ end
1610
+ end
1611
+ end
1612
+
1597
1613
  ssh_desc = <<-EOT.unindent
1598
1614
  SSH into VM
1599
1615
 
data/bin/onevmgroup CHANGED
@@ -151,7 +151,7 @@ CommandParser::CmdParser.new(ARGV) do
151
151
  end
152
152
 
153
153
  list_desc = <<-EOT.unindent
154
- Lists VM Group in the pool
154
+ Lists VM Group in the pool. #{OneVMGroupHelper.list_layout_help}
155
155
  EOT
156
156
 
157
157
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onevnet CHANGED
@@ -347,7 +347,7 @@ CommandParser::CmdParser.new(ARGV) do
347
347
  end
348
348
 
349
349
  list_desc = <<-EOT.unindent
350
- Lists Virtual Networks in the pool
350
+ Lists Virtual Networks in the pool. #{OneVNetHelper.list_layout_help}
351
351
  EOT
352
352
 
353
353
  command :list, list_desc, [:filterflag, nil],
data/bin/onevntemplate CHANGED
@@ -340,7 +340,7 @@ CommandParser::CmdParser.new(ARGV) do
340
340
  end
341
341
 
342
342
  list_desc = <<-EOT.unindent
343
- Lists VN Templates in the pool
343
+ Lists VN Templates in the pool. #{OneVNTemplateHelper.list_layout_help}
344
344
  EOT
345
345
 
346
346
  rename_desc = <<-EOT.unindent
data/bin/onevrouter CHANGED
@@ -341,7 +341,7 @@ CommandParser::CmdParser.new(ARGV) do
341
341
  end
342
342
 
343
343
  list_desc = <<-EOT.unindent
344
- Lists the Virtual Routers in the pool
344
+ Lists the Virtual Routers in the pool. #{OneVirtualRouterHelper.list_layout_help}
345
345
  EOT
346
346
 
347
347
  command :list, list_desc, [:filterflag, nil], :options => list_options do
data/bin/onezone CHANGED
@@ -211,7 +211,7 @@ CommandParser::CmdParser.new(ARGV) do
211
211
  end
212
212
 
213
213
  list_desc = <<-EOT.unindent
214
- Lists Zones in the pool
214
+ Lists Zones in the pool. #{OneZoneHelper.list_layout_help}
215
215
  EOT
216
216
 
217
217
  command :list, list_desc, :options => list_options do
@@ -193,6 +193,35 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
193
193
  ret
194
194
  end
195
195
 
196
+ # Get custom role attributes values from user
197
+ #
198
+ # @param role [Hash] Service role with custom attributes
199
+ #
200
+ # @return [Hash] Role with custom attributes values
201
+ def custom_role_attrs(roles)
202
+ return if roles.nil? || roles.empty?
203
+
204
+ ret = {}
205
+ role_with_custom_attrs = false
206
+
207
+ roles.each do |role|
208
+ next unless role.key?('custom_attrs')
209
+
210
+ ####################################################################
211
+ # Display Role Information
212
+ ####################################################################
213
+ header = "> Please insert the user inputs for the role \"#{role['name']}\""
214
+ puts header
215
+
216
+ role.merge!(custom_attrs(role['custom_attrs']))
217
+ role_with_custom_attrs = true
218
+ end
219
+
220
+ ret['roles'] = roles if role_with_custom_attrs
221
+
222
+ ret
223
+ end
224
+
196
225
  def networks(vnets)
197
226
  return unless vnets
198
227
 
@@ -53,6 +53,7 @@ EOT
53
53
 
54
54
  RECURSIVE={
55
55
  :name => "recursive",
56
+ :short => "-R",
56
57
  :large => "--recursive",
57
58
  :description => "Applies the action to the template plus any "+
58
59
  "image defined in DISK"