opennebula-cli 6.4.1 → 6.4.2

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: 003723be19ffff60bc9f577b306af83be5168c39be3be02913e3536c4b3abec8
4
- data.tar.gz: 2c45d3c203e8efb33e3a446a8b36dc17d538ad528d79f4abe08e17cccf72374b
3
+ metadata.gz: 6e72258e445621b7bb43729bce0ef5f95f4a0debd990f3983bd8845fa19eebc0
4
+ data.tar.gz: 4776aa4b2f7e59f114dee073504b2029f37cbf99ca544be0924af26a3f969a5c
5
5
  SHA512:
6
- metadata.gz: db8fce550c33714a7752f157bf8fb4ee75fb8c5ab30f4d195d3ed248f75e770f6ce96b9f87f4efd086cd051a5f92b711619dc0fd4909c8ee4494a3e67da364e6
7
- data.tar.gz: da31372a0c1b47c0d6d85d27bb840c9a20ae3424306ed1d4580fb7aab1f1b4acbb1d8123dd45d15d9a9f4a65429c7dc66a841d8dfe0bc76dfdaac4f99f1a8244
6
+ metadata.gz: 8293cbaf48c76f3601a0dd2d06b63aa3ff52bbbbb4c2fd510578224a4555cee0b0c9b6fae7486de1bc922d9cbc2a9844a4bac06e8b394ebea1b145dc6bae2718
7
+ data.tar.gz: e42b6fc85a88aa97ca9be7d1f464b048993ca443c9119121cae800018ef1f27a90899e2d0cbcd18e72ac142b7bd8aac2568bcf1997933e42388f7896f96bd289
data/bin/oneflow-template CHANGED
@@ -234,26 +234,26 @@ CommandParser::CmdParser.new(ARGV) do
234
234
  Instantiate a Service Template
235
235
  EOT
236
236
 
237
- command :instantiate,
238
- instantiate_desc,
239
- :templateid,
240
- [:file, nil],
237
+ command :instantiate, instantiate_desc, :templateid, [:file, nil],
241
238
  :options => [MULTIPLE, Service::JSON_FORMAT, Service::TOP] do
242
239
  number = options[:multiple] || 1
243
240
  params = {}
244
241
  rc = 0
242
+ client = helper.client(options)
245
243
 
246
244
  number.times do
247
245
  params['merge_template'] = nil
248
246
  params['merge_template'] = JSON.parse(File.read(args[1])) if args[1]
249
247
 
250
248
  unless params['merge_template']
251
- service_template = OpenNebula::ServiceTemplate
252
- .new_with_id(args[0],
253
- OpenNebula::Client.new)
254
- service_template.info
249
+ response = client.get("#{RESOURCE_PATH}/#{args[0]}")
250
+
251
+ if CloudClient.is_error?(response)
252
+ rc = [response.code.to_i, response.to_s]
253
+ break
254
+ end
255
255
 
256
- body = JSON.parse(service_template['/DOCUMENT/TEMPLATE/BODY'])
256
+ body = JSON.parse(response.body)['DOCUMENT']['TEMPLATE']['BODY']
257
257
 
