hawkular-client 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGES.rdoc +13 -0
- data/README.rdoc +94 -2
- data/hawkularclient.gemspec +1 -0
- data/lib/hawkular/alerts/alerts_api.rb +7 -3
- data/lib/hawkular/base_client.rb +22 -0
- data/lib/hawkular/hawkular_client.rb +1 -1
- data/lib/hawkular/inventory/inventory_api.rb +18 -1
- data/lib/hawkular/metrics/metric_api.rb +39 -3
- data/lib/hawkular/metrics/metrics_client.rb +2 -2
- data/lib/hawkular/operations/operations_api.rb +1 -1
- data/lib/hawkular/tokens/tokens_api.rb +1 -1
- data/lib/hawkular/version.rb +1 -1
- data/spec/integration/alerts_spec.rb +41 -1
- data/spec/integration/hawkular_client_spec.rb +12 -4
- data/spec/integration/inventory_spec.rb +10 -3
- data/spec/integration/metric_spec.rb +82 -0
- data/spec/integration/operations_spec.rb +6 -1
- data/spec/spec_helper.rb +17 -0
- data/spec/unit/base_spec.rb +56 -1
- data/spec/unit/client_spec.rb +5 -12
- data/spec/vcr_cassettes/Alert/Triggers/Should_create_a_firing_ALL_ANY_trigger.yml +463 -0
- data/spec/vcr_cassettes/Availability_metrics/Should_group_contiguous_values.yml +93 -0
- data/spec/vcr_cassettes/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +330 -0
- metadata +25 -4
@@ -3,12 +3,14 @@ require "#{File.dirname(__FILE__)}/../spec_helper"
|
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
5
|
module Hawkular::Inventory::RSpec
|
6
|
+
ENTRYPOINT = 'http://localhost:8080/hawkular/inventory'
|
6
7
|
include Hawkular::Inventory
|
7
8
|
describe 'Inventory/Tenants', vcr: { decode_compressed_response: true } do
|
8
9
|
it 'Should Get Tenant For Explicit Credentials' do
|
9
10
|
# get the client for given endpoint for given credentials
|
10
11
|
creds = { username: 'jdoe', password: 'password' }
|
11
|
-
|
12
|
+
mock_inventory_client
|
13
|
+
client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT,
|
12
14
|
credentials: creds)
|
13
15
|
|
14
16
|
tenant = client.get_tenant(creds)
|
@@ -18,7 +20,8 @@ module Hawkular::Inventory::RSpec
|
|
18
20
|
|
19
21
|
it 'Should Get Tenant For Implicit Credentials' do
|
20
22
|
creds = { username: 'jdoe', password: 'password' }
|
21
|
-
|
23
|
+
mock_inventory_client
|
24
|
+
client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT, credentials: creds)
|
22
25
|
|
23
26
|
tenant = client.get_tenant
|
24
27
|
|
@@ -34,7 +37,10 @@ module Hawkular::Inventory::RSpec
|
|
34
37
|
username: 'jdoe',
|
35
38
|
password: 'password'
|
36
39
|
}
|
37
|
-
|
40
|
+
::RSpec::Mocks.with_temporary_scope do
|
41
|
+
mock_inventory_client
|
42
|
+
@client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT, credentials: @creds)
|
43
|
+
end
|
38
44
|
options = { decode_compressed_response: true }
|
39
45
|
options[:record] = :all if ENV['VCR_UPDATE'] == '1'
|
40
46
|
VCR.use_cassette('Inventory/Helpers/get_feeds', options) do
|
@@ -106,6 +112,7 @@ module Hawkular::Inventory::RSpec
|
|
106
112
|
creds = { username: @state[:super_secret_username],
|
107
113
|
password: @state[:super_secret_password] }
|
108
114
|
tori_url = 'https://hawkular.torii.gva.redhat.com/hawkular/inventory'
|
115
|
+
mock_inventory_client
|
109
116
|
client = Hawkular::Inventory::InventoryClient.create(entrypoint: tori_url,
|
110
117
|
credentials: creds,
|
111
118
|
options: { verify_ssl: OpenSSL::SSL::VERIFY_NONE })
|
@@ -70,6 +70,61 @@ describe 'Mixed metrics' do
|
|
70
70
|
end
|
71
71
|
# end
|
72
72
|
|
73
|
+
it 'Should requests raw data for multiple metrics' do
|
74
|
+
@client = setup_client(username: 'jdoe', password: 'password', tenant: 'vcr-test')
|
75
|
+
ids = [SecureRandom.uuid, SecureRandom.uuid, SecureRandom.uuid]
|
76
|
+
VCR.use_cassette('Mixed_metrics/Should requests raw data for multiple metrics',
|
77
|
+
erb: { ids: ids }, record: :none
|
78
|
+
) do
|
79
|
+
expect(@client.counters.raw_data(ids).size).to be 0
|
80
|
+
expect(@client.gauges.raw_data(ids).size).to be 0
|
81
|
+
expect(@client.avail.raw_data(ids).size).to be 0
|
82
|
+
|
83
|
+
@client.push_data(
|
84
|
+
counters: [
|
85
|
+
{ id: ids[0], data: [{ value: 1 }] },
|
86
|
+
{ id: ids[1], data: [{ value: 2 }] },
|
87
|
+
{ id: ids[2], data: [{ value: 3 }] }
|
88
|
+
],
|
89
|
+
availabilities: [
|
90
|
+
{ id: ids[0], data: [{ value: 'up' }] },
|
91
|
+
{ id: ids[1], data: [{ value: 'down' }] },
|
92
|
+
{ id: ids[2], data: [{ value: 'up' }] }
|
93
|
+
],
|
94
|
+
gauges: [
|
95
|
+
{ id: ids[0], data: [{ value: 1.1 }] },
|
96
|
+
{ id: ids[1], data: [{ value: 2.2 }] },
|
97
|
+
{ id: ids[2], data: [{ value: 3.3 }] }
|
98
|
+
]
|
99
|
+
)
|
100
|
+
|
101
|
+
counter_metrics = @client.counters.raw_data(ids)
|
102
|
+
gauges_metrics = @client.gauges.raw_data(ids)
|
103
|
+
availability_metrics = @client.avail.raw_data(ids)
|
104
|
+
|
105
|
+
expect(counter_metrics.size).to be 3
|
106
|
+
expect(counter_metrics).to include(
|
107
|
+
{ 'id' => ids[0], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 1 }] },
|
108
|
+
{ 'id' => ids[1], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 2 }] },
|
109
|
+
{ 'id' => ids[2], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3 }] }
|
110
|
+
)
|
111
|
+
|
112
|
+
expect(gauges_metrics.size).to be 3
|
113
|
+
expect(gauges_metrics).to include(
|
114
|
+
{ 'id' => ids[0], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 1.1 }] },
|
115
|
+
{ 'id' => ids[1], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 2.2 }] },
|
116
|
+
{ 'id' => ids[2], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3.3 }] }
|
117
|
+
)
|
118
|
+
|
119
|
+
expect(availability_metrics.size).to be 3
|
120
|
+
expect(availability_metrics).to include(
|
121
|
+
{ 'id' => ids[0], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'up' }] },
|
122
|
+
{ 'id' => ids[1], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'down' }] },
|
123
|
+
{ 'id' => ids[2], 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'up' }] }
|
124
|
+
)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
73
128
|
it 'Should send mixed metric request' do
|
74
129
|
id = SecureRandom.uuid
|
75
130
|
VCR.use_cassette('Mixed_metrics/Should send mixed metric request',
|
@@ -282,6 +337,33 @@ describe 'Availability metrics' do
|
|
282
337
|
update_metric_by_tags @client.avail, id
|
283
338
|
end
|
284
339
|
end
|
340
|
+
|
341
|
+
it 'Should raise ArgumentError, availability does not accept percentiles param' do
|
342
|
+
expect { @client.avail.get_data(SecureRandom.uuid, percentiles: 50) }.to raise_error(ArgumentError)
|
343
|
+
end
|
344
|
+
|
345
|
+
it 'Should group contiguous values' do
|
346
|
+
id = SecureRandom.uuid
|
347
|
+
now = @client.now
|
348
|
+
setup_client(username: 'jdoe', password: 'password', tenant: 'vcr-test')
|
349
|
+
VCR.use_cassette('Availability_metrics/Should group contiguous values',
|
350
|
+
erb: { id: id, now: now }, record: :none
|
351
|
+
) do
|
352
|
+
@client.avail.push_data(id, [
|
353
|
+
{ timestamp: now - 50, value: 'up' },
|
354
|
+
{ timestamp: now - 40, value: 'up' },
|
355
|
+
{ timestamp: now - 30, value: 'down' },
|
356
|
+
{ timestamp: now - 20, value: 'down' },
|
357
|
+
{ timestamp: now - 10, value: 'down' },
|
358
|
+
{ timestamp: now, value: 'up' }
|
359
|
+
])
|
360
|
+
expect(@client.avail.get_data(id, distinct: true, order: 'ASC')).to eq([
|
361
|
+
{ 'timestamp' => now - 50, 'value' => 'up' },
|
362
|
+
{ 'timestamp' => now - 30, 'value' => 'down' },
|
363
|
+
{ 'timestamp' => now, 'value' => 'up' }
|
364
|
+
])
|
365
|
+
end
|
366
|
+
end
|
285
367
|
end
|
286
368
|
|
287
369
|
describe 'Gauge metrics' do
|
@@ -119,7 +119,12 @@ module Hawkular::Operations::RSpec
|
|
119
119
|
before(:all) do
|
120
120
|
VCR.use_cassette('Operation/Helpers/get_tenant', decode_compressed_response: true) do
|
121
121
|
@creds = { username: 'jdoe', password: 'password' }
|
122
|
-
|
122
|
+
::RSpec::Mocks.with_temporary_scope do
|
123
|
+
mock_inventory_client
|
124
|
+
@inventory_client = InventoryClient.create(entrypoint: HOST, credentials: @creds)
|
125
|
+
end
|
126
|
+
inventory_client = @inventory_client
|
127
|
+
remove_instance_variable(:@inventory_client)
|
123
128
|
@tenant_id = inventory_client.get_tenant
|
124
129
|
VCR.use_cassette('Operation/Helpers/get_feed', decode_compressed_response: true) do
|
125
130
|
@feed_id = inventory_client.list_feeds[0]
|
data/spec/spec_helper.rb
CHANGED
@@ -11,6 +11,22 @@ require 'uri'
|
|
11
11
|
require 'yaml'
|
12
12
|
require 'json'
|
13
13
|
|
14
|
+
module Hawkular::Inventory::RSpec
|
15
|
+
def setup_inventory_client(entrypoint, options = {})
|
16
|
+
credentials = {
|
17
|
+
username: options[:username].nil? ? config['user'] : options[:username],
|
18
|
+
password: options[:password].nil? ? config['password'] : options[:password]
|
19
|
+
}
|
20
|
+
@client = Hawkular::Inventory::InventoryClient.new(entrypoint, credentials, options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def mock_inventory_client(for_version = '0.16.1.Final')
|
24
|
+
allow_any_instance_of(Hawkular::Inventory::InventoryClient).to receive(:fetch_version_and_status).and_return(
|
25
|
+
'Implementation-Version' => for_version
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
14
30
|
module Hawkular::Metrics::RSpec
|
15
31
|
def setup_client(options = {})
|
16
32
|
credentials = {
|
@@ -151,6 +167,7 @@ end
|
|
151
167
|
|
152
168
|
RSpec.configure do |config|
|
153
169
|
config.include Helpers
|
170
|
+
config.include Hawkular::Inventory::RSpec
|
154
171
|
config.include Hawkular::Metrics::RSpec
|
155
172
|
config.include Hawkular::Operations::RSpec
|
156
173
|
config.include HawkularUtilsMixin
|
data/spec/unit/base_spec.rb
CHANGED
@@ -79,9 +79,64 @@ describe 'Base Spec' do
|
|
79
79
|
it 'should pass http_proxy_uri to rest_client' do
|
80
80
|
proxy_uri = 'http://myproxy.com'
|
81
81
|
c = Hawkular::BaseClient.new('not-needed-for-this-test', {},
|
82
|
-
http_proxy_uri: proxy_uri)
|
82
|
+
{ http_proxy_uri: proxy_uri })
|
83
83
|
rc = c.rest_client('myurl')
|
84
84
|
|
85
85
|
expect(rc.options[:proxy]).to eq(proxy_uri)
|
86
86
|
end
|
87
|
+
|
88
|
+
it 'Should normalize different types of url and suffix combinations with or without slash' do
|
89
|
+
c = Hawkular::BaseClient.new('not-needed-for-this-test')
|
90
|
+
|
91
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080', '/hawkular/alerts/'
|
92
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
93
|
+
|
94
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080', '/hawkular/alerts'
|
95
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
96
|
+
|
97
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080', 'hawkular/alerts/'
|
98
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
99
|
+
|
100
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080', 'hawkular/alerts'
|
101
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
102
|
+
|
103
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/', '/hawkular/alerts/'
|
104
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
105
|
+
|
106
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/', '/hawkular/alerts'
|
107
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
108
|
+
|
109
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/', 'hawkular/alerts/'
|
110
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
111
|
+
|
112
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/', 'hawkular/alerts'
|
113
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
114
|
+
|
115
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts', '/hawkular/alerts/'
|
116
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
117
|
+
|
118
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts', '/hawkular/alerts'
|
119
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
120
|
+
|
121
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts', 'hawkular/alerts/'
|
122
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
123
|
+
|
124
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts', 'hawkular/alerts'
|
125
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
126
|
+
|
127
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts/', '/hawkular/alerts/'
|
128
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
129
|
+
|
130
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts/', '/hawkular/alerts'
|
131
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
132
|
+
|
133
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts/', 'hawkular/alerts/'
|
134
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
135
|
+
|
136
|
+
ret = c.normalize_entrypoint_url 'http://localhost:8080/hawkular/alerts/', 'hawkular/alerts'
|
137
|
+
expect(ret).to eq('http://localhost:8080/hawkular/alerts')
|
138
|
+
|
139
|
+
ret = c.normalize_entrypoint_url 'http://127.0.0.1/hawkular/alerts/', 'hawkular/alerts'
|
140
|
+
expect(ret).to eq('http://127.0.0.1/hawkular/alerts')
|
141
|
+
end
|
87
142
|
end
|
data/spec/unit/client_spec.rb
CHANGED
@@ -1,27 +1,21 @@
|
|
1
1
|
require '#{File.dirname(__FILE__)}/../spec_helper'
|
2
|
-
|
2
|
+
HOST = 'localhost:8080'
|
3
3
|
describe Hawkular::Metrics::Client do
|
4
4
|
context 'client initialization' do
|
5
5
|
it 'should accept no option' do
|
6
6
|
credentials = { username: 'mockuser', password: 'mockpass' }
|
7
|
-
Hawkular::Metrics::Client.new(
|
8
|
-
'http://localhost:8080/hawkular/metrics', credentials)
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should support no parameters' do
|
12
|
-
Hawkular::Metrics::Client.new
|
7
|
+
Hawkular::Metrics::Client.new(HOST, credentials)
|
13
8
|
end
|
14
9
|
|
15
10
|
it 'should accept Hawkular-Tenant option' do
|
16
11
|
credentials = { username: 'mockuser', password: 'mockpass' }
|
17
|
-
@client = Hawkular::Metrics::Client.new(
|
18
|
-
'http://localhost:8080/hawkular/metrics', credentials, tenant: 'foo')
|
12
|
+
@client = Hawkular::Metrics::Client.new(HOST, credentials, tenant: 'foo')
|
19
13
|
headers = @client.send(:http_headers)
|
20
14
|
expect(headers[:'Hawkular-Tenant']).to eql('foo')
|
21
15
|
end
|
22
16
|
|
23
17
|
it 'should define subcomponents' do
|
24
|
-
client = Hawkular::Metrics::Client.new
|
18
|
+
client = Hawkular::Metrics::Client.new HOST
|
25
19
|
expect(client.tenants).not_to be nil
|
26
20
|
expect(client.counters).not_to be nil
|
27
21
|
expect(client.gauges).not_to be nil
|
@@ -31,8 +25,7 @@ describe Hawkular::Metrics::Client do
|
|
31
25
|
context 'http comms' do
|
32
26
|
before(:each) do
|
33
27
|
credentials = { username: 'mockuser', password: 'mockpass' }
|
34
|
-
@client = Hawkular::Metrics::Client.new(
|
35
|
-
'http://localhost:8080/hawkular/metrics', credentials)
|
28
|
+
@client = Hawkular::Metrics::Client.new(HOST, credentials)
|
36
29
|
end
|
37
30
|
|
38
31
|
it 'should add Accept: headers' do
|
@@ -0,0 +1,463 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/trigger
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"trigger":{"id":"my-cool-trigger","name":"Just a trigger","enabled":true,"severity":"HIGH","description":"Just
|
9
|
+
a test trigger","actions":[]},"conditions":[],"dampenings":[]}'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- application/json
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip, deflate
|
15
|
+
Hawkular-Tenant:
|
16
|
+
- hawkular
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
Content-Length:
|
20
|
+
- '174'
|
21
|
+
User-Agent:
|
22
|
+
- Ruby
|
23
|
+
response:
|
24
|
+
status:
|
25
|
+
code: 200
|
26
|
+
message: OK
|
27
|
+
headers:
|
28
|
+
Expires:
|
29
|
+
- '0'
|
30
|
+
Cache-Control:
|
31
|
+
- no-cache, no-store, must-revalidate
|
32
|
+
X-Powered-By:
|
33
|
+
- Undertow/1
|
34
|
+
Server:
|
35
|
+
- WildFly/10
|
36
|
+
Pragma:
|
37
|
+
- no-cache
|
38
|
+
Date:
|
39
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
40
|
+
Connection:
|
41
|
+
- keep-alive
|
42
|
+
Content-Type:
|
43
|
+
- application/json
|
44
|
+
Content-Length:
|
45
|
+
- '374'
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"trigger":{"tenantId":"hawkular","id":"my-cool-trigger","name":"Just
|
49
|
+
a trigger","description":"Just a test 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_"}}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
52
|
+
- request:
|
53
|
+
method: get
|
54
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger
|
55
|
+
body:
|
56
|
+
encoding: US-ASCII
|
57
|
+
string: ''
|
58
|
+
headers:
|
59
|
+
Accept:
|
60
|
+
- application/json
|
61
|
+
Accept-Encoding:
|
62
|
+
- gzip, deflate
|
63
|
+
Hawkular-Tenant:
|
64
|
+
- hawkular
|
65
|
+
Content-Type:
|
66
|
+
- application/json
|
67
|
+
User-Agent:
|
68
|
+
- Ruby
|
69
|
+
response:
|
70
|
+
status:
|
71
|
+
code: 200
|
72
|
+
message: OK
|
73
|
+
headers:
|
74
|
+
Expires:
|
75
|
+
- '0'
|
76
|
+
Cache-Control:
|
77
|
+
- no-cache, no-store, must-revalidate
|
78
|
+
X-Powered-By:
|
79
|
+
- Undertow/1
|
80
|
+
Server:
|
81
|
+
- WildFly/10
|
82
|
+
Pragma:
|
83
|
+
- no-cache
|
84
|
+
Date:
|
85
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
86
|
+
Connection:
|
87
|
+
- keep-alive
|
88
|
+
Content-Type:
|
89
|
+
- application/json
|
90
|
+
Content-Length:
|
91
|
+
- '362'
|
92
|
+
body:
|
93
|
+
encoding: UTF-8
|
94
|
+
string: '{"tenantId":"hawkular","id":"my-cool-trigger","name":"Just a trigger","description":"Just
|
95
|
+
a test 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_"}'
|
96
|
+
http_version:
|
97
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
98
|
+
- request:
|
99
|
+
method: get
|
100
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger/conditions
|
101
|
+
body:
|
102
|
+
encoding: US-ASCII
|
103
|
+
string: ''
|
104
|
+
headers:
|
105
|
+
Accept:
|
106
|
+
- application/json
|
107
|
+
Accept-Encoding:
|
108
|
+
- gzip, deflate
|
109
|
+
Hawkular-Tenant:
|
110
|
+
- hawkular
|
111
|
+
Content-Type:
|
112
|
+
- application/json
|
113
|
+
User-Agent:
|
114
|
+
- Ruby
|
115
|
+
response:
|
116
|
+
status:
|
117
|
+
code: 200
|
118
|
+
message: OK
|
119
|
+
headers:
|
120
|
+
Expires:
|
121
|
+
- '0'
|
122
|
+
Cache-Control:
|
123
|
+
- no-cache, no-store, must-revalidate
|
124
|
+
X-Powered-By:
|
125
|
+
- Undertow/1
|
126
|
+
Server:
|
127
|
+
- WildFly/10
|
128
|
+
Pragma:
|
129
|
+
- no-cache
|
130
|
+
Date:
|
131
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
132
|
+
Connection:
|
133
|
+
- keep-alive
|
134
|
+
Content-Type:
|
135
|
+
- application/json
|
136
|
+
Content-Length:
|
137
|
+
- '2'
|
138
|
+
body:
|
139
|
+
encoding: UTF-8
|
140
|
+
string: "[]"
|
141
|
+
http_version:
|
142
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
143
|
+
- request:
|
144
|
+
method: get
|
145
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger/dampenings
|
146
|
+
body:
|
147
|
+
encoding: US-ASCII
|
148
|
+
string: ''
|
149
|
+
headers:
|
150
|
+
Accept:
|
151
|
+
- application/json
|
152
|
+
Accept-Encoding:
|
153
|
+
- gzip, deflate
|
154
|
+
Hawkular-Tenant:
|
155
|
+
- hawkular
|
156
|
+
Content-Type:
|
157
|
+
- application/json
|
158
|
+
User-Agent:
|
159
|
+
- Ruby
|
160
|
+
response:
|
161
|
+
status:
|
162
|
+
code: 200
|
163
|
+
message: OK
|
164
|
+
headers:
|
165
|
+
Expires:
|
166
|
+
- '0'
|
167
|
+
Cache-Control:
|
168
|
+
- no-cache, no-store, must-revalidate
|
169
|
+
X-Powered-By:
|
170
|
+
- Undertow/1
|
171
|
+
Server:
|
172
|
+
- WildFly/10
|
173
|
+
Pragma:
|
174
|
+
- no-cache
|
175
|
+
Date:
|
176
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
177
|
+
Connection:
|
178
|
+
- keep-alive
|
179
|
+
Content-Type:
|
180
|
+
- application/json
|
181
|
+
Content-Length:
|
182
|
+
- '2'
|
183
|
+
body:
|
184
|
+
encoding: UTF-8
|
185
|
+
string: "[]"
|
186
|
+
http_version:
|
187
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
188
|
+
- request:
|
189
|
+
method: delete
|
190
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger
|
191
|
+
body:
|
192
|
+
encoding: US-ASCII
|
193
|
+
string: ''
|
194
|
+
headers:
|
195
|
+
Accept:
|
196
|
+
- application/json
|
197
|
+
Accept-Encoding:
|
198
|
+
- gzip, deflate
|
199
|
+
Hawkular-Tenant:
|
200
|
+
- hawkular
|
201
|
+
Content-Type:
|
202
|
+
- application/json
|
203
|
+
User-Agent:
|
204
|
+
- Ruby
|
205
|
+
response:
|
206
|
+
status:
|
207
|
+
code: 200
|
208
|
+
message: OK
|
209
|
+
headers:
|
210
|
+
Expires:
|
211
|
+
- '0'
|
212
|
+
Cache-Control:
|
213
|
+
- no-cache, no-store, must-revalidate
|
214
|
+
X-Powered-By:
|
215
|
+
- Undertow/1
|
216
|
+
Server:
|
217
|
+
- WildFly/10
|
218
|
+
Pragma:
|
219
|
+
- no-cache
|
220
|
+
Date:
|
221
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
222
|
+
Connection:
|
223
|
+
- keep-alive
|
224
|
+
Content-Type:
|
225
|
+
- application/json
|
226
|
+
Content-Length:
|
227
|
+
- '0'
|
228
|
+
body:
|
229
|
+
encoding: UTF-8
|
230
|
+
string: ''
|
231
|
+
http_version:
|
232
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
233
|
+
- request:
|
234
|
+
method: post
|
235
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/trigger
|
236
|
+
body:
|
237
|
+
encoding: UTF-8
|
238
|
+
string: '{"trigger":{"id":"my-cool-trigger","name":"Just a trigger","enabled":true,"severity":"HIGH","description":"Just
|
239
|
+
a test trigger","firingMatch":"ANY","autoResolveMatch":"ANY","actions":[]},"conditions":[],"dampenings":[]}'
|
240
|
+
headers:
|
241
|
+
Accept:
|
242
|
+
- application/json
|
243
|
+
Accept-Encoding:
|
244
|
+
- gzip, deflate
|
245
|
+
Hawkular-Tenant:
|
246
|
+
- hawkular
|
247
|
+
Content-Type:
|
248
|
+
- application/json
|
249
|
+
Content-Length:
|
250
|
+
- '219'
|
251
|
+
User-Agent:
|
252
|
+
- Ruby
|
253
|
+
response:
|
254
|
+
status:
|
255
|
+
code: 200
|
256
|
+
message: OK
|
257
|
+
headers:
|
258
|
+
Expires:
|
259
|
+
- '0'
|
260
|
+
Cache-Control:
|
261
|
+
- no-cache, no-store, must-revalidate
|
262
|
+
X-Powered-By:
|
263
|
+
- Undertow/1
|
264
|
+
Server:
|
265
|
+
- WildFly/10
|
266
|
+
Pragma:
|
267
|
+
- no-cache
|
268
|
+
Date:
|
269
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
270
|
+
Connection:
|
271
|
+
- keep-alive
|
272
|
+
Content-Type:
|
273
|
+
- application/json
|
274
|
+
Content-Length:
|
275
|
+
- '374'
|
276
|
+
body:
|
277
|
+
encoding: UTF-8
|
278
|
+
string: '{"trigger":{"tenantId":"hawkular","id":"my-cool-trigger","name":"Just
|
279
|
+
a trigger","description":"Just a test trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ANY","enabled":true,"firingMatch":"ANY","source":"_none_"}}'
|
280
|
+
http_version:
|
281
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
282
|
+
- request:
|
283
|
+
method: get
|
284
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger
|
285
|
+
body:
|
286
|
+
encoding: US-ASCII
|
287
|
+
string: ''
|
288
|
+
headers:
|
289
|
+
Accept:
|
290
|
+
- application/json
|
291
|
+
Accept-Encoding:
|
292
|
+
- gzip, deflate
|
293
|
+
Hawkular-Tenant:
|
294
|
+
- hawkular
|
295
|
+
Content-Type:
|
296
|
+
- application/json
|
297
|
+
User-Agent:
|
298
|
+
- Ruby
|
299
|
+
response:
|
300
|
+
status:
|
301
|
+
code: 200
|
302
|
+
message: OK
|
303
|
+
headers:
|
304
|
+
Expires:
|
305
|
+
- '0'
|
306
|
+
Cache-Control:
|
307
|
+
- no-cache, no-store, must-revalidate
|
308
|
+
X-Powered-By:
|
309
|
+
- Undertow/1
|
310
|
+
Server:
|
311
|
+
- WildFly/10
|
312
|
+
Pragma:
|
313
|
+
- no-cache
|
314
|
+
Date:
|
315
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
316
|
+
Connection:
|
317
|
+
- keep-alive
|
318
|
+
Content-Type:
|
319
|
+
- application/json
|
320
|
+
Content-Length:
|
321
|
+
- '362'
|
322
|
+
body:
|
323
|
+
encoding: UTF-8
|
324
|
+
string: '{"tenantId":"hawkular","id":"my-cool-trigger","name":"Just a trigger","description":"Just
|
325
|
+
a test trigger","type":"STANDARD","eventType":"ALERT","eventCategory":null,"eventText":null,"severity":"HIGH","autoDisable":false,"autoEnable":false,"autoResolve":false,"autoResolveAlerts":true,"autoResolveMatch":"ANY","enabled":true,"firingMatch":"ANY","source":"_none_"}'
|
326
|
+
http_version:
|
327
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
328
|
+
- request:
|
329
|
+
method: get
|
330
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger/conditions
|
331
|
+
body:
|
332
|
+
encoding: US-ASCII
|
333
|
+
string: ''
|
334
|
+
headers:
|
335
|
+
Accept:
|
336
|
+
- application/json
|
337
|
+
Accept-Encoding:
|
338
|
+
- gzip, deflate
|
339
|
+
Hawkular-Tenant:
|
340
|
+
- hawkular
|
341
|
+
Content-Type:
|
342
|
+
- application/json
|
343
|
+
User-Agent:
|
344
|
+
- Ruby
|
345
|
+
response:
|
346
|
+
status:
|
347
|
+
code: 200
|
348
|
+
message: OK
|
349
|
+
headers:
|
350
|
+
Expires:
|
351
|
+
- '0'
|
352
|
+
Cache-Control:
|
353
|
+
- no-cache, no-store, must-revalidate
|
354
|
+
X-Powered-By:
|
355
|
+
- Undertow/1
|
356
|
+
Server:
|
357
|
+
- WildFly/10
|
358
|
+
Pragma:
|
359
|
+
- no-cache
|
360
|
+
Date:
|
361
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
362
|
+
Connection:
|
363
|
+
- keep-alive
|
364
|
+
Content-Type:
|
365
|
+
- application/json
|
366
|
+
Content-Length:
|
367
|
+
- '2'
|
368
|
+
body:
|
369
|
+
encoding: UTF-8
|
370
|
+
string: "[]"
|
371
|
+
http_version:
|
372
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
373
|
+
- request:
|
374
|
+
method: get
|
375
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger/dampenings
|
376
|
+
body:
|
377
|
+
encoding: US-ASCII
|
378
|
+
string: ''
|
379
|
+
headers:
|
380
|
+
Accept:
|
381
|
+
- application/json
|
382
|
+
Accept-Encoding:
|
383
|
+
- gzip, deflate
|
384
|
+
Hawkular-Tenant:
|
385
|
+
- hawkular
|
386
|
+
Content-Type:
|
387
|
+
- application/json
|
388
|
+
User-Agent:
|
389
|
+
- Ruby
|
390
|
+
response:
|
391
|
+
status:
|
392
|
+
code: 200
|
393
|
+
message: OK
|
394
|
+
headers:
|
395
|
+
Expires:
|
396
|
+
- '0'
|
397
|
+
Cache-Control:
|
398
|
+
- no-cache, no-store, must-revalidate
|
399
|
+
X-Powered-By:
|
400
|
+
- Undertow/1
|
401
|
+
Server:
|
402
|
+
- WildFly/10
|
403
|
+
Pragma:
|
404
|
+
- no-cache
|
405
|
+
Date:
|
406
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
407
|
+
Connection:
|
408
|
+
- keep-alive
|
409
|
+
Content-Type:
|
410
|
+
- application/json
|
411
|
+
Content-Length:
|
412
|
+
- '2'
|
413
|
+
body:
|
414
|
+
encoding: UTF-8
|
415
|
+
string: "[]"
|
416
|
+
http_version:
|
417
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
418
|
+
- request:
|
419
|
+
method: delete
|
420
|
+
uri: http://jdoe:password@localhost:8080/hawkular/alerts/triggers/my-cool-trigger
|
421
|
+
body:
|
422
|
+
encoding: US-ASCII
|
423
|
+
string: ''
|
424
|
+
headers:
|
425
|
+
Accept:
|
426
|
+
- application/json
|
427
|
+
Accept-Encoding:
|
428
|
+
- gzip, deflate
|
429
|
+
Hawkular-Tenant:
|
430
|
+
- hawkular
|
431
|
+
Content-Type:
|
432
|
+
- application/json
|
433
|
+
User-Agent:
|
434
|
+
- Ruby
|
435
|
+
response:
|
436
|
+
status:
|
437
|
+
code: 200
|
438
|
+
message: OK
|
439
|
+
headers:
|
440
|
+
Expires:
|
441
|
+
- '0'
|
442
|
+
Cache-Control:
|
443
|
+
- no-cache, no-store, must-revalidate
|
444
|
+
X-Powered-By:
|
445
|
+
- Undertow/1
|
446
|
+
Server:
|
447
|
+
- WildFly/10
|
448
|
+
Pragma:
|
449
|
+
- no-cache
|
450
|
+
Date:
|
451
|
+
- Fri, 01 Jul 2016 13:07:20 GMT
|
452
|
+
Connection:
|
453
|
+
- keep-alive
|
454
|
+
Content-Type:
|
455
|
+
- application/json
|
456
|
+
Content-Length:
|
457
|
+
- '0'
|
458
|
+
body:
|
459
|
+
encoding: UTF-8
|
460
|
+
string: ''
|
461
|
+
http_version:
|
462
|
+
recorded_at: Fri, 01 Jul 2016 13:07:20 GMT
|
463
|
+
recorded_with: VCR 3.0.1
|