graylogapi 1.3.1 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80ae6f1028a7836d42b3d8d292b99e5ccbcf7115b57b1ed22609e6f9e04a48ee
4
- data.tar.gz: 7cc20688412dd03b84ca60e888598c7089c9970a3867c6d92d379c4c5064fe00
3
+ metadata.gz: 8be2f0f7f55426f0677fc6850e5fb6c618ddcd7d902f0f33ea6dfb74ace2c9bf
4
+ data.tar.gz: b579dc5b76c8d6263faff39ff8b09c8e651917716ae078105ba07b0ca258e859
5
5
  SHA512:
6
- metadata.gz: 627acad0ee43670d72476ff48258b9d666398f53759ccc26aa838f9e25f0cc2356f8cf6f36e8d0cce036d43a433b0109a017f6aa95718bb33983aa08ec5d7932
7
- data.tar.gz: d20ee8509e0520cad23b4ea845272183976a93f7636383c1857f500836a6042fe617c3a098453352c87ea96c762731811243ce77c9e2e0b476557abaa2ed8e47
6
+ metadata.gz: a7209c1cc70abf001bb0f39acc3521d58181e9af00e948ff45bf7410f5eeeb75c60b2a2baf6e4078632569e037630da841cea5f94df5979dceb01235fe42d99b
7
+ data.tar.gz: 60529828688e963b966b082afdc30c347d4719ef6110887449b16a0d3779b7cac7b9c0fe91d0a22177e65961eaf2ab3d3db30891f6dace59efbe21ee7ec4836e
data/README.md CHANGED
@@ -86,6 +86,10 @@ You can find more examples [here](./examples/)
86
86
  * clone(id, params) — Clone a stream.
87
87
  * pause(id) — Pause a stream.
88
88
  * resume(id) — Resume a stream.
89
+ * **Stream/Rules**: Rules of a Stream.
90
+ * create(stream_id, params) — Add a rule to a stream.
91
+ * update(stream_id, stream_rule_id, params) — Update a stream rule.
92
+ * delete(stream_id, stream_rule_id) — Remove rule of a stream.
89
93
  * **System**: System informatino of this node.
90
94
  * overview — Get system overview.
91
95
  * jvm — Get JVM information.
@@ -7,6 +7,7 @@ require 'graylogapi/dashboards'
7
7
  require 'graylogapi/static_fields'
8
8
  require 'graylogapi/extractors'
9
9
  require 'graylogapi/streams'
10
+ require 'graylogapi/stream_rules'
10
11
  require 'graylogapi/system'
11
12
  require 'graylogapi/users'
12
13
  require 'graylogapi/version'
@@ -39,6 +40,11 @@ class GraylogAPI
39
40
  @streams ||= Streams.new(@client)
40
41
  end
41
42
 
43
+ # @return [GraylogAPI::StreamsRules]
44
+ def stream_rules
45
+ @stream_rules ||= StreamRules.new(@client)
46
+ end
47
+
42
48
  # @return [GraylogAPI::Dashboards]
43
49
  def dashboards
44
50
  @dashboards ||= Dashboards.new(@client)
@@ -0,0 +1,36 @@
1
+ class GraylogAPI
2
+ # class for manage StreamRules of a Stream
3
+ class StreamRules
4
+ def initialize(client)
5
+ @client = client
6
+ end
7
+
8
+ # add rule to a stream
9
+ #
10
+ # @param stream_id [Integer] id of a stream
11
+ # @param params [Hash]
12
+ # @return [GraylogAPI::Client::Response]
13
+ def create(stream_id, params)
14
+ @client.request(:post, "/streams/#{stream_id}/rules", params)
15
+ end
16
+
17
+ # update a stream rule
18
+ #
19
+ # @param stream_id [Integer] id of a stream
20
+ # @param stream_rule_id [Integer] id of a stream rule
21
+ # @param params [Hash]
22
+ # @return [GraylogAPI::Client::Response]
23
+ def update(stream_id, stream_rule_id, params)
24
+ @client.request(:put, "/streams/#{stream_id}/rules/#{stream_rule_id}", params)
25
+ end
26
+
27
+ # delete rules of a stream
28
+ #
29
+ # @param stream_id [Integer] id of a stream
30
+ # @param stream_rule_id [String] id of a stream rule
31
+ # @return [GraylogAPI::Client::Response]
32
+ def delete(stream_id, stream_rule_id)
33
+ @client.request(:delete, "/streams/#{stream_id}/rules/#{stream_rule_id}")
34
+ end
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  class GraylogAPI
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '1.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graylogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Aleksandrov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-19 00:00:00.000000000 Z
12
+ date: 2018-11-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Allows you to work with graylog api from ruby
15
15
  email:
@@ -29,6 +29,7 @@ files:
29
29
  - lib/graylogapi/dashboards.rb
30
30
  - lib/graylogapi/extractors.rb
31
31
  - lib/graylogapi/static_fields.rb
32
+ - lib/graylogapi/stream_rules.rb
32
33
  - lib/graylogapi/streams.rb
33
34
  - lib/graylogapi/system.rb
34
35
  - lib/graylogapi/system/cluster.rb