ganeti_client 0.0.5 → 0.0.6

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.
Files changed (3) hide show
  1. data/README +0 -2
  2. data/lib/ganeti_client/client.rb +9 -6
  3. metadata +3 -3
data/README CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  1. Manually test the following methods + fix when bugs found
4
4
  1.16. node_change_role
5
- 1.17. node_get_storage
6
- 1.18. node_modify_storage
7
5
  2. Add some error handling
8
6
  3. Make some code improvements
9
7
  4. Add better comments
@@ -536,14 +536,17 @@ module Ganeti
536
536
  # offline
537
537
  # regular
538
538
  def node_change_role(name, role, force = 0)
539
- url = get_url("nodes/#{name}/role", {role => 1, "force" => force})
540
- response_body = send_request("PUT", url)
539
+ url = get_url("nodes/#{name}/role", {"role" => role, "force" => force})
540
+ response_body = send_request("PUT", url, body)
541
541
 
542
542
  return response_body
543
543
  end
544
544
 
545
545
  # Manages storage units on the node
546
- # Requests a list of storage units on a node. Requires the parameters storage_type (one of file, lvm-pv or lvm-vg) and output_fields. The result will be a job id, using which the result can be retrieved
546
+ # Requests a list of storage units on a node. Requires the parameters storage_type (one of file, lvm-pv or lvm-vg) and output_fields.
547
+ # The result will be a job id, using which the result can be retrieved
548
+ #
549
+ # Return job id
547
550
  def node_get_storage(name, storage_type = "", output_fields = "")
548
551
  url = get_url("nodes/#{name}/storage", {"storage_type" => storage_type, "output_fields" => output_fields})
549
552
  response_body = send_request("GET", url)
@@ -556,8 +559,8 @@ module Ganeti
556
559
  # Parameters can be passed additionally. Currently only allocatable (bool) is supported.
557
560
  #
558
561
  # The result will be a job id.
559
- def node_modify_storage(name, storage_type, allocatable = 0)
560
- url = get_url("nodes/#{name}/storage/modify", {"storage_type" => storage_type, "allocatable" => allocatable})
562
+ def node_modify_storage(name, storage_unit_name, storage_type, allocatable = 0)
563
+ url = get_url("nodes/#{name}/storage/modify", {"name" => storage_unit_name, "storage_type" => storage_type, "allocatable" => allocatable})
561
564
  response_body = send_request("PUT", url)
562
565
 
563
566
  return response_body
@@ -746,7 +749,7 @@ module Ganeti
746
749
  http.use_ssl = (uri.scheme == "http")? false : true
747
750
 
748
751
  headers = {}
749
- headers = authenticate(self.username, self.password) if method != 'GET'
752
+ headers = authenticate(self.username, self.password)
750
753
 
751
754
  response = http.send_request(method, url, body, headers)
752
755
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ganeti_client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Micha\xC3\xABl Rigart"