dogapi 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/dogapi/common.rb +1 -0
- data/lib/dogapi/facade.rb +9 -3
- data/lib/dogapi/v1/tag.rb +7 -1
- data/tests/tc_client.rb +2 -2
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Ruby client for Datadog API v1.2.
|
1
|
+
= Ruby client for Datadog API v1.2.3
|
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
|
|
data/lib/dogapi/common.rb
CHANGED
data/lib/dogapi/facade.rb
CHANGED
@@ -158,12 +158,18 @@ module Dogapi
|
|
158
158
|
def update_tags(host_id, tags)
|
159
159
|
@tag_svc.update(host_id, tags)
|
160
160
|
end
|
161
|
-
|
161
|
+
|
162
|
+
# <b>DEPRECATED:</b> Spelling mistake temporarily preserved as an alias.
|
163
|
+
def detatch_tags(host_id)
|
164
|
+
warn "[DEPRECATION] Dogapi::Client.detatch() is deprecated. Use `detach` instead."
|
165
|
+
detach_tags(host_id)
|
166
|
+
end
|
167
|
+
|
162
168
|
# Remove all tags from the given host
|
163
169
|
#
|
164
170
|
# +host_id+ can be the host's numeric id or string name
|
165
|
-
def
|
166
|
-
@tag_svc.
|
171
|
+
def detach_tags(host_id)
|
172
|
+
@tag_svc.detach(host_id)
|
167
173
|
end
|
168
174
|
|
169
175
|
private
|
data/lib/dogapi/v1/tag.rb
CHANGED
@@ -56,8 +56,14 @@ module Dogapi
|
|
56
56
|
request(Net::HTTP::Put, '/api/' + API_VERSION + '/tags/hosts/' + host_id.to_s, params, body, true)
|
57
57
|
end
|
58
58
|
|
59
|
-
#
|
59
|
+
# <b>DEPRECATED:</b> Spelling mistake temporarily preserved as an alias.
|
60
60
|
def detatch(host_id)
|
61
|
+
warn "[DEPRECATION] Dogapi::V1::TagService.detatch() is deprecated. Use `detach` instead."
|
62
|
+
detach(host_id)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Remove all tags from a host
|
66
|
+
def detach(host_id)
|
61
67
|
params = {
|
62
68
|
:api_key => @api_key,
|
63
69
|
:application_key => @application_key
|
data/tests/tc_client.rb
CHANGED
@@ -26,7 +26,7 @@ class TestClient < Test::Unit::TestCase
|
|
26
26
|
|
27
27
|
dog.all_tags()
|
28
28
|
|
29
|
-
dog.
|
29
|
+
dog.detach_tags(hostname)
|
30
30
|
code, resp = dog.host_tags(hostname)
|
31
31
|
assert resp["tags"].size == 0
|
32
32
|
|
@@ -51,7 +51,7 @@ class TestClient < Test::Unit::TestCase
|
|
51
51
|
assert new_tags.size == 1
|
52
52
|
assert new_tags.include?('test.tag.4')
|
53
53
|
|
54
|
-
dog.
|
54
|
+
dog.detach_tags(hostname)
|
55
55
|
code, resp = dog.host_tags(hostname)
|
56
56
|
assert resp["tags"].size == 0
|
57
57
|
end
|
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: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 3
|
10
|
+
version: 1.2.3
|
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-11-03 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|