opennebula-cli 6.1.80.pre → 6.1.90.pre

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
  SHA1:
3
- metadata.gz: 2306988d8afeaa179ef65f89fbb07a27746a370b
4
- data.tar.gz: 443a4f8d1aa6fcbfb886c14c2fe3228e3d67bff8
3
+ metadata.gz: a63f6a8df097aa2f01d3d2055ab3ac6ac9d7c760
4
+ data.tar.gz: d80893cb835b7cc47929fbf7df1b4ff57b383e80
5
5
  SHA512:
6
- metadata.gz: c1df610ba16fd464d6429e9ebf26fcecb1872319ff6795cca452917c6258df631b688f59fb8cd416143da7cf40e16c4bdbd73db052f4c2faa9b4da4b011fb920
7
- data.tar.gz: 8bfc858b932ec71fdc86e6bef789957d55401190bc780f90c1630b6808651cbdd2a02dc970bf79f2bf17d406422268804ff1954be9ae46a0087bb88d28fc518d
6
+ metadata.gz: fa4b67191d1c4eac4018a357bd79789fae7ae70acfbdecd892b62b19f353e83f1f1854a1a8e56a1e1a6b84d65b84b806a6419a49cfb15ff6572bcb8e4619d47a
7
+ data.tar.gz: 45aa93131d687f5473d18514828630eafa933668877e4563aa560e7a3fda6d74ee18cd6b93270a02bf390c8d1fd5b342d388491983829dbfe291b73ffdfadb0c
data/bin/oneflow CHANGED
@@ -82,6 +82,12 @@ CommandParser::CmdParser.new(ARGV) do
82
82
  :description => 'Force flow necover delete'
83
83
  }
84
84
 
85
+ APPEND = {
86
+ :name => 'append',
87
+ :large => '--append',
88
+ :description => 'Append template to the current one'
89
+ }
90
+
85
91
  FORMAT = [OpenNebulaHelper::JSON, OpenNebulaHelper::YAML]
86
92
 
87
93
  # create helper object
@@ -364,7 +370,11 @@ CommandParser::CmdParser.new(ARGV) do
364
370
  be launched to modify the current content.
365
371
  EOT
366
372
 
367
- command :update, update_desc, :service_id, [:file, nil] do
373
+ command :update,
374
+ update_desc,
375
+ :service_id,
376
+ [:file, nil],
377
+ :options => APPEND do
368
378
  service_id = args[0]
369
379
  client = helper.client(options)
370
380
 
@@ -382,8 +392,10 @@ CommandParser::CmdParser.new(ARGV) do
382
392
  tmp = Tempfile.new(service_id.to_s)
383
393
  path = tmp.path
384
394
 
385
- tmp.write(JSON.pretty_generate(template))
386
- tmp.flush
395
+ unless options[:append]
396
+ tmp.write(JSON.pretty_generate(template))
397
+ tmp.flush
398
+ end
387
399
 
388
400
  if ENV['EDITOR']
389
401
  editor_path = ENV['EDITOR']
@@ -402,7 +414,17 @@ CommandParser::CmdParser.new(ARGV) do
402
414
  end
403
415
  end
404
416
 
405
- response = client.put("#{RESOURCE_PATH}/#{service_id}", File.read(path))
417
+ if options[:append]
418
+ req = {}
419
+ req['append'] = true
420
+ req['template'] = File.read(path)
421
+
422
+ response = client.put("#{RESOURCE_PATH}/#{service_id}",
423
+ req.to_json)
424
+ else
425
+ response = client.put("#{RESOURCE_PATH}/#{service_id}",
426
+ File.read(path))
427
+ end
406
428
 
407
429
  if CloudClient.is_error?(response)
408
430
  [response.code.to_i, response.to_s]
@@ -216,11 +216,15 @@ class AcctHelper < OpenNebulaHelper::OneHelper
216
216
  d["HOURS"]
217
217
  end
218
218
 
219
+ column :RUNNING_HOURS, "Running hours", :size=>7 do |d|
220
+ d["RHOURS"] || '-'
221
+ end
222
+
219
223
  column :COST, "Cost", :size=>15 do |d|
220
224
  d["TOTAL_COST"]
221
225
  end
222
226
 
223
- default :USER_NAME, :GROUP_NAME, :VM_ID, :VM_NAME, :MONTH, :YEAR, :HOURS, :COST
227
+ default :USER_NAME, :GROUP_NAME, :VM_ID, :VM_NAME, :MONTH, :YEAR, :HOURS, :RUNNING_HOURS, :COST
224
228
  end
225
229
 
226
230
  def self.print_start_end_time_header(start_time, end_time)
data/lib/one_helper.rb CHANGED
@@ -616,10 +616,9 @@ EOT
616
616
  page = ""
617
617
 
618
618
  if options[:xml]
619
- pool.each {|e|
620
- elements += 1
621
- page << e.to_xml(true) << "\n"
622
- }
619
+ elements += 1
620
+
621
+ page << pool.to_xml(true)
623
622
  else
624
623
  pname = pool.pool_name
625
624
  ename = pool.element_name
@@ -20,6 +20,7 @@
20
20
  <xs:element name="DISK_COST" type="xs:float"/>
21
21
  <xs:element name="TOTAL_COST" type="xs:float"/>
22
22
  <xs:element name="HOURS" type="xs:float"/>
23
+ <xs:element name="RHOURS" type="xs:float" minOccurs="0" maxOccurs="1"/>
23
24
  </xs:sequence>
24
25
  </xs:complexType>
25
26
  </xs:element>
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.1.80.pre
4
+ version: 6.1.90.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2021-10-21 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.1.80.pre
19
+ version: 6.1.90.pre
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.1.80.pre
26
+ version: 6.1.90.pre
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement