hawkular-client 0.2.1 → 0.2.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.rdoc +5 -0
  4. data/README.rdoc +4 -4
  5. data/hawkularclient.gemspec +2 -3
  6. data/lib/hawkular.rb +14 -0
  7. data/lib/inventory/inventory_api.rb +67 -42
  8. data/lib/operations/operations_api.rb +2 -5
  9. data/lib/version.rb +1 -1
  10. data/spec/integration/inventory_spec.rb +119 -73
  11. data/spec/integration/operations_spec.rb +29 -54
  12. data/spec/spec_helper.rb +7 -7
  13. data/spec/vcr/vcr_setup.rb +0 -5
  14. data/spec/vcr_cassettes/Inventory/Should_create_a_nested_resource_and_metric_on_it.yml +731 -0
  15. data/spec/vcr_cassettes/Inventory/{Client_should_listen_on_various_inventory_events.yml → Should_list_children_of_nested_resource.yml} +36 -68
  16. data/spec/vcr_cassettes/Inventory/Should_return_config_data_of_given_nested_resource.yml +58 -0
  17. data/spec/vcr_cassettes/{Operation/Helpers/get_tenant.yml → Inventory/Should_return_config_data_of_given_resource.yml} +13 -6
  18. metadata +42 -87
  19. data/spec/vcr_cassettes/Inventory/Client_should_listen_on_various_inventory_events.json +0 -47
  20. data/spec/vcr_cassettes/Inventory/Helpers/generate_some_events_for_websocket.yml +0 -507
  21. data/spec/vcr_cassettes/Inventory/Tenants/Should_Get_Tenant_For_Explicit_Credentials.yml +0 -50
  22. data/spec/vcr_cassettes/Inventory/Tenants/Should_Get_Tenant_For_Implicit_Credentials.yml +0 -50
  23. data/spec/vcr_cassettes/Operation/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -26
  24. data/spec/vcr_cassettes/Operation/Operation/Add_datasource_should_be_doable.json +0 -26
  25. data/spec/vcr_cassettes/Operation/Operation/Add_deployment_should_be_doable.json +0 -26
  26. data/spec/vcr_cassettes/Operation/Operation/Redeploy_can_be_run_multiple_times_in_parallel.json +0 -40
  27. data/spec/vcr_cassettes/Operation/Operation/Redeploy_should_be_performed_and_eventually_respond_with_success.json +0 -26
  28. data/spec/vcr_cassettes/Operation/Operation/Redeploy_should_not_be_performed_if_resource_path_is_wrong.json +0 -26
  29. data/spec/vcr_cassettes/Operation/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -26
  30. data/spec/vcr_cassettes/Operation/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -26
  31. data/spec/vcr_cassettes/Operation/Operation/Remove_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -26
  32. data/spec/vcr_cassettes/Operation/Operation/Undeploy_should_be_performed_and_eventually_respond_with_success.json +0 -26
  33. data/spec/vcr_cassettes/Operation/Operation/should_not_be_possible_to_perform_on_closed_client.json +0 -12
  34. data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established.json +0 -9
@@ -5,72 +5,40 @@ require 'securerandom'
5
5
  include Hawkular::Inventory
6
6
  include Hawkular::Operations
7
7
 
8
- # examples for operations, it uses the websocket communication
8
+ # WebSocket communication cannot be faked via VCR cassettes
9
9
  module Hawkular::Operations::RSpec
10
10
  HOST = 'localhost:8080'
11
- describe 'Operation/Websocket connection', vcr: { decode_compressed_response: true } do
12
- let(:example) do |e|
13
- e
14
- end
15
-
16
- it 'should be established' do
17
- VCR::WebSocket.configure do |c|
18
- c.hook_uris = [HOST]
19
- end
20
-
21
- VCR::WebSocket.record(example, self) do
22
- client = OperationsClient.new(host: HOST,
23
- wait_time: 0,
24
- credentials: {
25
- username: 'jdoe',
26
- password: 'password'
27
- })
28
- ws = client.ws
29
- expect(ws).not_to be nil
30
- expect(ws.open?).to be true
31
- end
11
+ describe 'Websocket connection' do
12
+ it 'should be established', :websocket do
13
+ client = OperationsClient.new(host: HOST,
14
+ credentials: {
15
+ username: 'jdoe',
16
+ password: 'password'
17
+ })
18
+ ws = client.ws
19
+ expect(ws).not_to be nil
20
+ expect(ws.open?).to be true
32
21
  end
