garrison-api 1.0.7 → 1.0.8

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
- SHA1:
3
- metadata.gz: 8f64a3f8eeb1260fb64fdfd8cc3b11b82d9f75dc
4
- data.tar.gz: 7f978880da03eda7355e3b51b717493ef321fb45
2
+ SHA256:
3
+ metadata.gz: c2ae0db74546c3f6fff75275830323d4697a3a163a2d75afce2e271f099a1b29
4
+ data.tar.gz: dc0b7aa60d8507c4082c16173526f874fc30c29c6e511dae841bf89ed370ea57
5
5
  SHA512:
6
- metadata.gz: 84305e92d77e3c287b6c232fb4f83617c608078312bd33ff0da0468784b40c6193b2c88d81d9b19883c29452cb3e04fa2e8b371a7491401842833b7bf591cf30
7
- data.tar.gz: e3b1aabf711312f8087dd50046dc84dd5b2fe880df7212d122bf2069a50a04022037b4b4f94a80b46f5293ad024bbb65a7f98d44db739aa67e83d84fb77fa6f3
6
+ metadata.gz: 1c73f7832214609e5b83523c8a908da55eb91c35526232f614fd57f705988c34cc48c869a38fc128172f4c44f3d3b6e9478a9ee3175ad22f7b25e2e3dc0d74aa
7
+ data.tar.gz: c9a020c92477986897e5d08d2bee3047206e044a519b84cf36cb5aaaff946019bdb10cb84a4d280612ef1739cfec70cb58e6ab18cf97a9d4d434cb0502afeff7
data/lib/garrison/api.rb CHANGED
@@ -17,8 +17,12 @@ module Garrison
17
17
 
18
18
  class Configuration
19
19
  attr_accessor :url
20
+ attr_accessor :uuid
21
+ attr_accessor :run_uuid
20
22
 
21
23
  def initialize
24
+ @uuid = SecureRandom.uuid
25
+ @run_uuid = SecureRandom.uuid
22
26
  end
23
27
  end
24
28
  end
@@ -1,6 +1,23 @@
1
1
  module Garrison
2
2
  module Api
3
3
  class Alert
4
+
5
+ class << self
6
+ def obsolete_previous_runs(source)
7
+ raise ArgumentError, "No source defined" unless source
8
+ url = File.join(Api.configuration.url, 'api', 'v1', 'alerts', 'obsolete')
9
+ HTTParty.post(
10
+ url,
11
+ body: {
12
+ source: source,
13
+ agent_uuid: Api.configuration.uuid,
14
+ agent_run_uuid: Api.configuration.run_uuid,
15
+ }.to_json,
16
+ headers: { 'Content-Type' => 'application/json' }
17
+ )
18
+ end
19
+ end
20
+
4
21
  attr_accessor :type
5
22
  attr_accessor :family
6
23
  attr_accessor :source
@@ -40,7 +57,9 @@ module Garrison
40
57
  urls: urls,
41
58
  departments: departments,
42
59
  no_repeat: no_repeat,
43
- count: count
60
+ count: count,
61
+ agent_uuid: Api.configuration.uuid,
62
+ agent_run_uuid: Api.configuration.run_uuid,
44
63
  }.to_json,
45
64
  headers: { 'Content-Type' => 'application/json' }
46
65
  )
@@ -1,5 +1,5 @@
1
1
  module Garrison
2
2
  module Api
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garrison-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forward3D Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2019-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.6.12
97
+ rubygems_version: 2.7.7
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: RubyGem to talk to the Garrison API