healtcheck_proxy_client 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/healtcheck_proxy_client/client.rb +10 -2
- data/lib/healtcheck_proxy_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5d44441768291b359ace2629f098ff7ce6b4e0d4e4ff6ba1d236d9ca8415359
|
4
|
+
data.tar.gz: 1212c4b7b0bcbb4efe433e5604bc51fe44f3459f0690389e050317dddbee3811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69e70b3fb25544b19df1957dcbf21f687f3025d5fe394b1a27d4a24e32cde6b663e94152bdcd74f9581db17f7bee6806591cfe002395eccbe94b71bf66122a42
|
7
|
+
data.tar.gz: e606f4ccf10d29ae622ddd23774dcf644a8f5bb2d5c2e52be99ef1d6136772f3a627f592768905f3fc14b2ac0034c19abc4dd1c6c96b77cf136462e657083fe1
|
@@ -14,7 +14,7 @@ module HealtcheckProxyClient
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def ping
|
17
|
-
Faraday.get(url)
|
17
|
+
validate_response(Faraday.get(url))
|
18
18
|
rescue Faraday::Error => e
|
19
19
|
raise HttpError.new(e.message, http_error: e)
|
20
20
|
end
|
@@ -24,7 +24,15 @@ module HealtcheckProxyClient
|
|
24
24
|
def_delegators :@configuration, :api_key, :endpoint
|
25
25
|
|
26
26
|
def url
|
27
|
-
"#{endpoint}/#{@healthcheck}/ping?token=#{api_key}"
|
27
|
+
"#{endpoint}/checks/#{@healthcheck}/ping?token=#{api_key}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def validate_response(response)
|
31
|
+
return response if response.status == 200
|
32
|
+
raise HttpError.new(
|
33
|
+
"Invalid HTTP Status code: #{response.status}",
|
34
|
+
http_error: response
|
35
|
+
)
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: healtcheck_proxy_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hendrik Kleinwaechter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|