profitbricks 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/profitbricks.rb +1 -1
- data/lib/profitbricks/profitbricks.rb +14 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7b4d1eb20600d65ab78c002755ac2869426785a
|
4
|
+
data.tar.gz: c7280d386007c4a9b9889455a38f6ded432a539b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fecca29515ddaae5fe833b29e402eec0f4c2a37d3a70895ead1ae1876b3b7e9717d4741297ea0a20d4215915ee6f919b860a82714e539b9dffa58aeb72abbc3a
|
7
|
+
data.tar.gz: 92bae68c2d6399c18d9d32888c5a725545f21ae49b910ff2adc38fdb6dd584aa8927ed1539442d58e5fa066cd2a171f995c2435d1c359bad2065db132dc7b4ce
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
=== 1.0.1 / 2013-07-09
|
2
|
+
|
3
|
+
* Raise an Profitbricks::AuthenticationError when the authentication failed
|
4
|
+
* Temporarily hardcoded the endpoint and namespace
|
5
|
+
|
1
6
|
=== 0.9.5 / 2013-02-16
|
2
7
|
|
3
8
|
* 1 bug fix:
|
4
|
-
* Cast the passed options to Server#create before checking for validity
|
9
|
+
* Cast the passed options to Server#create before checking for validity
|
5
10
|
|
6
11
|
=== 0.9.1 / 2012-05-16
|
7
12
|
|
data/lib/profitbricks.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
|
1
2
|
module Profitbricks
|
3
|
+
class AuthenticationError < StandardError; end
|
2
4
|
NEED_PREFIX = [:create_nic, :create_load_balancer, :update_storage, :create_storage,
|
3
5
|
:update_data_center, :rom_drive, :update_nic, :create_server,
|
4
6
|
:update_load_balancer, :connect_storage_to_server, :update_server]
|
@@ -16,9 +18,12 @@ module Profitbricks
|
|
16
18
|
HTTPI.log = false
|
17
19
|
|
18
20
|
@client = Savon::Client.new do |globals|
|
19
|
-
|
21
|
+
# FIXME the WSDL currently returns a wrong endpoint
|
22
|
+
#globals.wsdl "https://api.profitbricks.com/1.2/wsdl"
|
23
|
+
globals.namespace "http://ws.api.profitbricks.com/"
|
24
|
+
globals.endpoint "https://api.profitbricks.com/1.2"
|
20
25
|
globals.convert_request_keys_to :lower_camelcase
|
21
|
-
globals.raise_errors true
|
26
|
+
globals.raise_errors true
|
22
27
|
globals.log Profitbricks::Config.log
|
23
28
|
globals.pretty_print_xml true
|
24
29
|
|
@@ -41,7 +46,7 @@ module Profitbricks
|
|
41
46
|
end
|
42
47
|
end
|
43
48
|
|
44
|
-
private
|
49
|
+
private
|
45
50
|
def self.request(method, options={})
|
46
51
|
begin
|
47
52
|
message = if NEED_PREFIX.include? method
|
@@ -60,6 +65,12 @@ module Profitbricks
|
|
60
65
|
puts error.to_hash
|
61
66
|
puts "--------------------------------------------------------------------------"
|
62
67
|
raise RuntimeError.new("Error during request '#{method}': #{error.to_s}")
|
68
|
+
rescue Savon::HTTPError => error
|
69
|
+
if error.to_hash[:code] == 401
|
70
|
+
raise AuthenticationError.new('Failed to authenticate.')
|
71
|
+
else
|
72
|
+
raise error
|
73
|
+
end
|
63
74
|
end
|
64
75
|
(resp.body["#{method}_response".to_sym] || resp.body["#{method}_return".to_sym])[:return]
|
65
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profitbricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Sander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
243
|
version: '0'
|
244
244
|
requirements: []
|
245
245
|
rubyforge_project: profitbricks
|
246
|
-
rubygems_version: 2.0.
|
246
|
+
rubygems_version: 2.0.3
|
247
247
|
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: A Ruby client for the ProfitBricks API.
|