profitbricks 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/profitbricks.rb +1 -1
- data/lib/profitbricks/data_center.rb +2 -2
- data/lib/profitbricks/profitbricks.rb +2 -2
- data/lib/profitbricks/server.rb +15 -0
- metadata +2 -2
data/lib/profitbricks.rb
CHANGED
@@ -52,9 +52,9 @@ module Profitbricks
|
|
52
52
|
Server.create(options.merge(:data_center_id => self.id))
|
53
53
|
end
|
54
54
|
|
55
|
-
# Checks if the Data Center
|
55
|
+
# Checks if the Data Center was successfully provisioned
|
56
56
|
#
|
57
|
-
# @return [Boolean] true if the Data Center
|
57
|
+
# @return [Boolean] true if the Data Center was provisioned, false otherwise
|
58
58
|
def provisioned?
|
59
59
|
self.update_state
|
60
60
|
if @provisioning_state == 'AVAILABLE'
|
@@ -16,8 +16,8 @@ module Profitbricks
|
|
16
16
|
HTTPI.log = false
|
17
17
|
|
18
18
|
@client = Savon::Client.new do |wsdl, http|
|
19
|
-
wsdl.endpoint = "https://api.profitbricks.com/1.
|
20
|
-
wsdl.document = "https://api.profitbricks.com/1.
|
19
|
+
wsdl.endpoint = "https://api.profitbricks.com/1.2"
|
20
|
+
wsdl.document = "https://api.profitbricks.com/1.2/wsdl"
|
21
21
|
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' && !ENV['SSL_CERT_DIR']
|
22
22
|
puts "Warning: SSL certificate verification has been disabled"
|
23
23
|
http.auth.ssl.verify_mode = :none
|
data/lib/profitbricks/server.rb
CHANGED
@@ -37,6 +37,21 @@ module Profitbricks
|
|
37
37
|
return true if response.to_hash[:update_server_response][:return]
|
38
38
|
end
|
39
39
|
|
40
|
+
# Checks if the Server is running
|
41
|
+
#
|
42
|
+
# @return [Boolean] true if the Server is running, false otherwise
|
43
|
+
def running?
|
44
|
+
self.reload
|
45
|
+
self.virtual_machine_state == "RUNNING"
|
46
|
+
end
|
47
|
+
|
48
|
+
# Blocks until the Server is running
|
49
|
+
def wait_for_running
|
50
|
+
while !self.running?
|
51
|
+
sleep 1
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
40
55
|
class << self
|
41
56
|
# Creates a Virtual Server within an existing data center. Parameters can be specified to set up a
|
42
57
|
# boot device and connect the server to an existing LAN or the Internet.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profitbricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -227,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
227
227
|
requirements:
|
228
228
|
- - ! '>='
|
229
229
|
- !ruby/object:Gem::Version
|
230
|
-
hash:
|
230
|
+
hash: 1445834941064886589
|
231
231
|
version: '0'
|
232
232
|
segments:
|
233
233
|
- 0
|