ganeti_client 0.0.4 → 0.0.5
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.
- data/README +0 -4
- data/lib/ganeti_client/client.rb +12 -9
- metadata +4 -4
data/README
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
== Todo
|
2
2
|
|
3
3
|
1. Manually test the following methods + fix when bugs found
|
4
|
-
1.3. instance_delete
|
5
|
-
1.8. instance_replace_disks
|
6
|
-
1.9. instance_activate_disks
|
7
4
|
1.16. node_change_role
|
8
5
|
1.17. node_get_storage
|
9
6
|
1.18. node_modify_storage
|
10
|
-
1.19. node_repair_storage
|
11
7
|
2. Add some error handling
|
12
8
|
3. Make some code improvements
|
13
9
|
4. Add better comments
|
data/lib/ganeti_client/client.rb
CHANGED
@@ -167,7 +167,7 @@ module Ganeti
|
|
167
167
|
# dry_run: 0|1 (optional)
|
168
168
|
#
|
169
169
|
# Return:
|
170
|
-
#
|
170
|
+
# job id
|
171
171
|
def instance_delete(name, dry_run = 0)
|
172
172
|
url = get_url("instances/#{name}", {"dry-run" => dry_run})
|
173
173
|
response_body = send_request("DELETE", url)
|
@@ -277,7 +277,7 @@ module Ganeti
|
|
277
277
|
# disks: comma seperated list of disk indexes
|
278
278
|
#
|
279
279
|
# Return:
|
280
|
-
#
|
280
|
+
# job id
|
281
281
|
def instance_replace_disks(name, mode = "replace_auto", iallocator = "", remote_node = "", disks = "")
|
282
282
|
url = get_url("instances/#{name}/replace-disks", {"mode" => mode, "iallocator" => iallocator, "remote_node" => remote_node, "disks" => disks})
|
283
283
|
response_body = send_request("POST", url)
|
@@ -293,8 +293,8 @@ module Ganeti
|
|
293
293
|
# ignore_size: 0|1 (optional)
|
294
294
|
#
|
295
295
|
# Return:
|
296
|
-
#
|
297
|
-
def
|
296
|
+
# job id
|
297
|
+
def instance_activate_disks(name, ignore_size = 0)
|
298
298
|
url = get_url("instances/#{name}/activate-disks", {"ignore_size" => ignore_size})
|
299
299
|
response_body = send_request("PUT", url)
|
300
300
|
|
@@ -307,7 +307,7 @@ module Ganeti
|
|
307
307
|
# name: name of the instance
|
308
308
|
#
|
309
309
|
# Return:
|
310
|
-
#
|
310
|
+
# job id
|
311
311
|
def instance_deactivate_disks(name)
|
312
312
|
url = get_url("instances/#{name}/deactivate-disks")
|
313
313
|
response_body = send_request("PUT", url)
|
@@ -536,8 +536,8 @@ 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", {
|
540
|
-
response_body = send_request("PUT", url
|
539
|
+
url = get_url("nodes/#{name}/role", {role => 1, "force" => force})
|
540
|
+
response_body = send_request("PUT", url)
|
541
541
|
|
542
542
|
return response_body
|
543
543
|
end
|
@@ -567,8 +567,11 @@ module Ganeti
|
|
567
567
|
# Repairs a storage unit on the node. Requires the parameters storage_type (currently only lvm-vg can be repaired) and name (name of the storage unit).
|
568
568
|
#
|
569
569
|
# The result will be a job id
|
570
|
-
|
571
|
-
|
570
|
+
#
|
571
|
+
# Return
|
572
|
+
# job id
|
573
|
+
def node_repair_storage(name, storage_name, storage_type = "lvm-vg")
|
574
|
+
url = get_url("nodes/#{name}/storage/repair",{"storage_type" => storage_type, "name" => storage_name})
|
572
575
|
response_body = send_request("PUT", url)
|
573
576
|
|
574
577
|
return response_body
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Micha\xC3\xABl Rigart"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-18 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|