profitbricks 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/profitbricks.rb +1 -1
- data/lib/profitbricks/config.rb +3 -1
- data/lib/profitbricks/data_center.rb +7 -3
- data/lib/profitbricks/profitbricks.rb +2 -1
- data/lib/profitbricks/server.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9b9764ad2e524499c1c45274219ad62d1f5642e
|
4
|
+
data.tar.gz: 85fc09ceeb64652682551f1acc3434a4aac4b409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c19e66e08af35556293a30f70d42331778f72403d6680a76eef06c7d96f45ea74e36c3eb5229763de794d551b9f2ab3f6b78e8d7b7d9fc42547ff417f980f4b
|
7
|
+
data.tar.gz: 04c7c861e13c1d9a3c2edb0595b6e4fe8e9ea85eaf4a97dfdffbd2a1727b601daeef28a8242b55b1a84b5eead82cb859fd8b6d4cadc509318198808c8dbddc91
|
data/lib/profitbricks.rb
CHANGED
data/lib/profitbricks/config.rb
CHANGED
@@ -11,6 +11,8 @@ module Profitbricks
|
|
11
11
|
attr_accessor :save_responses
|
12
12
|
# Set to true to enable Savons request/response logging, default: false
|
13
13
|
attr_accessor :log
|
14
|
+
# Set the polling interval in seconds for the Server#wait_for_running and DataCenter#wait_for_provisioning methods, default: 1
|
15
|
+
attr_accessor :polling_interval
|
14
16
|
end
|
15
17
|
end
|
16
|
-
end
|
18
|
+
end
|
@@ -68,7 +68,7 @@ module Profitbricks
|
|
68
68
|
# Blocks until the Data Center is provisioned
|
69
69
|
def wait_for_provisioning
|
70
70
|
while !self.provisioned?
|
71
|
-
sleep
|
71
|
+
sleep Profitbricks::Config.polling_interval
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -87,10 +87,14 @@ module Profitbricks
|
|
87
87
|
# Creates and saves a new, empty Virtual Data Center.
|
88
88
|
#
|
89
89
|
# @param [Hash] options
|
90
|
-
# @option options [String] :name
|
90
|
+
# @option options [String] :name Name of the Virtual Data Center (can not start with or contain (@, /, \\, |, ", '))
|
91
|
+
# @option options [String] :region Select region to create the data center (NORTH_AMERICA, EUROPE, DEFAULT). If DEFAULT or empty, the Virtual Data Center will be created in the default region of the user
|
91
92
|
# @return [DataCenter] The newly created Virtual Data Center
|
92
93
|
def create(options)
|
93
|
-
|
94
|
+
raise ArgumentError.new(":region has to be one of 'DEFAULT', 'NORTH_AMERICA', or 'EUROPE'") if options[:region] and !['DEFAULT', 'EUROPE', 'NORTH_AMERICA'].include? options[:region]
|
95
|
+
xml = "<dataCenterName>#{options[:name]}</dataCenterName>"
|
96
|
+
xml += get_xml_and_update_attributes options, [:region]
|
97
|
+
response = Profitbricks.request :create_data_center, xml
|
94
98
|
self.find(:id => response.to_hash[:create_data_center_response][:return][:data_center_id] )
|
95
99
|
end
|
96
100
|
|
@@ -6,6 +6,7 @@ module Profitbricks
|
|
6
6
|
Profitbricks::Config.save_responses = false
|
7
7
|
Profitbricks::Config.log = false
|
8
8
|
Profitbricks::Config.global_classes = true
|
9
|
+
Profitbricks::Config.polling_interval = 1
|
9
10
|
yield Profitbricks::Config
|
10
11
|
|
11
12
|
Savon.configure do |config|
|
@@ -90,4 +91,4 @@ module Profitbricks
|
|
90
91
|
end
|
91
92
|
klass
|
92
93
|
end
|
93
|
-
end
|
94
|
+
end
|
data/lib/profitbricks/server.rb
CHANGED