opsgenie-heartbeat 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opsgenie/heartbeat.rb +12 -4
- data/lib/opsgenie/heartbeat/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: 3faffdf2193d9391d253f2657fbc288b0228092dbe4b6ec88179811eb5726338
|
4
|
+
data.tar.gz: 4022e80c8cbdb60c33a60fc826b42c11e9d1664526e6e17e4c7a900114695c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eaf4c9522b34071ac08ad7e17c966b8b2b9f33218ae61488cdfb5a9add019b5074762c843af53a3884d32b27b9538e99ad94fc7e41b63373d51cf4dbf5cdd34
|
7
|
+
data.tar.gz: c37a8695d605824fc6c6c1ade08b36ed5d771143d581d191d8c79c06d36079628829ec2219530da60f2845ebd20ea32e10998394a605049045b2763b4e08dbe8
|
data/CHANGELOG.md
CHANGED
data/lib/opsgenie/heartbeat.rb
CHANGED
@@ -14,8 +14,11 @@ module Opsgenie
|
|
14
14
|
uri = URI.parse("https://api.opsgenie.com/v2/heartbeats/#{Rack::Utils.escape name}/ping")
|
15
15
|
http = Net::HTTP.new(uri.host, uri.port)
|
16
16
|
http.use_ssl = true
|
17
|
-
|
18
|
-
|
17
|
+
response = http.get(uri.path, {'Authorization': "GenieKey #{configuration.api_key}"})
|
18
|
+
if !response.is_a?(Net::HTTPSuccess)
|
19
|
+
configuration.logger.info("Error creating or updating heartbeat: #{response}") if configuration.logger
|
20
|
+
end
|
21
|
+
|
19
22
|
rescue => e
|
20
23
|
resolve_exception e
|
21
24
|
end
|
@@ -29,7 +32,7 @@ module Opsgenie
|
|
29
32
|
uri = URI.parse(url_for_resource(:get, name))
|
30
33
|
http = Net::HTTP.new(uri.host, uri.port)
|
31
34
|
http.use_ssl = true
|
32
|
-
response = http.get(uri.path)
|
35
|
+
response = http.get(uri.path, {'Authorization': "GenieKey #{configuration.api_key}"})
|
33
36
|
unless response.is_a?(Net::HTTPSuccess)
|
34
37
|
create(name: original_name, description: description, interval: interval, unit: unit, enabled: enabled, team: team)
|
35
38
|
end
|
@@ -86,7 +89,12 @@ module Opsgenie
|
|
86
89
|
enabled: enabled,
|
87
90
|
ownerTeam: team
|
88
91
|
}.reject {|_, value| value.nil?}
|
89
|
-
http.public_send(verb, uri.path, doc.to_json, {'Authorization': "GenieKey #{configuration.api_key}", "Content-Type": "application/json"})
|
92
|
+
response = http.public_send(verb, uri.path, doc.to_json, {'Authorization': "GenieKey #{configuration.api_key}", "Content-Type": "application/json"})
|
93
|
+
|
94
|
+
if !response.is_a?(Net::HTTPSuccess)
|
95
|
+
configuration.logger.info("Error creating or updating heartbeat: #{response}") if configuration.logger
|
96
|
+
end
|
97
|
+
|
90
98
|
rescue => e
|
91
99
|
resolve_exception e
|
92
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsgenie-heartbeat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dressipi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|