258
258
  params['merge_template'] = helper.custom_attrs(
259
259
  body['custom_attrs']
@@ -266,7 +266,6 @@ CommandParser::CmdParser.new(ARGV) do
266
266
  end
267
267
 
268
268
  json = Service.build_json_action('instantiate', params)
269
- client = helper.client(options)
270
269
  response = client.post("#{RESOURCE_PATH}/#{args[0]}/action", json)
271
270
 
272
271
  if CloudClient.is_error?(response)
data/bin/onehost CHANGED
@@ -339,7 +339,7 @@ CommandParser::CmdParser.new(ARGV) do
339
339
  rescue StandardError => e
340
340
  STDERR.puts e
341
341
  end
342
- helper.perform_actions(args[0], options, 'flush') do |host|
342
+ helper.perform_actions(args[0], options, 'flushing') do |host|
343
343
  host.flush action
344
344
  end
345
345
  end
data/bin/oneimage CHANGED
@@ -234,7 +234,7 @@ CommandParser::CmdParser.new(ARGV) do
234
234
 
235
235
  command :clone, clone_desc, :imageid, :name,
236
236
  :options => [OneDatastoreHelper::DATASTORE] do
237
- helper.perform_action(args[0], options, 'cloned') do |image|
237
+ helper.perform_action(args[0], options, 'cloning') do |image|
238
238
  ds_id = options[:datastore] || -1 # -1 clones to self
239
239
  res = image.clone(args[1], ds_id)
240
240
 
@@ -252,7 +252,7 @@ CommandParser::CmdParser.new(ARGV) do
252
252
  EOT
253
253
 
254
254
  command :delete, delete_desc, [:range, :imageid_list] do
255
- helper.perform_actions(args[0], options, 'deleted') do |image|
255
+ helper.perform_actions(args[0], options, 'deleting') do |image|
256
256
  image.delete
257
257
  end
258
258
  end
@@ -382,7 +382,7 @@ CommandParser::CmdParser.new(ARGV) do
382
382
  EOT
383
383
 
384
384
  command :'snapshot-delete', snapshot_delete_desc, :imageid, :snapshot_id do
385
- helper.perform_action(args[0], options, 'snapshot deleted') do |o|
385
+ helper.perform_action(args[0], options, 'deleting snapshot') do |o|
386
386
  o.snapshot_delete(args[1].to_i)
387
387
  end
388
388
  end
@@ -392,7 +392,7 @@ CommandParser::CmdParser.new(ARGV) do
392
392
  EOT
393
393
 
394
394
  command :'snapshot-revert', snapshot_revert_desc, :imageid, :snapshot_id do
395
- helper.perform_action(args[0], options, 'image state reverted') do |o|
395
+ helper.perform_action(args[0], options, 'reverting image state') do |o|
396
396
  o.snapshot_revert(args[1].to_i)
397
397
  end
398
398
  end
@@ -405,7 +405,7 @@ CommandParser::CmdParser.new(ARGV) do
405
405
  snapshot_flatten_desc,
406
406
  :imageid,
407
407
  :snapshot_id do
408
- helper.perform_action(args[0], options, 'snapshot flattened') do |o|
408
+ helper.perform_action(args[0], options, 'flattening snapshot') do |o|
409
409
  o.snapshot_flatten(args[1].to_i)
410
410
  end
411
411
  end
data/bin/onelog CHANGED
@@ -21,9 +21,11 @@ ONE_LOCATION = ENV['ONE_LOCATION']
21
21
  if !ONE_LOCATION
22
22
  RUBY_LIB_LOCATION = '/usr/lib/one/ruby'
23
23
  GEMS_LOCATION = '/usr/share/one/gems'
24
+ LOG_LOCATION = '/var/log/one'
24
25
  else
25
26
  RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby'
26
27
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
28
+ LOG_LOCATION = ONE_LOCATION + '/var'
27
29
  end
28
30
 
29
31
  # %%RUBYGEMS_SETUP_BEGIN%%
@@ -114,7 +116,7 @@ CommandParser::CmdParser.new(ARGV) do
114
116
 
115
117
  options[:type].nil? ? f = logs[:log] : f = logs[options[:type].to_sym]
116
118
 
117
- system("#{pager} #{options[:pager_opts]} /var/log/one/#{f}")
119
+ system("#{pager} #{options[:pager_opts]} #{LOG_LOCATION}/#{f}")
118
120
  end
119
121
 
120
122
  vm_desc = <<-EOT.unindent
@@ -127,7 +129,11 @@ CommandParser::CmdParser.new(ARGV) do
127
129
  begin
128
130
  Integer(args[0])
129
131
 
130
- file = "/var/log/one/#{args[0]}.log"
132
+ if !ONE_LOCATION
133
+ file = "#{LOG_LOCATION}/#{args[0]}.log"
134
+ else
135
+ file = "#{LOG_LOCATION}/vms/#{args[0]}/vm.log"
136
+ end
131
137
 
132
138
  unless File.exist?(file)
133
139
  STDERR.puts "No LOG file found for '#{args[0]}' VM"
@@ -154,7 +160,7 @@ CommandParser::CmdParser.new(ARGV) do
154
160
  begin
155
161
  Integer(args[0])
156
162
 
157
- file = "/var/log/one/oneflow/#{args[0]}.log"
163
+ file = "#{LOG_LOCATION}/oneflow/#{args[0]}.log"
158
164
 
159
165
  unless File.exist?(file)
160
166
  STDERR.puts "No LOG file found for '#{args[0]}' service"
data/bin/onemarketapp CHANGED
@@ -284,7 +284,7 @@ CommandParser::CmdParser.new(ARGV) do
284
284
  EOT
285
285
 
286
286
  command :export, export_desc, :appid, :name, :options => EXPORT_OPTIONS do
287
- helper.perform_action(args[0], options, 'exported') do |obj|
287
+ helper.perform_action(args[0], options, 'exporting') do |obj|
288
288
  tag ="tag=#{options[:tag]}" if options[:tag]
289
289
 
290
290
  obj.extend(MarketPlaceAppExt)
@@ -325,7 +325,7 @@ CommandParser::CmdParser.new(ARGV) do
325
325
 
326
326
  command :download, download_desc, :appid, :path,
327
327
  :options => [OpenNebulaHelper::FORCE] do
328
- helper.perform_action(args[0], options, 'downloaded') do
328
+ helper.perform_action(args[0], options, 'downloading') do
329
329
  download_args = [:marketplaceapp, args[0], args[1], options[:force]]
330
330
  OpenNebulaHelper.download_resource_sunstone(*download_args)
331
331
  end
data/bin/onevm CHANGED
@@ -517,7 +517,7 @@ CommandParser::CmdParser.new(ARGV) do
517
517
  if !options[:schedule].nil?
518
518
  helper.schedule_actions(args[0], options, command_name)
519
519
  else
520
- helper.perform_actions(args[0], options, 'terminated') do |vm|
520
+ helper.perform_actions(args[0], options, 'terminating') do |vm|
521
521
  vm.terminate(options[:hard] == true)
522
522
  end
523
523
  end
@@ -833,7 +833,7 @@ CommandParser::CmdParser.new(ARGV) do
833
833
  template << ' ]'
834
834
  end
835
835
 
836
- helper.perform_action(args[0], options, 'Attach disk') do |vm|
836
+ helper.perform_action(args[0], options, 'Attaching disk') do |vm|
837
837
  vm.disk_attach(template)
838
838
  end
839
839
  end
@@ -847,7 +847,7 @@ CommandParser::CmdParser.new(ARGV) do
847
847
  command :"disk-detach", disk_detach_desc, :vmid, :diskid do
848
848
  diskid = args[1].to_i
849
849
 
850
- helper.perform_action(args[0], options, 'Detach disk') do |vm|
850
+ helper.perform_action(args[0], options, 'Detaching disk') do |vm|
851
851
  vm.disk_detach(diskid)
852
852
  end
853
853
  end
@@ -910,7 +910,7 @@ CommandParser::CmdParser.new(ARGV) do
910
910
  end
911
911
  end
912
912
 
913
- helper.perform_action(args[0], options, 'Attach NIC') do |vm|
913
+ helper.perform_action(args[0], options, 'Attaching NIC') do |vm|
914
914
  vm.nic_attach(template)
915
915
  end
916
916
  end
@@ -924,7 +924,7 @@ CommandParser::CmdParser.new(ARGV) do
924
924
  command :"nic-detach", nic_detach_desc, :vmid, :nicid do
925
925
  nicid = args[1].to_i
926
926
 
927
- helper.perform_action(args[0], options, 'Detach NIC') do |vm|
927
+ helper.perform_action(args[0], options, 'Detaching NIC') do |vm|
928
928
  vm.nic_detach(nicid)
929
929
  end
930
930
  end
@@ -939,7 +939,7 @@ CommandParser::CmdParser.new(ARGV) do
939
939
  nic_id = args[1].to_i
940
940
  sg_id = args[2].to_i
941
941
 
942
- helper.perform_action(args[0], options, 'Attach SG') do |vm|
942
+ helper.perform_action(args[0], options, 'Attaching SG') do |vm|
943
943
  vm.sg_attach(nic_id, sg_id)
944
944
  end
945
945
  end
@@ -954,7 +954,7 @@ CommandParser::CmdParser.new(ARGV) do
954
954
  nic_id = args[1].to_i
955
955
  sg_id = args[2].to_i
956
956
 
957
- helper.perform_action(args[0], options, 'Detach SG') do |vm|
957
+ helper.perform_action(args[0], options, 'Detaching SG') do |vm|
958
958
  vm.sg_detach(nic_id, sg_id)
959
959
  end
960
960
  end
@@ -1047,7 +1047,7 @@ CommandParser::CmdParser.new(ARGV) do
1047
1047
 
1048
1048
  helper.schedule_actions(args[0], options, @comm_name)
1049
1049
  else
1050
- helper.perform_actions(args[0], options, 'snapshot created') do |o|
1050
+ helper.perform_actions(args[0], options, 'creating snapshot') do |o|
1051
1051
  o.snapshot_create(args[1])
1052
1052
  end
1053
1053
  end
@@ -1071,7 +1071,7 @@ CommandParser::CmdParser.new(ARGV) do
1071
1071
 
1072
1072
  helper.schedule_actions([args[0]], options, @comm_name)
1073
1073
  else
1074
- helper.perform_action(args[0], options, 'snapshot reverted') do |o|
1074
+ helper.perform_action(args[0], options, 'reverting snapshot') do |o|
1075
1075
  o.snapshot_revert(args[1].to_i)
1076
1076
  end
1077
1077
  end
@@ -1095,7 +1095,7 @@ CommandParser::CmdParser.new(ARGV) do
1095
1095
 
1096
1096
  helper.schedule_actions([args[0]], options, @comm_name)
1097
1097
  else
1098
- helper.perform_action(args[0], options, 'snapshot deleted') do |o|
1098
+ helper.perform_action(args[0], options, 'deleting snapshot') do |o|
1099
1099
  o.snapshot_delete(args[1])
1100
1100
  end
1101
1101
  end
@@ -1123,7 +1123,7 @@ CommandParser::CmdParser.new(ARGV) do
1123
1123
  helper.schedule_actions([args[0]], options, @comm_name)
1124
1124
  else
1125
1125
  helper.perform_action(args[0], options,
1126
- 'disk snapshot created') do |o|
1126
+ 'creating disk snapshot') do |o|
1127
1127
  o.disk_snapshot_create(args[1].to_i, args[2])
