solusvm 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,6 +60,7 @@ Command Line Usage
60
60
  server-changeplan <vserverid> <newplan>
61
61
  server-resume <vserverid>
62
62
  server-reboot <vserverid>
63
+ server-rebuild <vserverid> -t myimage
63
64
  server-status <vserverid>
64
65
  server-boot <vserverid>
65
66
  server-create <hostname> <password> -t myimage -k xen -p myplan -i 1
@@ -100,6 +101,7 @@ Contributors
100
101
  * [Justin Mazzi](http://github.com/jmazzi)
101
102
  * [Maran H.](http://github.com/maran)
102
103
  * [Joshua Priddle](http://github.com/itspriddle)
104
+ * [Vince Stratful](http://github.com/Vincepbell)
103
105
 
104
106
  Note on Patches/Pull Requests
105
107
  -----------------------------
@@ -20,9 +20,9 @@ $shell_methods['server-addip'] = "<vserverid>"
20
20
  $shell_methods['server-changeplan'] = "<vserverid> <newplan>"
21
21
  $shell_methods['server-check-exists'] = "<vserverid>"
22
22
  $shell_methods['server-terminate'] = "<vserverid>"
23
-
24
23
  $shell_methods['node-stats'] = "<nodeid>"
25
24
  $shell_methods['node-available-ips'] = "<nodeid>"
25
+ $shell_methods['server-rebuild'] = "<vserverid> -t myimage"
26
26
 
27
27
  def list_commands
28
28
  puts "Commands:"
@@ -137,6 +137,8 @@ else
137
137
  stats.each do |k,v|
138
138
  puts "#{k} => #{v}"
139
139
  end
140
+ when 'server-rebuild'
141
+ p server.rebuild(ARGV[0], opts[:template])
140
142
  end
141
143
  rescue Exception => e
142
144
  puts "Error: #{e}\n\n"
@@ -8,7 +8,7 @@ module Solusvm
8
8
  class << self
9
9
  attr_accessor :api_endpoint, :api_id, :api_key, :api_options
10
10
 
11
- # Sepcifies the login and url for making requests
11
+ # Specifies the login and url for making requests
12
12
  #
13
13
  # example:
14
14
  #
@@ -66,5 +66,10 @@ module Solusvm
66
66
  perform_request(:action => 'vserver-infoall', :vserverid => vid)
67
67
  returned_parameters
68
68
  end
69
+
70
+ def rebuild(vid, template)
71
+ perform_request(:action => 'vserver-rebuild', :vserverid => vid, :template => template)
72
+ returned_parameters
73
+ end
69
74
  end
70
- end
75
+ end
@@ -1,3 +1,3 @@
1
1
  module Solusvm
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -23,6 +23,5 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_development_dependency 'redgreen'
25
25
  s.add_development_dependency 'fakeweb'
26
- s.add_development_dependency 'turn'
27
26
  s.add_development_dependency 'rake', '~> 0.8.7'
28
27
  end
@@ -0,0 +1,2 @@
1
+ <status>success</status>
2
+ <statusmsg>Virtual server is being rebuilt</statusmsg>
@@ -2,7 +2,7 @@ require 'test/unit'
2
2
 
3
3
  # Use TURN if available
4
4
  begin
5
- require 'turn'
5
+ require 'turn' if ENV['TURN']
6
6
  rescue LoadError
7
7
  end
8
8
 
@@ -30,6 +30,12 @@ class TestServer < Test::Unit::TestCase
30
30
  assert ! @server.successful?
31
31
  end
32
32
 
33
+ def test_rebuild
34
+ FakeWeb.register_uri(:get, "#{base_uri}&action=vserver-rebuild&vserverid=1&template=mytpl", :body => load_response('server_rebuild_success'))
35
+ assert @server.rebuild(1, "mytpl")
36
+ assert_equal 'Virtual server is being rebuilt', @server.statusmsg
37
+ end
38
+
33
39
  def test_boot
34
40
  FakeWeb.register_uri(:get, "#{base_uri}&action=vserver-boot&vserverid=1", :body => load_response('server_boot_success'))
35
41
  assert @server.boot(1)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solusvm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 8
9
- - 1
10
- version: 0.8.1
8
+ - 9
9
+ - 0
10
+ version: 0.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Mazzi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-09 00:00:00 -04:00
18
+ date: 2011-11-17 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -62,20 +62,6 @@ dependencies:
62
62
  type: :development
63
63
  - !ruby/object:Gem::Dependency
64
64
  requirement: &id004 !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
73
- version_requirements: *id004
74
- name: turn
75
- prerelease: false
76
- type: :development
77
- - !ruby/object:Gem::Dependency
78
- requirement: &id005 !ruby/object:Gem::Requirement
79
65
  none: false
80
66
  requirements:
81
67
  - - ~>
@@ -86,7 +72,7 @@ dependencies:
86
72
  - 8
87
73
  - 7
88
74
  version: 0.8.7
89
- version_requirements: *id005
75
+ version_requirements: *id004
90
76
  name: rake
91
77
  prerelease: false
92
78
  type: :development
@@ -142,6 +128,7 @@ files:
142
128
  - test/fixtures/server_info_success.txt
143
129
  - test/fixtures/server_infoall_success.txt
144
130
  - test/fixtures/server_reboot_success.txt
131
+ - test/fixtures/server_rebuild_success.txt
145
132
  - test/fixtures/server_resume_success.txt
146
133
  - test/fixtures/server_shutdown_success.txt
147
134
  - test/fixtures/server_suspend_success.txt
@@ -211,6 +198,7 @@ test_files:
211
198
  - test/fixtures/server_info_success.txt
212
199
  - test/fixtures/server_infoall_success.txt
213
200
  - test/fixtures/server_reboot_success.txt
201
+ - test/fixtures/server_rebuild_success.txt
214
202
  - test/fixtures/server_resume_success.txt
215
203
  - test/fixtures/server_shutdown_success.txt
216
204
  - test/fixtures/server_suspend_success.txt