garrison-api 1.0.4 → 1.0.5

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
  SHA1:
3
- metadata.gz: 79f419abaefba9cddb2aabadc64a2a51698885d8
4
- data.tar.gz: 5730ab66c898285a2ad590a560b31b04c3f46df0
3
+ metadata.gz: f800441907b0cdcb28b8f9cfd9191694d97e582c
4
+ data.tar.gz: 07a047cf2e217dd8ed1bf36c0592bfc94b39f44b
5
5
  SHA512:
6
- metadata.gz: d443d7f638eddc1b5cd1224ac0df21b12e6954239cb1b4588e6fd43dd243064218516425fa1c44ac65db238ee6056e249a782d494654f15494b1c0499059972a
7
- data.tar.gz: d84973333fb26efc47bcb8897d4c6332cb4d404519327c598647d7f2ad6659edc5bde213b968a0c82c4229642c283626e3081c45654a59831cccce43cf515201
6
+ metadata.gz: 6b9cda20c494980b2b00fd90b98ca407f4d9e4792401858a83fda4c71f7f98f6308f3a4d05bb6a6ba729d0105bbf47f257efc4fc4f15ea84a8192bbce0710914
7
+ data.tar.gz: ecbaec704145d41269c6fba70777bf2bb11e058077edcd611a4add3a681802883d7132e3fb45ca23bf1ba69c42018fe8f3577f3e869e393c441a0556a8b95982
@@ -4,20 +4,22 @@ module Garrison
4
4
 
5
5
  attr_accessor :source
6
6
  attr_accessor :severity
7
- attr_accessor :family
8
7
  attr_accessor :type
8
+ attr_accessor :family
9
+ attr_accessor :departments
9
10
  attr_accessor :options
10
11
 
11
12
  def initialize(options = {})
12
- @source = ENV['GARRISON_ALERT_SOURCE']
13
- @severity = ENV['GARRISON_ALERT_SEVERITY']
14
- @type = ENV['GARRISON_ALERT_TYPE']
15
- @family = ENV['GARRISON_ALERT_FAMILY']
16
- @options = options
13
+ @source = ENV['GARRISON_ALERT_SOURCE']
14
+ @severity = ENV['GARRISON_ALERT_SEVERITY']
15
+ @type = ENV['GARRISON_ALERT_TYPE']
16
+ @family = ENV['GARRISON_ALERT_FAMILY']
17
+ @departments = ENV['GARRISON_ALERT_DEPARTMENTS'] ? ENV['GARRISON_ALERT_DEPARTMENTS'].split(',') : []
18
+ @options = options
17
19
 
18
20
  Logging.info "Starting... #{self.class.name}"
19
21
  inherit_settings
20
- Logging.info "Agent Settings (source=#{self.source} severity=#{self.severity || 'dynamic'} type=#{self.type} family=#{self.family})"
22
+ Logging.info "Agent Settings (source=#{self.source} severity=#{self.severity || 'dynamic'} type=#{self.type} family=#{self.family} departments=#{self.departments.join(',')})"
21
23
 
22
24
  options_log = options.map do |key, value|
23
25
  value = value.is_a?(Array) ? value.join(',') : value
@@ -41,6 +43,7 @@ module Garrison
41
43
  alert.type = type
42
44
  alert.family = family
43
45
  alert.source = source
46
+ alert.departments = departments
44
47
 
45
48
  alert.name = params[:name]
46
49
  alert.target = params[:target]
@@ -13,6 +13,7 @@ module Garrison
13
13
  attr_accessor :detected_at
14
14
  attr_accessor :key_values
15
15
  attr_accessor :urls
16
+ attr_accessor :departments
16
17
 
17
18
  def initialize; end
18
19
 
@@ -32,7 +33,8 @@ module Garrison
32
33
  source: source,
33
34
  severity: severity,
34
35
  key_values: key_values,
35
- urls: urls
36
+ urls: urls,
37
+ departments: departments
36
38
  }.to_json,
37
39
  headers: { 'Content-Type' => 'application/json' }
38
40
  )
@@ -1,5 +1,5 @@
1
1
  module Garrison
2
2
  module Api
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garrison-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forward3D Developers