1128
1128
  end
1129
1129
  end
@@ -1150,7 +1150,7 @@ CommandParser::CmdParser.new(ARGV) do
1150
1150
  helper.schedule_actions([args[0]], options, @comm_name)
1151
1151
  else
1152
1152
  helper.perform_action(args[0], options,
1153
- 'disk snapshot reverted') do |o|
1153
+ 'reverting disk snapshot') do |o|
1154
1154
  o.disk_snapshot_revert(args[1].to_i, args[2].to_i)
1155
1155
  end
1156
1156
  end
@@ -1177,7 +1177,7 @@ CommandParser::CmdParser.new(ARGV) do
1177
1177
  helper.schedule_actions([args[0]], options, @comm_name)
1178
1178
  else
1179
1179
  helper.perform_action(args[0], options,
1180
- 'disk snapshot deleted') do |o|
1180
+ 'deleting disk snapshot') do |o|
1181
1181
  o.disk_snapshot_delete(args[1].to_i, args[2].to_i)
1182
1182
  end
1183
1183
  end
@@ -1213,7 +1213,7 @@ CommandParser::CmdParser.new(ARGV) do
1213
1213
 
1214
1214
  command :"disk-resize", disk_resize_desc,
1215
1215
  :vmid, :diskid, :size do
1216
- helper.perform_action(args[0], options, 'disk resized') do |o|
1216
+ helper.perform_action(args[0], options, 'resizing disk') do |o|
1217
1217
  o.info
