dogapi 1.0.1 → 1.0.2
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.
- data/README.rdoc +3 -2
- data/lib/dogapi/common.rb +7 -5
- data/tests/tc_event.rb +1 -2
- data/tests/tc_metric.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Ruby client for Datadog API v1.0.
|
1
|
+
Ruby client for Datadog API v1.0.2
|
2
2
|
|
3
3
|
The Ruby client is a library suitable for inclusion in existing Ruby projects or for development of standalone scripts. It provides an abstraction on top of Datadog's raw HTTP interface for reporting events and metrics.
|
4
4
|
|
@@ -10,7 +10,7 @@ Available at: https://github.com/DataDog/dogapi-rb
|
|
10
10
|
|
11
11
|
$ cd dogapi-rb
|
12
12
|
$ rake gem
|
13
|
-
$ gem install pkg/dogapi
|
13
|
+
$ gem install pkg/dogapi-*.gem
|
14
14
|
|
15
15
|
== RubyGems
|
16
16
|
|
@@ -26,6 +26,7 @@ The client expects the +DATADOG_HOST+ environment variable to be set to the host
|
|
26
26
|
|
27
27
|
Minimal example:
|
28
28
|
|
29
|
+
require 'rubygems'
|
29
30
|
require 'dogapi'
|
30
31
|
|
31
32
|
dog = Dogapi::Client.new(@api_key)
|
data/lib/dogapi/common.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'cgi'
|
2
|
-
require 'net/
|
2
|
+
require 'net/https'
|
3
3
|
require 'pp'
|
4
4
|
require 'socket'
|
5
5
|
require 'uri'
|
@@ -31,10 +31,12 @@ module Dogapi
|
|
31
31
|
host = host || @host
|
32
32
|
|
33
33
|
uri = URI.parse(host)
|
34
|
-
Net::HTTP.
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
session = Net::HTTP.new(uri.host, uri.port)
|
35
|
+
if 'https' == uri.scheme
|
36
|
+
session.use_ssl = true
|
37
|
+
session.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
38
|
+
end
|
39
|
+
session.start do |conn|
|
38
40
|
yield(conn)
|
39
41
|
end
|
40
42
|
end
|
data/tests/tc_event.rb
CHANGED
@@ -38,8 +38,7 @@ class TestEventClient < Test::Unit::TestCase
|
|
38
38
|
submit_event(Dogapi::Scope.new('scoped-testhost', 'testdevice'))
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
submit_event(Dogapi::Scope.new('typed-testhost', 'testdevice'), 'Nagios')
|
41
|
+
def test_submit_typed_event
|
43
42
|
submit_event(Dogapi::Scope.new('typed-testhost', 'testdevice'), 'GitHub')
|
44
43
|
end
|
45
44
|
|
data/tests/tc_metric.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Datadog, Inc.
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-22 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|