33
22
  end
34
23
 
35
- describe 'Operation/Operation', :websocket, vcr: { decode_compressed_response: true } do
36
- let(:example) do |e|
37
- e
38
- end
39
-
24
+ describe 'Operation', :websocket do
40
25
  before(:all) do
41
- # TODO: erb substitution
42
- VCR.use_cassette('Operation/Helpers/get_tenant', decode_compressed_response: true) do
43
- @creds = { username: 'jdoe', password: 'password' }
44
- inventory_client = InventoryClient.create(credentials: @creds)
45
- @tenant_id = inventory_client.get_tenant
46
- # @feed_id = inventory_client.list_feeds[0]
47
- @feed_id = '41df9f9c-72a6-457b-a0ee-ee1740846254'
48
- # @random_uuid = SecureRandom.uuid comment this out once the erb support is there
49
- @random_uuid = 'random'
50
- end
26
+ VCR.turn_off!(ignore_cassettes: true)
27
+ WebMock.allow_net_connect!
28
+ @creds = { username: 'jdoe', password: 'password' }
29
+ inventory_client = InventoryClient.new(credentials: @creds)
30
+ @tenant_id = inventory_client.get_tenant
31
+ @feed_id = inventory_client.list_feeds[0]
32
+ @random_uuid = SecureRandom.uuid
51
33
  end
52
34
 
53
35
  before(:each) do |ex|
54
36
  unless ex.metadata[:skip_open]
55
- @client = OperationsClient.new(credentials: @creds,
56
- wait_time: 0)
37
+ @client = OperationsClient.new(credentials: @creds)
57
38
  @ws = @client.ws
58
39
  end
59
40
  end
60
41
 
61
- around(:each) do |ex|
62
- if ex.metadata[:websocket]
63
- VCR::WebSocket.configure do |c|
64
- c.hook_uris = [HOST]
65
- end
66
- VCR::WebSocket.record(ex, self) do
67
- ex.run
68
- end
69
- else
70
- ex.run
71
- end
72
- end
73
-
74
42
  after(:each) do |ex|
75
43
  unless ex.metadata[:skip_close]
76
44
  @client.close_connection!
@@ -79,6 +47,13 @@ module Hawkular::Operations::RSpec
79
47
  end
80
48
  end
81
49
 
50
+ after(:all) do
51
+ if ENV['VCR_OFF'] != '1'
52
+ VCR.turn_on!
53
+ WebMock.disable_net_connect!
54
+ end
55
+ end
56
+
82
57
  it 'Add JDBC driver should add the driver' do
83
58
  wf_server_resource_id = 'Local~~'
84
59
  driver_name = 'CreatedByRubyDriver' + @random_uuid
@@ -162,7 +137,7 @@ module Hawkular::Operations::RSpec
162
137
  expect(actual_data[:error]).to start_with('Could not perform [Redeploy] on')
163
138
  end
164
139
 
165
- it 'Undeploy should be performed and eventually respond with success' do
140
+ it 'Disable/Undeploy should be performed and eventually respond with success' do
166
141
  wf_server_resource_id = 'Local~~'
167
142
  alerts_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-alerts-actions-email.war'
