graylogapi 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89b5ae95cc13abcccc29b89a67d5e7308ead8e30
4
- data.tar.gz: dffeec407f8bebe165086fbdb893e88ee37d3c61
3
+ metadata.gz: 935e0873c8bf8d85ed280b4805334e5f5db69de6
4
+ data.tar.gz: a4e92c51db6504f9b2162e53f903d4628b17e80e
5
5
  SHA512:
6
- metadata.gz: 0b425fd6900d797a52b2bf13cf55edfbe88982131b5c982b28905ab3d3b811ac4b2136f2f8663a8f03bf86997ab6db3d2328392d62614dab9d1ceceaaa179eab
7
- data.tar.gz: 3fbc80fe5ddeb8c0c5b33fd17a64122648cf201ead16076803dba9e3c22d0c9e298ecd56e8d978620f65facda656d1284c93ed2874a8fb0c33fcc6cc22965bf5
6
+ metadata.gz: 4e501fabaa1ccf084e0056ffbd3b053e467aa9aec4f9992108a097bfb8dedc0bc686cb91db21ffefe0fe39266ab57964f9b43642fd39312ab2e8e678f8666b8b
7
+ data.tar.gz: 6c8db390c781c37ce269c1dc7e53cbf148d37ac57eeac9f0dbd34cabee0bd0e065080f76cc3cbf1bc8e59d04799bbe03ccdc9633583db137745d4bd9631f2c50
@@ -17,6 +17,10 @@ class GraylogAPI
17
17
  def node_by_id(id)
18
18
  @client.request(:get, "/system/cluster/nodes/#{id}")
19
19
  end
20
+
21
+ def node_by_hostname(hostname)
22
+ nodes['nodes'].find { |n| n['hostname'] == hostname }
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -34,6 +34,13 @@ class GraylogAPI
34
34
  def name_to_type(name)
35
35
  all.body.find { |_, type| type['name'].casecmp(name).zero? }.first
36
36
  end
37
+
38
+ # converg type_id to type name
39
+ #
40
+ # @return [String]
41
+ def type_to_name(type_id)
42
+ all.body.find { |_, type| type['type'].casecmp(type_id).zero? }.last['name']
43
+ end
37
44
  end
38
45
  end
39
46
  end
@@ -1,3 +1,3 @@
1
1
  class GraylogAPI
2
- VERSION = '1.2.1'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graylogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Aleksandrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-10-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Allows you to work with graylog api from ruby
14
14
  email: