hawkular-client 2.8.0 → 2.9.0

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -4
  3. data/.travis/start_hawkular_services.sh +21 -0
  4. data/.travis/wait_for_services.rb +26 -10
  5. data/CHANGES.rdoc +26 -0
  6. data/README.rdoc +12 -1
  7. data/docker-compose.yml +4 -2
  8. data/hawkularclient.gemspec +2 -0
  9. data/lib/hawkular/alerts/alerts_api.rb +22 -1
  10. data/lib/hawkular/base_client.rb +29 -24
  11. data/lib/hawkular/client_utils.rb +42 -0
  12. data/lib/hawkular/env_config.rb +15 -0
  13. data/lib/hawkular/hawkular_client.rb +33 -25
  14. data/lib/hawkular/inventory/entities.rb +9 -0
  15. data/lib/hawkular/inventory/inventory_api.rb +13 -3
  16. data/lib/hawkular/logger.rb +14 -0
  17. data/lib/hawkular/metrics/metric_api.rb +24 -8
  18. data/lib/hawkular/operations/operations_api.rb +57 -25
  19. data/lib/hawkular/tokens/tokens_api.rb +4 -1
  20. data/lib/hawkular/version.rb +1 -1
  21. data/lib/hawkularclient.rb +8 -0
  22. data/spec/integration/alerts_spec.rb +50 -27
  23. data/spec/integration/env_config_spec.rb +39 -0
  24. data/spec/integration/hawkular_client_spec.rb +10 -7
  25. data/spec/integration/inventory_spec.rb +36 -3
  26. data/spec/integration/logger_spec.rb +36 -0
  27. data/spec/integration/metric_spec.rb +62 -3
  28. data/spec/integration/operations_spec.rb +112 -63
  29. data/spec/integration/tokens_spec.rb +6 -6
  30. data/spec/spec_helper.rb +20 -6
  31. data/spec/unit/base_spec.rb +25 -3
  32. data/spec/unit/canonical_path_spec.rb +2 -1
  33. data/spec/unit/client_spec.rb +2 -1
  34. data/spec/unit/deprecations_spec.rb +19 -0
  35. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_add_tags_to_existing_alert.yml +210 -0
  36. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_remove_tags_from_existing_alert.yml +257 -0
  37. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_the_action_definitions.yml +59 -22
  38. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_a_consistent_behaviour_when_creating_an_already_existing_resource.yml +714 -0
  39. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_data_from_get_entity.yml +230 -0
  40. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metrics_with_some_tags.yml +1251 -0
  41. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tags_Metrics/setup_client.yml +3 -3
  42. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/agent_properties.yml +124 -0
  43. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +7 -7
  44. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +4 -4
  45. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_deployment_should_be_doable.json +4 -4
  46. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +4 -4
  47. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +3 -3
  48. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +5 -5
  49. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +4 -4
  50. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Update_collection_intervals_should_be_performed_and_eventually_respond_with_success.json +23 -0
  51. metadata +57 -7
  52. data/lib/hawkular/hawkular_client_utils.rb +0 -41
@@ -1,5 +1,5 @@
1
- require "#{File.dirname(__FILE__)}/../vcr/vcr_setup"
2
- require "#{File.dirname(__FILE__)}/../spec_helper"
1
+ require_relative '../vcr/vcr_setup'
2
+ require_relative '../spec_helper'
3
3
 
4
4
  module Hawkular::Token::RSpec
5
5
  HAWKULAR_BASE = 'http://localhost:8080'.freeze
@@ -7,7 +7,7 @@ module Hawkular::Token::RSpec
7
7
  it 'Should be able to list the available tokens' do
8
8
  creds = { username: 'jdoe', password: 'password' }
9
9
  options = { tenant: 'hawkular' }
10
- client = Hawkular::Token::TokenClient.new(HAWKULAR_BASE, creds, options)
10
+ client = Hawkular::Token::Client.new(HAWKULAR_BASE, creds, options)
11
11
  tokens = client.get_tokens(creds)
12
12
  expect(tokens).to be_empty
13
13
  end
@@ -15,7 +15,7 @@ module Hawkular::Token::RSpec
15
15
  it 'Should be able to create a new token for an actual user' do
16
16
  creds = { username: 'jdoe', password: 'password' }
17
17
  options = { tenant: 'hawkular' }
18
- client = Hawkular::Token::TokenClient.new(HAWKULAR_BASE, creds, options)
18
+ client = Hawkular::Token::Client.new(HAWKULAR_BASE, creds, options)
19
19
  token = client.create_token(creds)
20
20
  expect(token['key']).not_to be_nil
21
21
  expect(token['secret']).not_to be_nil
@@ -25,7 +25,7 @@ module Hawkular::Token::RSpec
25
25
  it 'Should get a 401 when attempting to create a token with a wrong password' do
26
26
  creds = { username: 'jdoe', password: 'mywrongpassword' }
27
27
  options = { tenant: 'hawkular' }
28
- client = Hawkular::Token::TokenClient.new(HAWKULAR_BASE, creds, options)
28
+ client = Hawkular::Token::Client.new(HAWKULAR_BASE, creds, options)
29
29
  begin
30
30
  client.create_token(creds)
31
31
  fail 'Should have failed with 401'
@@ -37,7 +37,7 @@ module Hawkular::Token::RSpec
37
37
  it 'Should get a 401 when attempting to create a token without a password' do
38
38
  creds = { username: 'jdoe', password: '' }
39
39
  options = { tenant: 'hawkular' }
40
- client = Hawkular::Token::TokenClient.new(HAWKULAR_BASE, creds, options)
40
+ client = Hawkular::Token::Client.new(HAWKULAR_BASE, creds, options)
41
41
  begin
42
42
  client.create_token(creds)
43
43
  fail 'Should have failed with 401'
data/spec/spec_helper.rb CHANGED
@@ -4,7 +4,7 @@ Coveralls.wear!
4
4
 
5
5
  # Now the application requires.
6
6
  require 'hawkular/hawkular_client'
7
- require 'hawkular/hawkular_client_utils'
7
+ require 'hawkular/client_utils'
8
8
  require 'rspec/core'
9
9
  require 'rspec/mocks'
10
10
  require 'socket'
@@ -18,11 +18,11 @@ module Hawkular::Inventory::RSpec
18
18
  username: options[:username].nil? ? config['user'] : options[:username],
19
19
  password: options[:password].nil? ? config['password'] : options[:password]
20
20
  }
21
- @client = Hawkular::Inventory::InventoryClient.new(entrypoint, credentials, options)
21
+ @client = Hawkular::Inventory::Client.new(entrypoint, credentials, options)
22
22
  end
23
23
 
24
24
  def mock_inventory_client(for_version = '0.16.1.Final')
25
- allow_any_instance_of(Hawkular::Inventory::InventoryClient).to receive(:fetch_version_and_status).and_return(
25
+ allow_any_instance_of(Hawkular::Inventory::Client).to receive(:fetch_version_and_status).and_return(
26
26
  'Implementation-Version' => for_version
27
27
  )
28
28
  end
@@ -156,7 +156,7 @@ module Hawkular::Operations::RSpec
156
156
  def wait_while
157
157
  fast = WebSocketVCR.cassette && !WebSocketVCR.cassette.recording?
158
158
  sleep_interval = SLEEP_SECONDS * (fast ? 1 : 10)
159
- sleep_interval *= 5 if ENV['travis']
159
+ sleep_interval *= 3 if ENV['TRAVIS']
160
160
  attempt = 0
161
161
  sleep sleep_interval while yield && (attempt += 1) < MAX_ATTEMPTS
162
162
  if attempt == MAX_ATTEMPTS
@@ -181,7 +181,7 @@ end
181
181
  module Helpers
182
182
  def config
183
183
  @config ||= YAML.load(
184
- File.read(File.expand_path('endpoint.yml', File.dirname(__FILE__)))
184
+ File.read(File.expand_path('endpoint.yml', __dir__))
185
185
  )
186
186
  end
187
187
 
@@ -196,6 +196,20 @@ module Helpers
196
196
  "#{base['host']}:#{base['port']}"
197
197
  end
198
198
 
199
+ def path_for_installed_agent(wf_server_path)
200
+ wf_server_path.to_resource('Local~%2Fsubsystem%3Dhawkular-wildfly-agent')
201
+ end
202
+
203
+ def in_container(inventory, resource_path)
204
+ properties = inventory.get_resource(resource_path, true).properties
205
+ properties.key?('In Container') ? (properties['In Container'] == 'true') : false
206
+ end
207
+
208
+ def immutable(inventory, resource_path)
209
+ properties = inventory.get_resource(resource_path, true).properties
210
+ properties.key?('Immutable') ? (properties['Immutable'] == 'true') : false
211
+ end
212
+
199
213
  def make_template(base_directory, cassette_name, bindings)
200
214
  cassette = cassette_name.gsub(/\s+/, '_')
201
215
  input_file_path = "#{VCR.configuration.cassette_library_dir}/#{base_directory}/tmp/#{cassette}.yml"
@@ -291,7 +305,7 @@ RSpec.configure do |config|
291
305
  config.include Hawkular::Inventory::RSpec
292
306
  config.include Hawkular::Metrics::RSpec
293
307
  config.include Hawkular::Operations::RSpec
294
- config.include HawkularUtilsMixin
308
+ config.include Hawkular::ClientUtils
295
309
  config.include Hawkular::Inventory
296
310
 
297
311
  # skip the tests that have the :skip metadata on them
@@ -1,5 +1,5 @@
1
- require "#{File.dirname(__FILE__)}/../vcr/vcr_setup"
2
- require "#{File.dirname(__FILE__)}/../spec_helper"
1
+ require_relative '../vcr/vcr_setup'
2
+ require_relative '../spec_helper'
3
3
 
4
4
  describe 'Base Spec' do
5
5
  it 'should know encode' do
@@ -77,13 +77,35 @@ describe 'Base Spec' do
77
77
  expect(ret).to eq('a1%252%203%7c45%2f')
78
78
  end
79
79
 
80
- it 'should pass http_proxy_uri to rest_client' do
80
+ it 'should pass through options to rest_client' do
81
+ proxy_uri = 'http://myproxy.com'
82
+ c = Hawkular::BaseClient.new('not-needed-for-this-test', {},
83
+ { proxy: proxy_uri, timeout: 10 })
84
+ rc = c.rest_client('myurl')
85
+
86
+ expect(rc.options).to include(proxy: proxy_uri, timeout: 10)
87
+ end
88
+
89
+ # backward compatibility
90
+ it 'should pass :http_proxy_uri to rest_client :proxy' do
81
91
  proxy_uri = 'http://myproxy.com'
82
92
  c = Hawkular::BaseClient.new('not-needed-for-this-test', {},
83
93
  { http_proxy_uri: proxy_uri })
84
94
  rc = c.rest_client('myurl')
85
95
 
86
96
  expect(rc.options[:proxy]).to eq(proxy_uri)
97
+ expect(rc.options).to include(proxy: proxy_uri)
98
+ expect(rc.options).not_to have_key(:http_proxy_uri)
99
+ end
100
+
101
+ it 'should merge constructor, hawkular, and call headers' do
102
+ c = Hawkular::BaseClient.new('not-needed-for-this-test', {},
103
+ { tenant: 'Me', headers: { 'X-Foo' => 'bar' } })
104
+ headers = c.http_headers('Referer' => 'them.example.com')
105
+
106
+ expect(headers).to include('Hawkular-Tenant': 'Me',
107
+ 'Referer' => 'them.example.com',
108
+ 'X-Foo' => 'bar')
87
109
  end
88
110
 
89
111
  it 'Should normalize different types of url and suffix combinations with or without slash' do
@@ -1,4 +1,5 @@
1
- require '#{File.dirname(__FILE__)}/../spec_helper'
1
+ require_relative '../spec_helper'
2
+
2
3
  include Hawkular::Inventory
3
4
 
4
5
  describe 'CanonicalPath' do
@@ -1,4 +1,5 @@
1
- require '#{File.dirname(__FILE__)}/../spec_helper'
1
+ require_relative '../spec_helper'
2
+
2
3
  HOST = 'localhost:8080'
3
4
  describe Hawkular::Metrics::Client do
4
5
  context 'client initialization' do
@@ -0,0 +1,19 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe 'Deprecations' do
4
+ def self.changed_constant(from:, to:)
5
+ describe to do
6
+ it 'is still accessible by its old name' do
7
+ expect(from).to eq to
8
+ end
9
+ end
10
+ end
11
+
12
+ describe 'pre-3.0' do
13
+ changed_constant from: HawkularUtilsMixin, to: Hawkular::ClientUtils
14
+ changed_constant from: Hawkular::Operations::OperationsClient, to: Hawkular::Operations::Client
15
+ changed_constant from: Hawkular::Alerts::AlertsClient, to: Hawkular::Alerts::Client
16
+ changed_constant from: Hawkular::Token::TokenClient, to: Hawkular::Token::Client
17
+ changed_constant from: Hawkular::Inventory::InventoryClient, to: Hawkular::Inventory::Client
18
+ end
19
+ end
@@ -0,0 +1,210 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - hawkular-client-ruby
16
+ Hawkular-Tenant:
17
+ - hawkular
18
+ Content-Type:
19
+ - application/json
20
+ Host:
21
+ - localhost:8080
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Expires:
28
+ - '0'
29
+ Cache-Control:
30
+ - no-cache, no-store, must-revalidate
31
+ X-Powered-By:
32
+ - Undertow/1
33
+ Server:
34
+ - WildFly/10
35
+ Pragma:
36
+ - no-cache
37
+ Date:
38
+ - Mon, 27 Feb 2017 23:22:51 GMT
39
+ X-Total-Count:
40
+ - '2'
41
+ Connection:
42
+ - keep-alive
43
+ Content-Type:
44
+ - application/json
45
+ Content-Length:
46
+ - '2578'
47
+ Link:
48
+ - <http://localhost:8080/hawkular/alerts/>; rel="current", <http://localhost:8080/hawkular/alerts/?page=0>;
49
+ rel="last"
50
+ body:
51
+ encoding: UTF-8
52
+ string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1488237770801-406d7ed6-619e-4123-a427-4aa9bb97201a","ctime":1488237770801,"dataSource":"_none_","dataId":"hello-world-trigger","category":"ALERT","text":"A
53
+ mandatory Hello World Trigger","trigger":{"tenantId":"hawkular","id":"hello-world-trigger","name":"Hello
54
+ World Trigger","description":"A mandatory Hello World Trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"dampening":{"tenantId":"hawkular","triggerId":"hello-world-trigger","triggerMode":"FIRING","type":"STRICT","evalTrueSetting":1,"evalTotalSetting":1,"evalTimeSetting":0,"dampeningId":"hawkular-hello-world-trigger-FIRING"},"evalSets":[[{"evalTimestamp":1488237770800,"dataTimestamp":1488237770,"type":"THRESHOLD","condition":{"tenantId":"hawkular","triggerId":"hello-world-trigger","triggerMode":"FIRING","type":"THRESHOLD","conditionSetSize":1,"conditionSetIndex":1,"conditionId":"hawkular-hello-world-trigger-FIRING-1-1","dataId":"data-x","operator":"LT","threshold":5.0},"value":4.0}]],"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488237770801}]},{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1488237770802-b33d5fdf-b784-4f2f-a6b5-ddd65f94da44","ctime":1488237770802,"dataSource":"_none_","dataId":"a-trigger","category":"ALERT","text":"Just
55
+ a trigger","trigger":{"tenantId":"hawkular","id":"a-trigger","name":"A trigger
56
+ name","description":"Just a trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"dampening":{"tenantId":"hawkular","triggerId":"a-trigger","triggerMode":"FIRING","type":"STRICT","evalTrueSetting":1,"evalTotalSetting":1,"evalTimeSetting":0,"dampeningId":"hawkular-a-trigger-FIRING"},"evalSets":[[{"evalTimestamp":1488237770800,"dataTimestamp":1488237770,"type":"THRESHOLD","condition":{"tenantId":"hawkular","triggerId":"a-trigger","triggerMode":"FIRING","type":"THRESHOLD","conditionSetSize":1,"conditionSetIndex":1,"conditionId":"hawkular-a-trigger-FIRING-1-1","dataId":"data-x","operator":"LT","threshold":5.0},"value":4.0}]],"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488237770802}]}]'
57
+ http_version:
58
+ recorded_at: Mon, 27 Feb 2017 23:22:51 GMT
59
+ - request:
60
+ method: get
61
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?tags=new-tag-name%7Ctag_value&thin=true
62
+ body:
63
+ encoding: US-ASCII
64
+ string: ''
65
+ headers:
66
+ Accept:
67
+ - application/json
68
+ Accept-Encoding:
69
+ - identity
70
+ User-Agent:
71
+ - hawkular-client-ruby
72
+ Hawkular-Tenant:
73
+ - hawkular
74
+ Content-Type:
75
+ - application/json
76
+ Host:
77
+ - localhost:8080
78
+ response:
79
+ status:
80
+ code: 200
81
+ message: OK
82
+ headers:
83
+ Expires:
84
+ - '0'
85
+ Cache-Control:
86
+ - no-cache, no-store, must-revalidate
87
+ X-Powered-By:
88
+ - Undertow/1
89
+ Server:
90
+ - WildFly/10
91
+ Pragma:
92
+ - no-cache
93
+ Date:
94
+ - Mon, 27 Feb 2017 23:22:51 GMT
95
+ Connection:
96
+ - keep-alive
97
+ Content-Type:
98
+ - application/json
99
+ Content-Length:
100
+ - '2'
101
+ body:
102
+ encoding: UTF-8
103
+ string: "[]"
104
+ http_version:
105
+ recorded_at: Mon, 27 Feb 2017 23:22:51 GMT
106
+ - request:
107
+ method: put
108
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/tags?alertIds=hello-world-trigger-1488237770801-406d7ed6-619e-4123-a427-4aa9bb97201a&tags=new-tag-name%7Ctag_value,othertag%7Cothervalue
109
+ body:
110
+ encoding: UTF-8
111
+ string: "{}"
112
+ headers:
113
+ Accept:
114
+ - application/json
115
+ Accept-Encoding:
116
+ - identity
117
+ User-Agent:
118
+ - hawkular-client-ruby
119
+ Hawkular-Tenant:
120
+ - hawkular
121
+ Content-Type:
122
+ - application/json
123
+ Content-Length:
124
+ - '2'
125
+ Host:
126
+ - localhost:8080
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Expires:
133
+ - '0'
134
+ Cache-Control:
135
+ - no-cache, no-store, must-revalidate
136
+ X-Powered-By:
137
+ - Undertow/1
138
+ Server:
139
+ - WildFly/10
140
+ Pragma:
141
+ - no-cache
142
+ Date:
143
+ - Mon, 27 Feb 2017 23:22:51 GMT
144
+ Connection:
145
+ - keep-alive
146
+ Content-Type:
147
+ - application/json
148
+ Content-Length:
149
+ - '0'
150
+ body:
151
+ encoding: UTF-8
152
+ string: ''
153
+ http_version:
154
+ recorded_at: Mon, 27 Feb 2017 23:22:51 GMT
155
+ - request:
156
+ method: get
157
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?tags=new-tag-name%7Ctag_value&thin=true
158
+ body:
159
+ encoding: US-ASCII
160
+ string: ''
161
+ headers:
162
+ Accept:
163
+ - application/json
164
+ Accept-Encoding:
165
+ - identity
166
+ User-Agent:
167
+ - hawkular-client-ruby
168
+ Hawkular-Tenant:
169
+ - hawkular
170
+ Content-Type:
171
+ - application/json
172
+ Host:
173
+ - localhost:8080
174
+ response:
175
+ status:
176
+ code: 200
177
+ message: OK
178
+ headers:
179
+ Expires:
180
+ - '0'
181
+ Cache-Control:
182
+ - no-cache, no-store, must-revalidate
183
+ X-Powered-By:
184
+ - Undertow/1
185
+ Server:
186
+ - WildFly/10
187
+ Pragma:
188
+ - no-cache
189
+ Date:
190
+ - Mon, 27 Feb 2017 23:22:51 GMT
191
+ X-Total-Count:
192
+ - '1'
193
+ Connection:
194
+ - keep-alive
195
+ Content-Type:
196
+ - application/json
197
+ Content-Length:
198
+ - '816'
199
+ Link:
200
+ - <http://localhost:8080/hawkular/alerts/?tags=new-tag-name%7ctag_value&thin=true>;
201
+ rel="current", <http://localhost:8080/hawkular/alerts/?tags=new-tag-name%7ctag_value&thin=true&page=0>;
202
+ rel="last"
203
+ body:
204
+ encoding: UTF-8
205
+ string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1488237770801-406d7ed6-619e-4123-a427-4aa9bb97201a","ctime":1488237770801,"dataSource":"_none_","dataId":"hello-world-trigger","category":"ALERT","text":"A
206
+ mandatory Hello World Trigger","tags":{"othertag":"othervalue","new-tag-name":"tag_value"},"trigger":{"tenantId":"hawkular","id":"hello-world-trigger","name":"Hello
207
+ World Trigger","description":"A mandatory Hello World Trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488237770801}]}]'
208
+ http_version:
209
+ recorded_at: Mon, 27 Feb 2017 23:22:51 GMT
210
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,257 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - hawkular-client-ruby
16
+ Hawkular-Tenant:
17
+ - hawkular
18
+ Content-Type:
19
+ - application/json
20
+ Host:
21
+ - localhost:8080
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Expires:
28
+ - '0'
29
+ Cache-Control:
30
+ - no-cache, no-store, must-revalidate
31
+ X-Powered-By:
32
+ - Undertow/1
33
+ Server:
34
+ - WildFly/10
35
+ Pragma:
36
+ - no-cache
37
+ Date:
38
+ - Tue, 28 Feb 2017 16:19:36 GMT
39
+ X-Total-Count:
40
+ - '2'
41
+ Connection:
42
+ - keep-alive
43
+ Content-Type:
44
+ - application/json
45
+ Content-Length:
46
+ - '2578'
47
+ Link:
48
+ - <http://localhost:8080/hawkular/alerts/>; rel="current", <http://localhost:8080/hawkular/alerts/?page=0>;
49
+ rel="last"
50
+ body:
51
+ encoding: UTF-8
52
+ string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1488298775737-2d33eecd-a48a-49b9-87b2-f315068578cf","ctime":1488298775737,"dataSource":"_none_","dataId":"hello-world-trigger","category":"ALERT","text":"A
53
+ mandatory Hello World Trigger","trigger":{"tenantId":"hawkular","id":"hello-world-trigger","name":"Hello
54
+ World Trigger","description":"A mandatory Hello World Trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"dampening":{"tenantId":"hawkular","triggerId":"hello-world-trigger","triggerMode":"FIRING","type":"STRICT","evalTrueSetting":1,"evalTotalSetting":1,"evalTimeSetting":0,"dampeningId":"hawkular-hello-world-trigger-FIRING"},"evalSets":[[{"evalTimestamp":1488298775684,"dataTimestamp":1488298774,"type":"THRESHOLD","condition":{"tenantId":"hawkular","triggerId":"hello-world-trigger","triggerMode":"FIRING","type":"THRESHOLD","conditionSetSize":1,"conditionSetIndex":1,"conditionId":"hawkular-hello-world-trigger-FIRING-1-1","dataId":"data-x","operator":"LT","threshold":5.0},"value":4.0}]],"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488298775737}]},{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1488298775741-f3e64646-c22d-4349-8571-a0d34fdfd7ad","ctime":1488298775741,"dataSource":"_none_","dataId":"a-trigger","category":"ALERT","text":"Just
55
+ a trigger","trigger":{"tenantId":"hawkular","id":"a-trigger","name":"A trigger
56
+ name","description":"Just a trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"dampening":{"tenantId":"hawkular","triggerId":"a-trigger","triggerMode":"FIRING","type":"STRICT","evalTrueSetting":1,"evalTotalSetting":1,"evalTimeSetting":0,"dampeningId":"hawkular-a-trigger-FIRING"},"evalSets":[[{"evalTimestamp":1488298775683,"dataTimestamp":1488298774,"type":"THRESHOLD","condition":{"tenantId":"hawkular","triggerId":"a-trigger","triggerMode":"FIRING","type":"THRESHOLD","conditionSetSize":1,"conditionSetIndex":1,"conditionId":"hawkular-a-trigger-FIRING-1-1","dataId":"data-x","operator":"LT","threshold":5.0},"value":4.0}]],"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488298775741}]}]'
57
+ http_version:
58
+ recorded_at: Tue, 28 Feb 2017 16:19:36 GMT
59
+ - request:
60
+ method: put
61
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/tags?alertIds=hello-world-trigger-1488298775737-2d33eecd-a48a-49b9-87b2-f315068578cf&tags=new-tag-name%7Ctag_value,othertag%7Cothervalue
62
+ body:
63
+ encoding: UTF-8
64
+ string: "{}"
65
+ headers:
66
+ Accept:
67
+ - application/json
68
+ Accept-Encoding:
69
+ - identity
70
+ User-Agent:
71
+ - hawkular-client-ruby
72
+ Hawkular-Tenant:
73
+ - hawkular
74
+ Content-Type:
75
+ - application/json
76
+ Content-Length:
77
+ - '2'
78
+ Host:
79
+ - localhost:8080
80
+ response:
81
+ status:
82
+ code: 200
83
+ message: OK
84
+ headers:
85
+ Expires:
86
+ - '0'
87
+ Cache-Control:
88
+ - no-cache, no-store, must-revalidate
89
+ X-Powered-By:
90
+ - Undertow/1
91
+ Server:
92
+ - WildFly/10
93
+ Pragma:
94
+ - no-cache
95
+ Date:
96
+ - Tue, 28 Feb 2017 16:19:36 GMT
97
+ Connection:
98
+ - keep-alive
99
+ Content-Type:
100
+ - application/json
101
+ Content-Length:
102
+ - '0'
103
+ body:
104
+ encoding: UTF-8
105
+ string: ''
106
+ http_version:
107
+ recorded_at: Tue, 28 Feb 2017 16:19:36 GMT
108
+ - request:
109
+ method: get
110
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?tags=new-tag-name%7Ctag_value&thin=true
111
+ body:
112
+ encoding: US-ASCII
113
+ string: ''
114
+ headers:
115
+ Accept:
116
+ - application/json
117
+ Accept-Encoding:
118
+ - identity
119
+ User-Agent:
120
+ - hawkular-client-ruby
121
+ Hawkular-Tenant:
122
+ - hawkular
123
+ Content-Type:
124
+ - application/json
125
+ Host:
126
+ - localhost:8080
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Expires:
133
+ - '0'
134
+ Cache-Control:
135
+ - no-cache, no-store, must-revalidate
136
+ X-Powered-By:
137
+ - Undertow/1
138
+ Server:
139
+ - WildFly/10
140
+ Pragma:
141
+ - no-cache
142
+ Date:
143
+ - Tue, 28 Feb 2017 16:19:36 GMT
144
+ X-Total-Count:
145
+ - '1'
146
+ Connection:
147
+ - keep-alive
148
+ Content-Type:
149
+ - application/json
150
+ Content-Length:
151
+ - '816'
152
+ Link:
153
+ - <http://localhost:8080/hawkular/alerts/?tags=new-tag-name%7ctag_value&thin=true>;
154
+ rel="current", <http://localhost:8080/hawkular/alerts/?tags=new-tag-name%7ctag_value&thin=true&page=0>;
155
+ rel="last"
156
+ body:
157
+ encoding: UTF-8
158
+ string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1488298775737-2d33eecd-a48a-49b9-87b2-f315068578cf","ctime":1488298775737,"dataSource":"_none_","dataId":"hello-world-trigger","category":"ALERT","text":"A
159
+ mandatory Hello World Trigger","tags":{"othertag":"othervalue","new-tag-name":"tag_value"},"trigger":{"tenantId":"hawkular","id":"hello-world-trigger","name":"Hello
160
+ World Trigger","description":"A mandatory Hello World Trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ALL","enabled":true,"firingMatch":"ALL","source":"_none_"},"severity":"HIGH","status":"OPEN","lifecycle":[{"status":"OPEN","user":"system","stime":1488298775737}]}]'
161
+ http_version:
162
+ recorded_at: Tue, 28 Feb 2017 16:19:36 GMT
163
+ - request:
164
+ method: delete
165
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/tags?alertIds=hello-world-trigger-1488298775737-2d33eecd-a48a-49b9-87b2-f315068578cf&tagNames=new-tag-name
166
+ body:
167
+ encoding: US-ASCII
168
+ string: ''
169
+ headers:
170
+ Accept:
171
+ - application/json
172
+ Accept-Encoding:
173
+ - identity
174
+ User-Agent:
175
+ - hawkular-client-ruby
176
+ Hawkular-Tenant:
177
+ - hawkular
178
+ Content-Type:
179
+ - application/json
180
+ Host:
181
+ - localhost:8080
182
+ response:
183
+ status:
184
+ code: 200
185
+ message: OK
186
+ headers:
187
+ Expires:
188
+ - '0'
189
+ Cache-Control:
190
+ - no-cache, no-store, must-revalidate
191
+ X-Powered-By:
192
+ - Undertow/1
193
+ Server:
194
+ - WildFly/10
195
+ Pragma:
196
+ - no-cache
197
+ Date:
198
+ - Tue, 28 Feb 2017 16:19:36 GMT
199
+ Connection:
200
+ - keep-alive
201
+ Content-Type:
202
+ - application/json
203
+ Content-Length:
204
+ - '0'
205
+ body:
206
+ encoding: UTF-8
207
+ string: ''
208
+ http_version:
209
+ recorded_at: Tue, 28 Feb 2017 16:19:36 GMT
210
+ - request:
211
+ method: get
212
+ uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?tags=new-tag-name%7Ctag_value&thin=true
213
+ body:
214
+ encoding: US-ASCII
215
+ string: ''
216
+ headers:
217
+ Accept:
218
+ - application/json
219
+ Accept-Encoding:
220
+ - identity
221
+ User-Agent:
222
+ - hawkular-client-ruby
223
+ Hawkular-Tenant:
224
+ - hawkular
225
+ Content-Type:
226
+ - application/json
227
+ Host:
228
+ - localhost:8080
229
+ response:
230
+ status:
231
+ code: 200
232
+ message: OK
233
+ headers:
234
+ Expires:
235
+ - '0'
236
+ Cache-Control:
237
+ - no-cache, no-store, must-revalidate
238
+ X-Powered-By:
239
+ - Undertow/1
240
+ Server:
241
+ - WildFly/10
242
+ Pragma:
243
+ - no-cache
244
+ Date:
245
+ - Tue, 28 Feb 2017 16:19:36 GMT
246
+ Connection:
247
+ - keep-alive
248
+ Content-Type:
249
+ - application/json
250
+ Content-Length:
251
+ - '2'
252
+ body:
253
+ encoding: UTF-8
254
+ string: "[]"
255
+ http_version:
256
+ recorded_at: Tue, 28 Feb 2017 16:19:36 GMT
257
+ recorded_with: VCR 3.0.3