168
143
  path = CanonicalPath.new(tenant_id: @tenant_id,
@@ -292,7 +267,7 @@ module Hawkular::Operations::RSpec
292
267
  expect(actual_data['message']).to start_with('Performed [Redeploy] on')
293
268
  end
294
269
 
295
- it 'Add deployment should be doable' do
270
+ it 'add deployment should be doable' do
296
271
  wf_server_resource_id = 'Local~~'
297
272
  app_name = 'sample.war'
298
273
  war_file = IO.binread("#{File.dirname(__FILE__)}/../resources/#{app_name}")
@@ -34,12 +34,11 @@ module Hawkular::Metrics::RSpec
34
34
  end
35
35
 
36
36
  module Hawkular::Operations::RSpec
37
- SLEEP_SECONDS = 0.04
38
- MAX_ATTEMPTS = 60
37
+ SLEEP_SECONDS = 0.05
38
+ MAX_ATTEMPTS = 50
39
39
 
40
40
  def wait_for(object)
41
- fast = VCR::WebSocket.cassette && !VCR::WebSocket.cassette.recording?
42
- sleep_interval = SLEEP_SECONDS * (fast ? 1 : 10)
41
+ sleep_interval = SLEEP_SECONDS * (ENV['VCR_OFF'] == '1' ? 1 : 10)
43
42
  attempt = 0
44
43
  sleep sleep_interval while object[:data].nil? && (attempt += 1) < MAX_ATTEMPTS
45
44
  if attempt == MAX_ATTEMPTS
@@ -55,8 +54,10 @@ RSpec.configure do |config|
55
54
  config.include Hawkular::Metrics::RSpec
56
55
  config.include Hawkular::Operations::RSpec
57
56
 
58
- # skip the tests that have the :skip metadata on them
59
- config.filter_run_excluding :skip
57
+ # skip the tests that require websocket communication (cannot be recorded by VCR)
58
+ if ENV['WEBSOCKET_ON'].nil? || ENV['WEBSOCKET_ON'] != '1'
59
+ config.filter_run_excluding :websocket
60
+ end
60
61
 
61
62
  # Sometimes one wants to check if the real api has
62
63
  # changed, so turn off VCR and use live connections
@@ -64,7 +65,6 @@ RSpec.configure do |config|
64
65
  if ENV['VCR_OFF'] == '1'
65
66
  VCR.eject_cassette
66
67
  VCR.turn_off!(ignore_cassettes: true)
67
- VCR::WebSocket.turn_off!
68
68
  WebMock.allow_net_connect!
69
69
  puts 'VCR is turned off!'
70
70
  end
@@ -1,5 +1,4 @@
1
1
  require 'vcr'
2
- require 'simple_websocket_vcr'
3
2
  require 'webmock'
4
3
 
5
4
  VCR.configure do |c|
@@ -9,7 +8,3 @@ VCR.configure do |c|
9
8
  c.debug_logger = File.open('spec/vcr.log', 'w')
10
9
  c.configure_rspec_metadata!
11
10
  end
12
-
13
- VCR::WebSocket.configure do |c|
14
- c.cassette_library_dir = 'spec/vcr_cassettes'
15
- end
@@ -0,0 +1,731 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"properties":{},"id":"feed_may_exist","name":null,"outgoing":{},"incoming":{}}'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '79'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 409
23
+ message: Conflict
24
+ headers:
25
+ Expires:
26
+ - '0'
27
+ Cache-Control:
28
+ - no-cache, no-store, must-revalidate
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/10
33
+ Pragma:
34
+ - no-cache
35
+ Date:
36
+ - Thu, 21 Apr 2016 14:01:18 GMT
37
+ Connection:
38
+ - keep-alive
39
+ Content-Type:
40
+ - application/json
41
+ Content-Length:
42
+ - '747'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: |-
46
+ {
47
+ "errorMsg" : "Feed with id 'Feed[path='/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist']' has been already registered. Entity with id 'feed_may_exist' already exists at some of the positions: [[Types[Tenant], Ids[28026b36-8fe4-4332-84c8-524e173a68bf], Related[, rel='contains', role=SOURCE], Types[Feed], Ids[feed_may_exist]]]",
48
+ "details" : {
49
+ "entityId" : "feed_may_exist",
50
+ "paths" : [ [ {
51
+ "types" : [ "org.hawkular.inventory.api.model.Tenant" ]
52
+ }, {
53
+ "ids" : [ "28026b36-8fe4-4332-84c8-524e173a68bf" ]
54
+ }, {
55
+ "relationshipName" : "contains",
56
+ "entityRole" : "SOURCE"
57
+ }, {
58
+ "types" : [ "org.hawkular.inventory.api.model.Feed" ]
59
+ }, {
60
+ "ids" : [ "feed_may_exist" ]
61
+ } ] ]
62
+ }
63
+ }
64
+ http_version:
65
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
66
+ - request:
67
+ method: get
68
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist
69
+ body:
70
+ encoding: US-ASCII
71
+ string: ''
72
+ headers:
73
+ Accept:
74
+ - application/json
75
+ Accept-Encoding:
76
+ - gzip, deflate
77
+ Content-Type:
78
+ - application/json
79
+ User-Agent:
80
+ - Ruby
81
+ response:
82
+ status:
83
+ code: 200
84
+ message: OK
85
+ headers:
86
+ Expires:
87
+ - '0'
88
+ Cache-Control:
89
+ - no-cache, no-store, must-revalidate
90
+ X-Powered-By:
91
+ - Undertow/1
92
+ Server:
93
+ - WildFly/10
94
+ Pragma:
95
+ - no-cache
96
+ Date:
97
+ - Thu, 21 Apr 2016 14:01:18 GMT
98
+ Connection:
99
+ - keep-alive
100
+ Content-Type:
101
+ - application/json
102
+ Content-Length:
103
+ - '100'
104
+ body:
105
+ encoding: ASCII-8BIT
106
+ string: |-
107
+ {
108
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist",
109
+ "id" : "feed_may_exist"
110
+ }
111
+ http_version:
112
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
113
+ - request:
114
+ method: post
115
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resourceTypes
116
+ body:
117
+ encoding: UTF-8
118
+ string: '{"properties":{},"id":"rt-123-1","name":"ResourceType","outgoing":{},"incoming":{}}'
119
+ headers:
120
+ Accept:
121
+ - application/json
122
+ Accept-Encoding:
123
+ - gzip, deflate
124
+ Content-Type:
125
+ - application/json
126
+ Content-Length:
127
+ - '83'
128
+ User-Agent:
129
+ - Ruby
130
+ response:
131
+ status:
132
+ code: 409
133
+ message: Conflict
134
+ headers:
135
+ Expires:
136
+ - '0'
137
+ Cache-Control:
138
+ - no-cache, no-store, must-revalidate
139
+ X-Powered-By:
140
+ - Undertow/1
141
+ Server:
142
+ - WildFly/10
143
+ Pragma:
144
+ - no-cache
145
+ Date:
146
+ - Thu, 21 Apr 2016 14:01:18 GMT
147
+ Connection:
148
+ - keep-alive
149
+ Content-Type:
150
+ - application/json
151
+ Content-Length:
152
+ - '107'
153
+ body:
154
+ encoding: ASCII-8BIT
155
+ string: |-
156
+ {
157
+ "errorMsg" : "Entity with id 'null' already exists at some of the positions: null",
158
+ "details" : { }
159
+ }
160
+ http_version:
161
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
162
+ - request:
163
+ method: get
164
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resourceTypes/rt-123-1
165
+ body:
166
+ encoding: US-ASCII
167
+ string: ''
168
+ headers:
169
+ Accept:
170
+ - application/json
171
+ Accept-Encoding:
172
+ - gzip, deflate
173
+ Content-Type:
174
+ - application/json
175
+ User-Agent:
176
+ - Ruby
177
+ response:
178
+ status:
179
+ code: 200
180
+ message: OK
181
+ headers:
182
+ Expires:
183
+ - '0'
184
+ Cache-Control:
185
+ - no-cache, no-store, must-revalidate
186
+ X-Powered-By:
187
+ - Undertow/1
188
+ Server:
189
+ - WildFly/10
190
+ Pragma:
191
+ - no-cache
192
+ Date:
193
+ - Thu, 21 Apr 2016 14:01:18 GMT
194
+ Connection:
195
+ - keep-alive
196
+ Content-Type:
197
+ - application/json
198
+ Content-Length:
199
+ - '133'
200
+ body:
201
+ encoding: ASCII-8BIT
202
+ string: |-
203
+ {
204
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/rt;rt-123-1",
205
+ "name" : "ResourceType",
206
+ "id" : "rt-123-1"
207
+ }
208
+ http_version:
209
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
210
+ - request:
211
+ method: post
212
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources
213
+ body:
214
+ encoding: UTF-8
215
+ string: '{"properties":{},"id":"r124-a","name":"Res-a","outgoing":{},"incoming":{},"resourceTypePath":"/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/rt;rt-123-1"}'
216
+ headers:
217
+ Accept:
218
+ - application/json
219
+ Accept-Encoding:
220
+ - gzip, deflate
221
+ Content-Type:
222
+ - application/json
223
+ Content-Length:
224
+ - '164'
225
+ User-Agent:
226
+ - Ruby
227
+ response:
228
+ status:
229
+ code: 409
230
+ message: Conflict
231
+ headers:
232
+ Expires:
233
+ - '0'
234
+ Cache-Control:
235
+ - no-cache, no-store, must-revalidate
236
+ X-Powered-By:
237
+ - Undertow/1
238
+ Server:
239
+ - WildFly/10
240
+ Pragma:
241
+ - no-cache
242
+ Date:
243
+ - Thu, 21 Apr 2016 14:01:18 GMT
244
+ Connection:
245
+ - keep-alive
246
+ Content-Type:
247
+ - application/json
248
+ Content-Length:
249
+ - '107'
250
+ body:
251
+ encoding: ASCII-8BIT
252
+ string: |-
253
+ {
254
+ "errorMsg" : "Entity with id 'null' already exists at some of the positions: null",
255
+ "details" : { }
256
+ }
257
+ http_version:
258
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
259
+ - request:
260
+ method: get
261
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a
262
+ body:
263
+ encoding: US-ASCII
264
+ string: ''
265
+ headers:
266
+ Accept:
267
+ - application/json
268
+ Accept-Encoding:
269
+ - gzip, deflate
270
+ Content-Type:
271
+ - application/json
272
+ User-Agent:
273
+ - Ruby
274
+ response:
275
+ status:
276
+ code: 200
277
+ message: OK
278
+ headers:
279
+ Expires:
280
+ - '0'
281
+ Cache-Control:
282
+ - no-cache, no-store, must-revalidate
283
+ X-Powered-By:
284
+ - Undertow/1
285
+ Server:
286
+ - WildFly/10
287
+ Pragma:
288
+ - no-cache
289
+ Date:
290
+ - Thu, 21 Apr 2016 14:01:18 GMT
291
+ Connection:
292
+ - keep-alive
293
+ Content-Type:
294
+ - application/json
295
+ Content-Length:
296
+ - '275'
297
+ body:
298
+ encoding: ASCII-8BIT
299
+ string: |-
300
+ {
301
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/r;r124-a",
302
+ "type" : {
303
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/rt;rt-123-1",
304
+ "name" : "ResourceType",
305
+ "id" : "rt-123-1"
306
+ },
307
+ "name" : "Res-a",
308
+ "id" : "r124-a"
309
+ }
310
+ http_version:
311
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
312
+ - request:
313
+ method: post
314
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a
315
+ body:
316
+ encoding: UTF-8
317
+ string: '{"properties":{},"id":"r124-b","name":"Res-a","outgoing":{},"incoming":{},"resourceTypePath":"/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/rt;rt-123-1"}'
318
+ headers:
319
+ Accept:
320
+ - application/json
321
+ Accept-Encoding:
322
+ - gzip, deflate
323
+ Content-Type:
324
+ - application/json
325
+ Content-Length:
326
+ - '164'
327
+ User-Agent:
328
+ - Ruby
329
+ response:
330
+ status:
331
+ code: 409
332
+ message: Conflict
333
+ headers:
334
+ Expires:
335
+ - '0'
336
+ Cache-Control:
337
+ - no-cache, no-store, must-revalidate
338
+ X-Powered-By:
339
+ - Undertow/1
340
+ Server:
341
+ - WildFly/10
342
+ Pragma:
343
+ - no-cache
344
+ Date:
345
+ - Thu, 21 Apr 2016 14:01:18 GMT
346
+ Connection:
347
+ - keep-alive
348
+ Content-Type:
349
+ - application/json
350
+ Content-Length:
351
+ - '107'
352
+ body:
353
+ encoding: ASCII-8BIT
354
+ string: |-
355
+ {
356
+ "errorMsg" : "Entity with id 'null' already exists at some of the positions: null",
357
+ "details" : { }
358
+ }
359
+ http_version:
360
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
361
+ - request:
362
+ method: get
363
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a/r124-b
364
+ body:
365
+ encoding: US-ASCII
366
+ string: ''
367
+ headers:
368
+ Accept:
369
+ - application/json
370
+ Accept-Encoding:
371
+ - gzip, deflate
372
+ Content-Type:
373
+ - application/json
374
+ User-Agent:
375
+ - Ruby
376
+ response:
377
+ status:
378
+ code: 200
379
+ message: OK
380
+ headers:
381
+ Expires:
382
+ - '0'
383
+ Cache-Control:
384
+ - no-cache, no-store, must-revalidate
385
+ X-Powered-By:
386
+ - Undertow/1
387
+ Server:
388
+ - WildFly/10
389
+ Pragma:
390
+ - no-cache
391
+ Date:
392
+ - Thu, 21 Apr 2016 14:01:18 GMT
393
+ Connection:
394
+ - keep-alive
395
+ Content-Type:
396
+ - application/json
397
+ Content-Length:
398
+ - '284'
399
+ body:
400
+ encoding: ASCII-8BIT
401
+ string: |-
402
+ {
403
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/r;r124-a/r;r124-b",
404
+ "type" : {
405
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/rt;rt-123-1",
406
+ "name" : "ResourceType",
407
+ "id" : "rt-123-1"
408
+ },
409
+ "name" : "Res-a",
410
+ "id" : "r124-b"
411
+ }
412
+ http_version:
413
+ recorded_at: Thu, 21 Apr 2016 14:01:18 GMT
414
+ - request:
415
+ method: post
416
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/metricTypes
417
+ body:
418
+ encoding: UTF-8
419
+ string: '{"id":"mt-124-a","type":"GAUGE","unit":"NONE","collectionInterval":60}'
420
+ headers:
421
+ Accept:
422
+ - application/json
423
+ Accept-Encoding:
424
+ - gzip, deflate
425
+ Content-Type:
426
+ - application/json
427
+ Content-Length:
428
+ - '70'
429
+ User-Agent:
430
+ - Ruby
431
+ response:
432
+ status:
433
+ code: 409
434
+ message: Conflict
435
+ headers:
436
+ Expires:
437
+ - '0'
438
+ Cache-Control:
439
+ - no-cache, no-store, must-revalidate
440
+ X-Powered-By:
441
+ - Undertow/1
442
+ Server:
443
+ - WildFly/10
444
+ Pragma:
445
+ - no-cache
446
+ Date:
447
+ - Thu, 21 Apr 2016 14:01:19 GMT
448
+ Connection:
449
+ - keep-alive
450
+ Content-Type:
451
+ - application/json
452
+ Content-Length:
453
+ - '107'
454
+ body:
455
+ encoding: ASCII-8BIT
456
+ string: |-
457
+ {
458
+ "errorMsg" : "Entity with id 'null' already exists at some of the positions: null",
459
+ "details" : { }
460
+ }
461
+ http_version:
462
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
463
+ - request:
464
+ method: get
465
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/metricTypes/mt-124-a
466
+ body:
467
+ encoding: US-ASCII
468
+ string: ''
469
+ headers:
470
+ Accept:
471
+ - application/json
472
+ Accept-Encoding:
473
+ - gzip, deflate
474
+ Content-Type:
475
+ - application/json
476
+ User-Agent:
477
+ - Ruby
478
+ response:
479
+ status:
480
+ code: 200
481
+ message: OK
482
+ headers:
483
+ Expires:
484
+ - '0'
485
+ Cache-Control:
486
+ - no-cache, no-store, must-revalidate
487
+ X-Powered-By:
488
+ - Undertow/1
489
+ Server:
490
+ - WildFly/10
491
+ Pragma:
492
+ - no-cache
493
+ Date:
494
+ - Thu, 21 Apr 2016 14:01:19 GMT
495
+ Connection:
496
+ - keep-alive
497
+ Content-Type:
498
+ - application/json
499
+ Content-Length:
500
+ - '174'
501
+ body:
502
+ encoding: ASCII-8BIT
503
+ string: |-
504
+ {
505
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/mt;mt-124-a",
506
+ "unit" : "NONE",
507
+ "type" : "GAUGE",
508
+ "collectionInterval" : 60,
509
+ "id" : "mt-124-a"
510
+ }
511
+ http_version:
512
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
513
+ - request:
514
+ method: post
515
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/metrics
516
+ body:
517
+ encoding: UTF-8
518
+ string: '{"id":"m-124-a","name":"MetricUnderNestedResource","metricTypePath":"/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/mt;mt-124-a"}'
519
+ headers:
520
+ Accept:
521
+ - application/json
522
+ Accept-Encoding:
523
+ - gzip, deflate
524
+ Content-Type:
525
+ - application/json
526
+ Content-Length:
527
+ - '139'
528
+ User-Agent:
529
+ - Ruby
530
+ response:
531
+ status:
532
+ code: 409
533
+ message: Conflict
534
+ headers:
535
+ Expires:
536
+ - '0'
537
+ Cache-Control:
538
+ - no-cache, no-store, must-revalidate
539
+ X-Powered-By:
540
+ - Undertow/1
541
+ Server:
542
+ - WildFly/10
543
+ Pragma:
544
+ - no-cache
545
+ Date:
546
+ - Thu, 21 Apr 2016 14:01:19 GMT
547
+ Connection:
548
+ - keep-alive
549
+ Content-Type:
550
+ - application/json
551
+ Content-Length:
552
+ - '107'
553
+ body:
554
+ encoding: ASCII-8BIT
555
+ string: |-
556
+ {
557
+ "errorMsg" : "Entity with id 'null' already exists at some of the positions: null",
558
+ "details" : { }
559
+ }
560
+ http_version:
561
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
562
+ - request:
563
+ method: get
564
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/metrics/m-124-a
565
+ body:
566
+ encoding: US-ASCII
567
+ string: ''
568
+ headers:
569
+ Accept:
570
+ - application/json
571
+ Accept-Encoding:
572
+ - gzip, deflate
573
+ Content-Type:
574
+ - application/json
575
+ User-Agent:
576
+ - Ruby
577
+ response:
578
+ status:
579
+ code: 200
580
+ message: OK
581
+ headers:
582
+ Expires:
583
+ - '0'
584
+ Cache-Control:
585
+ - no-cache, no-store, must-revalidate
586
+ X-Powered-By:
587
+ - Undertow/1
588
+ Server:
589
+ - WildFly/10
590
+ Pragma:
591
+ - no-cache
592
+ Date:
593
+ - Thu, 21 Apr 2016 14:01:19 GMT
594
+ Connection:
595
+ - keep-alive
596
+ Content-Type:
597
+ - application/json
598
+ Content-Length:
599
+ - '342'
600
+ body:
601
+ encoding: ASCII-8BIT
602
+ string: |-
603
+ {
604
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/m;m-124-a",
605
+ "type" : {
606
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/mt;mt-124-a",
607
+ "unit" : "NONE",
608
+ "type" : "GAUGE",
609
+ "collectionInterval" : 60,
610
+ "id" : "mt-124-a"
611
+ },
612
+ "name" : "MetricUnderNestedResource",
613
+ "id" : "m-124-a"
614
+ }
615
+ http_version:
616
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
617
+ - request:
618
+ method: post
619
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a/r124-b/metrics
620
+ body:
621
+ encoding: UTF-8
622
+ string: '["/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/m;m-124-a"]'
623
+ headers:
624
+ Accept:
625
+ - application/json
626
+ Accept-Encoding:
627
+ - gzip, deflate
628
+ Content-Type:
629
+ - application/json
630
+ Content-Length:
631
+ - '70'
632
+ User-Agent:
633
+ - Ruby
634
+ response:
635
+ status:
636
+ code: 409
637
+ message: Conflict
638
+ headers:
639
+ Expires:
640
+ - '0'
641
+ Cache-Control:
642
+ - no-cache, no-store, must-revalidate
643
+ X-Powered-By:
644
+ - Undertow/1
645
+ Server:
646
+ - WildFly/10
647
+ Pragma:
648
+ - no-cache
649
+ Date:
650
+ - Thu, 21 Apr 2016 14:01:19 GMT
651
+ Connection:
652
+ - keep-alive
653
+ Content-Type:
654
+ - application/json
655
+ Content-Length:
656
+ - '381'
657
+ body:
658
+ encoding: ASCII-8BIT
659
+ string: |-
660
+ {
661
+ "errorMsg" : "Relation with id 'incorporates' already exists at some of the positions: [[CanonicalPaths[/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/r;r124-a/r;r124-b]]]",
662
+ "details" : {
663
+ "relationshipNameOrId" : "incorporates",
664
+ "paths" : [ [ {
665
+ "paths" : [ "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/r;r124-a/r;r124-b" ]
666
+ } ] ]
667
+ }
668
+ }
669
+ http_version:
670
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
671
+ - request:
672
+ method: get
673
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a/r124-b/metrics
674
+ body:
675
+ encoding: US-ASCII
676
+ string: ''
677
+ headers:
678
+ Accept:
679
+ - application/json
680
+ Accept-Encoding:
681
+ - gzip, deflate
682
+ Content-Type:
683
+ - application/json
684
+ User-Agent:
685
+ - Ruby
686
+ response:
687
+ status:
688
+ code: 200
689
+ message: OK
690
+ headers:
691
+ Expires:
692
+ - '0'
693
+ Cache-Control:
694
+ - no-cache, no-store, must-revalidate
695
+ X-Powered-By:
696
+ - Undertow/1
697
+ Server:
698
+ - WildFly/10
699
+ Pragma:
700
+ - no-cache
701
+ Date:
702
+ - Thu, 21 Apr 2016 14:01:19 GMT
703
+ X-Total-Count:
704
+ - '1'
705
+ Connection:
706
+ - keep-alive
707
+ Content-Type:
708
+ - application/json
709
+ Content-Length:
710
+ - '346'
711
+ Link:
712
+ - <http://localhost:8080/hawkular/inventory/feeds/feed_may_exist/resources/r124-a/r124-b/metrics>;
713
+ rel="current"
714
+ body:
715
+ encoding: ASCII-8BIT
716
+ string: |-
717
+ [ {
718
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/m;m-124-a",
719
+ "type" : {
720
+ "path" : "/t;28026b36-8fe4-4332-84c8-524e173a68bf/f;feed_may_exist/mt;mt-124-a",
721
+ "unit" : "NONE",
722
+ "type" : "GAUGE",
723
+ "collectionInterval" : 60,
724
+ "id" : "mt-124-a"
725
+ },
726
+ "name" : "MetricUnderNestedResource",
727
+ "id" : "m-124-a"
728
+ } ]
729
+ http_version:
730
+ recorded_at: Thu, 21 Apr 2016 14:01:19 GMT
731
+ recorded_with: VCR 3.0.1