1218
1218
  size = o["/VM/TEMPLATE/DISK[DISK_ID='#{args[1]}']/SIZE"].to_i
1219
1219
 
@@ -1350,7 +1350,7 @@ CommandParser::CmdParser.new(ARGV) do
1350
1350
  FEATURES = ["ACPI", "PAE", "APIC", "LOCALTIME", "HYPERV", "GUEST_AGENT", "IOTHREADS"]
1351
1351
  INPUT = ["TYPE", "BUS"]
1352
1352
  GRAPHICS = ["TYPE", "LISTEN", "PASSWD", "KEYMAP" ]
1353
- RAW = ["DATA", "DATA_VMX", "TYPE"]
1353
+ RAW = ["DATA", "DATA_VMX", "TYPE", "VALIDATE"]
1354
1354
  CPU_MODEL = ["MODEL"]
1355
1355
  CONTEXT (any value, **variable substitution will be made**)
1356
1356
  EOT
data/bin/onevnet CHANGED
@@ -176,7 +176,7 @@ CommandParser::CmdParser.new(ARGV) do
176
176
  EOT
177
177
 
178
178
  command :delete, delete_desc, [:range, :vnetid_list] do
179
- helper.perform_actions(args[0], options, 'deleted') do |vn|
179
+ helper.perform_actions(args[0], options, 'deleting') do |vn|
180
180
  vn.delete
181
181
  end
182
182
  end
@@ -187,7 +187,7 @@ CommandParser::CmdParser.new(ARGV) do
187
187
 
188
188
  command :addar, addar_desc, :vnetid, [:file, nil],
189
189
  :options => STD_OPTIONS + OneVNetHelper::ADDAR_OPTIONS do
190
- helper.perform_action(args[0], options, 'lease added') do |vn|
190
+ helper.perform_action(args[0], options, 'address range added') do |vn|
191
191
  if args[1]
192
192
  ar = File.read(args[1])
193
193
  else
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.4.1
4
+ version: 6.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2022-10-14 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.4.1
19
+ version: 6.4.2
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.4.1
26
+ version: 6.4.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement