hawkular-client 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +19 -2
- data/.travis/wait_for_services.rb +23 -0
- data/CHANGES.rdoc +11 -0
- data/docker-compose.yml +15 -0
- data/lib/hawkular/alerts/alerts_api.rb +24 -0
- data/lib/hawkular/base_client.rb +7 -0
- data/lib/hawkular/inventory/entities.rb +3 -0
- data/lib/hawkular/metrics/metric_api.rb +38 -3
- data/lib/hawkular/metrics/metrics_client.rb +3 -0
- data/lib/hawkular/metrics/tenant_api.rb +2 -2
- data/lib/hawkular/version.rb +1 -1
- data/spec/integration/alert-resources/alerts-test-data.json +40 -0
- data/spec/integration/alert-resources/events-test-data.json +78 -0
- data/spec/integration/alert-resources/triggers-test-data.json +66 -0
- data/spec/integration/alerts_spec.rb +192 -83
- data/spec/integration/hello-world-definitions.json +1 -2
- data/spec/integration/inventory_spec.rb +18 -5
- data/spec/integration/metric_spec.rb +201 -40
- data/spec/integration/operations_spec.rb +45 -1
- data/spec/spec_helper.rb +25 -6
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_acknowledge_an_alert.yml +205 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_fetch_single_alert.yml +108 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts.yml +59 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts_for_trigger.yml +58 -0
- data/spec/vcr_cassettes/Alert/Alerts/{Should_list_alerts_for_unknown_trigger.yml → Templates/Should_list_alerts_for_unknown_trigger.yml} +13 -9
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_open_alerts.yml +59 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_resolve_an_alert.yml +207 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/setup.yml +255 -0
- data/spec/vcr_cassettes/Alert/Alerts/Templates/setup_cleanup.yml +302 -0
- data/spec/vcr_cassettes/Alert/EndToEnd/Templates/Should_create_and_fire_a_trigger.yml +527 -0
- data/spec/vcr_cassettes/{Metrics/NonSecure/metrics_0_16_0/Templates/Gauge_metrics/Should_return_periods.yml → Alert/Events/Templates/Should_create_an_event.yml} +22 -18
- data/spec/vcr_cassettes/{Metrics/NonSecure/metrics_0_16_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml → Alert/Events/Templates/Should_delete_an_event.yml} +28 -24
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events.yml +91 -0
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events_using_criteria.yml +60 -0
- data/spec/vcr_cassettes/Alert/Events/{Should_not_list_events_using_criteria.yml → Templates/Should_not_list_events_using_criteria.yml} +14 -13
- data/spec/vcr_cassettes/Alert/Events/Templates/setup.yml +615 -0
- data/spec/vcr_cassettes/Alert/Events/Templates/setup_cleanup.yml +567 -0
- data/spec/vcr_cassettes/Alert/Groups/{Should_operate_a_complex_group_trigger.yml → Templates/Should_operate_a_complex_group_trigger.yml} +508 -352
- data/spec/vcr_cassettes/{Alerts → Alert/Templates}/Should_return_the_version.yml +10 -8
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers.yml +55 -0
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_ID.yml +56 -0
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tag.yml +56 -0
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tags.yml +56 -0
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_bulk_load_triggers.yml +243 -0
- data/spec/vcr_cassettes/Alert/Triggers/{Should_create_a_basic_trigger_with_action.yml → Templates/Should_create_a_basic_trigger_with_action.yml} +107 -76
- data/spec/vcr_cassettes/Alert/Triggers/{Should_create_a_firing_ALL_ANY_trigger.yml → Templates/Should_create_a_firing_ALL_ANY_trigger.yml} +81 -61
- data/spec/vcr_cassettes/{Metrics/NonSecure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml → Alert/Triggers/Templates/Should_create_an_action.yml} +32 -30
- data/spec/vcr_cassettes/{Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml → Alert/Triggers/Templates/Should_get_a_single_Trigger_with_conditions.yml} +29 -29
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_a_single_metric_Trigger.yml +50 -0
- data/spec/vcr_cassettes/Alert/Triggers/{Should_get_the_action_definitions.yml → Templates/Should_get_the_action_definitions.yml} +46 -73
- data/spec/vcr_cassettes/Alert/Triggers/{Should_not_create_an_action_for_unknown_plugin.yml → Templates/Should_not_create_an_action_for_unknown_plugin.yml} +12 -8
- data/spec/vcr_cassettes/{Metrics/NonSecure/metrics_0_16_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml → Alert/Triggers/Templates/Should_not_create_an_action_for_unknown_properties.yml} +27 -26
- data/spec/vcr_cassettes/Alert/Triggers/Templates/setup.yml +52 -0
- data/spec/vcr_cassettes/{Metrics/NonSecure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml → Alert/Triggers/Templates/setup_cleanup.yml} +51 -51
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +29 -25
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +3 -3
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +5 -5
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +4 -4
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +4 -4
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +4 -4
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +4 -4
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +6 -6
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +8 -8
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml → metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metric_tags_for_metrics_definitions.yml} +159 -53
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +47 -6
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +12 -12
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +17 -17
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +23 -23
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +19 -19
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +12 -12
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +19 -19
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +12 -12
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +5 -5
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +151 -5
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +152 -6
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +33 -33
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +31 -32
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +108 -20
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +26 -26
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +27 -27
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Status/Should_return_the_version.yml → metrics_services/Templates/Mixed_metrics/setup_client.yml} +3 -3
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/No_Tenant/Should_fail.yml +43 -4
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Status/Should_return_the_version.yml +44 -3
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml → metrics_services/Templates/String_metrics/Should_create_string_definition_using_Hash.yml} +9 -9
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml → metrics_services/Templates/String_metrics/Should_create_string_definition_using_MetricDefinition.yml} +9 -9
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml → metrics_services/Templates/String_metrics/Should_push_metric_data_to_existing_string.yml} +27 -27
- data/spec/vcr_cassettes/Metrics/NonSecure/{metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml → metrics_services/Templates/String_metrics/Should_push_metric_data_to_non-existing_string.yml} +15 -15
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tags_Metrics/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +10 -6
- data/spec/vcr_cassettes/Metrics/{Secure/metrics_0_16_0/Templates/Status/Should_return_the_version.yml → NonSecure/metrics_services/Templates/Tenants/setup_client.yml} +5 -5
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/setup_client.yml +44 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +80 -33
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_XA_datasource_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/{Add_datasource_should_be_doable.json → Add_non-XA_datasource_should_be_doable.json} +0 -0
- metadata +111 -156
- data/spec/vcr_cassettes/Alert/Alerts/Should_acknowledge_an_alert.yml +0 -183
- data/spec/vcr_cassettes/Alert/Alerts/Should_fetch_single_alert.yml +0 -69
- data/spec/vcr_cassettes/Alert/Alerts/Should_list_alerts.yml +0 -85
- data/spec/vcr_cassettes/Alert/Alerts/Should_list_alerts_for_trigger.yml +0 -142
- data/spec/vcr_cassettes/Alert/Alerts/Should_resolve_an_alert.yml +0 -181
- data/spec/vcr_cassettes/Alert/Alerts/Should_resolve_an_alert2.yml +0 -49
- data/spec/vcr_cassettes/Alert/EndToEnd/Should_create_and_fire_a_trigger.yml +0 -1187
- data/spec/vcr_cassettes/Alert/Events/Should_create_an_event.yml +0 -50
- data/spec/vcr_cassettes/Alert/Events/Should_list_events.yml +0 -101
- data/spec/vcr_cassettes/Alert/Events/Should_list_events_using_criteria.yml +0 -79
- data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers.yml +0 -62
- data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_ID.yml +0 -55
- data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_Tag.yml +0 -68
- data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_Tags.yml +0 -68
- data/spec/vcr_cassettes/Alert/Triggers/Should_bulk_load_triggers.yml +0 -225
- data/spec/vcr_cassettes/Alert/Triggers/Should_create_an_action.yml +0 -134
- data/spec/vcr_cassettes/Alert/Triggers/Should_create_an_action_for_webhooks.yml +0 -220
- data/spec/vcr_cassettes/Alert/Triggers/Should_get_a_single_Trigger_with_conditions.yml +0 -138
- data/spec/vcr_cassettes/Alert/Triggers/Should_get_a_single_metric_Trigger.yml +0 -50
- data/spec/vcr_cassettes/Alert/Triggers/Should_not_create_an_action_for_unknown_properties.yml +0 -134
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -97
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -326
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/No_Tenant/Should_fail.yml +0 -50
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Simple/Should_be_Cool.yml +0 -48
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -97
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +0 -328
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -144
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -281
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -144
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_return_periods.yml +0 -97
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -326
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -285
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/No_Tenant/Should_fail.yml +0 -50
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Simple/Should_be_Cool.yml +0 -48
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -99
@@ -268,7 +268,7 @@ module Hawkular::Operations::RSpec
|
|
268
268
|
expect(actual_data['message']).to start_with('Performed [Disable Deployment] on')
|
269
269
|
end
|
270
270
|
|
271
|
-
it 'Add datasource should be doable' do
|
271
|
+
it 'Add non-XA datasource should be doable' do
|
272
272
|
wf_server_resource_id = 'Local~~'
|
273
273
|
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
274
274
|
feed_id: @feed_id,
|
@@ -312,6 +312,50 @@ module Hawkular::Operations::RSpec
|
|
312
312
|
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
|
313
313
|
end
|
314
314
|
|
315
|
+
it 'Add XA datasource should be doable' do
|
316
|
+
wf_server_resource_id = 'Local~~'
|
317
|
+
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
318
|
+
feed_id: @feed_id,
|
319
|
+
resource_ids: [wf_server_resource_id]).to_s
|
320
|
+
payload = {
|
321
|
+
# compulsory fields
|
322
|
+
resourcePath: wf_path,
|
323
|
+
xaDatasource: true,
|
324
|
+
datasourceName: 'CreatedByRubyDSXA' + @random_uuid,
|
325
|
+
jndiName: 'java:jboss/datasources/CreatedByRubyDSXA' + @random_uuid,
|
326
|
+
driverName: 'h2',
|
327
|
+
xaDataSourceClass: 'org.h2.jdbcx.JdbcDataSource',
|
328
|
+
# this is probably a bug (driver class should be already defined in driver)
|
329
|
+
driverClass: 'org.h2.Driver',
|
330
|
+
connectionUrl: 'dbc:h2:mem:ruby;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
|
331
|
+
|
332
|
+
# optional
|
333
|
+
datasourceProperties: {
|
334
|
+
someKey: 'someValue'
|
335
|
+
},
|
336
|
+
userName: 'sa',
|
337
|
+
password: 'sa',
|
338
|
+
securityDomain: 'other'
|
339
|
+
}
|
340
|
+
|
341
|
+
actual_data = {}
|
342
|
+
client.add_datasource(payload) do |on|
|
343
|
+
on.success do |data|
|
344
|
+
actual_data[:data] = data
|
345
|
+
end
|
346
|
+
on.failure do |error|
|
347
|
+
actual_data[:data] = { 'status' => 'ERROR' }
|
348
|
+
puts 'error callback was called, reason: ' + error.to_s
|
349
|
+
end
|
350
|
+
end
|
351
|
+
actual_data = wait_for actual_data
|
352
|
+
expect(actual_data['status']).to eq('OK')
|
353
|
+
expect(actual_data['message']).to start_with('Added Datasource')
|
354
|
+
expect(actual_data['xaDatasource']).to be_truthy
|
355
|
+
expect(actual_data['datasourceName']).to eq(payload[:datasourceName])
|
356
|
+
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
|
357
|
+
end
|
358
|
+
|
315
359
|
it 'should not be possible to perform on closed client' do
|
316
360
|
restart = {
|
317
361
|
resource_path: '/t;t1/f;whatever/r;something',
|
data/spec/spec_helper.rb
CHANGED
@@ -34,7 +34,7 @@ module Hawkular::Metrics::RSpec
|
|
34
34
|
options[:tenant] = nil
|
35
35
|
mocked_version = options[:mocked_version]
|
36
36
|
::RSpec::Mocks.with_temporary_scope do
|
37
|
-
mocked_version.nil?
|
37
|
+
mock_metrics_version(mocked_version) unless mocked_version.nil?
|
38
38
|
@client = Hawkular::Metrics::Client.new(entrypoint(options[:type], 'metrics'),
|
39
39
|
credentials(options), options)
|
40
40
|
return @client
|
@@ -46,7 +46,7 @@ module Hawkular::Metrics::RSpec
|
|
46
46
|
options[:tenant] ||= 'hawkular'
|
47
47
|
mocked_version = options[:mocked_version]
|
48
48
|
::RSpec::Mocks.with_temporary_scope do
|
49
|
-
mocked_version.nil?
|
49
|
+
mock_metrics_version(mocked_version) unless mocked_version.nil?
|
50
50
|
@client = Hawkular::Metrics::Client.new(entrypoint(options[:type], 'metrics'),
|
51
51
|
credentials(options), options)
|
52
52
|
end
|
@@ -95,11 +95,11 @@ module Hawkular::Metrics::RSpec
|
|
95
95
|
expect(metric.tenant_id).to eql(tenant_id)
|
96
96
|
end
|
97
97
|
|
98
|
-
def create_metric_using_md(endpoint, id)
|
98
|
+
def create_metric_using_md(endpoint, id, tags = nil)
|
99
99
|
metric = Hawkular::Metrics::MetricDefinition.new
|
100
100
|
metric.id = id
|
101
101
|
metric.data_retention = 90
|
102
|
-
metric.tags = { tag: 'value' }
|
102
|
+
metric.tags = tags.nil? ? { tag: 'value' } : tags
|
103
103
|
endpoint.create(metric)
|
104
104
|
|
105
105
|
created = endpoint.get(metric.id)
|
@@ -137,8 +137,8 @@ module Hawkular::Metrics::RSpec
|
|
137
137
|
end
|
138
138
|
|
139
139
|
module Hawkular::Operations::RSpec
|
140
|
-
SLEEP_SECONDS = 0.
|
141
|
-
MAX_ATTEMPTS =
|
140
|
+
SLEEP_SECONDS = 0.1
|
141
|
+
MAX_ATTEMPTS = 200
|
142
142
|
|
143
143
|
def wait_for(object)
|
144
144
|
fast = WebSocketVCR.cassette && !WebSocketVCR.cassette.recording?
|
@@ -153,6 +153,25 @@ module Hawkular::Operations::RSpec
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
+
def wait_while
|
157
|
+
fast = WebSocketVCR.cassette && !WebSocketVCR.cassette.recording?
|
158
|
+
sleep_interval = SLEEP_SECONDS * (fast ? 1 : 10)
|
159
|
+
sleep_interval *= 5 if ENV['travis']
|
160
|
+
attempt = 0
|
161
|
+
sleep sleep_interval while yield && (attempt += 1) < MAX_ATTEMPTS
|
162
|
+
if attempt == MAX_ATTEMPTS
|
163
|
+
puts 'timeout hit'
|
164
|
+
else
|
165
|
+
return
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def hash_include_all(hash, keys)
|
170
|
+
keys.all? do |key|
|
171
|
+
hash.key? key
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
156
175
|
def host_with_scheme(host, use_secure_connection)
|
157
176
|
"#{use_secure_connection ? 'https' : 'http'}://#{host}"
|
158
177
|
end
|
@@ -0,0 +1,205 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?statuses=OPEN
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 GMT
|
39
|
+
X-Total-Count:
|
40
|
+
- '1'
|
41
|
+
Connection:
|
42
|
+
- keep-alive
|
43
|
+
Content-Type:
|
44
|
+
- application/json
|
45
|
+
Content-Length:
|
46
|
+
- '1235'
|
47
|
+
Link:
|
48
|
+
- <http://localhost:8080/hawkular/alerts/?statuses=OPEN>; rel="current", <http://localhost:8080/hawkular/alerts/?statuses=OPEN&page=0>;
|
49
|
+
rel="last"
|
50
|
+
body:
|
51
|
+
encoding: UTF-8
|
52
|
+
string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90","ctime":1475854594696,"dataSource":"_none_","dataId":"a-trigger","category":"ALERT","text":"Just
|
53
|
+
a trigger","trigger":{"tenantId":"hawkular","id":"a-trigger","name":"A trigger
|
54
|
+
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":1475854594694,"dataTimestamp":1475854594,"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":1475854594696}]}]'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
57
|
+
- request:
|
58
|
+
method: get
|
59
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/alert/a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90
|
60
|
+
body:
|
61
|
+
encoding: US-ASCII
|
62
|
+
string: ''
|
63
|
+
headers:
|
64
|
+
Accept:
|
65
|
+
- application/json
|
66
|
+
Accept-Encoding:
|
67
|
+
- identity
|
68
|
+
User-Agent:
|
69
|
+
- hawkular-client-ruby
|
70
|
+
Hawkular-Tenant:
|
71
|
+
- hawkular
|
72
|
+
Content-Type:
|
73
|
+
- application/json
|
74
|
+
Host:
|
75
|
+
- localhost:8080
|
76
|
+
response:
|
77
|
+
status:
|
78
|
+
code: 200
|
79
|
+
message: OK
|
80
|
+
headers:
|
81
|
+
Expires:
|
82
|
+
- '0'
|
83
|
+
Cache-Control:
|
84
|
+
- no-cache, no-store, must-revalidate
|
85
|
+
X-Powered-By:
|
86
|
+
- Undertow/1
|
87
|
+
Server:
|
88
|
+
- WildFly/10
|
89
|
+
Pragma:
|
90
|
+
- no-cache
|
91
|
+
Date:
|
92
|
+
- Fri, 07 Oct 2016 15:36:35 GMT
|
93
|
+
Connection:
|
94
|
+
- keep-alive
|
95
|
+
Content-Type:
|
96
|
+
- application/json
|
97
|
+
Content-Length:
|
98
|
+
- '1233'
|
99
|
+
body:
|
100
|
+
encoding: UTF-8
|
101
|
+
string: '{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90","ctime":1475854594696,"dataSource":"_none_","dataId":"a-trigger","category":"ALERT","text":"Just
|
102
|
+
a trigger","trigger":{"tenantId":"hawkular","id":"a-trigger","name":"A trigger
|
103
|
+
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":1475854594694,"dataTimestamp":1475854594,"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":1475854594696}]}'
|
104
|
+
http_version:
|
105
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
106
|
+
- request:
|
107
|
+
method: put
|
108
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/ack/a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90?ackBy=Heiko&ackNotes=Hello%20Ruby%20World%20:-)
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 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: Fri, 07 Oct 2016 15:36:35 GMT
|
155
|
+
- request:
|
156
|
+
method: get
|
157
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/alert/a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 GMT
|
191
|
+
Connection:
|
192
|
+
- keep-alive
|
193
|
+
Content-Type:
|
194
|
+
- application/json
|
195
|
+
Content-Length:
|
196
|
+
- '1383'
|
197
|
+
body:
|
198
|
+
encoding: UTF-8
|
199
|
+
string: '{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90","ctime":1475854594696,"dataSource":"_none_","dataId":"a-trigger","category":"ALERT","text":"Just
|
200
|
+
a trigger","trigger":{"tenantId":"hawkular","id":"a-trigger","name":"A trigger
|
201
|
+
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":1475854594694,"dataTimestamp":1475854594,"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":"ACKNOWLEDGED","notes":[{"user":"Heiko","ctime":1475854595365,"text":"Hello
|
202
|
+
Ruby World :-)"}],"lifecycle":[{"status":"OPEN","user":"system","stime":1475854594696},{"status":"ACKNOWLEDGED","user":"Heiko","stime":1475854595365}]}'
|
203
|
+
http_version:
|
204
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
205
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,108 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/?statuses=OPEN
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 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/?statuses=OPEN>; rel="current", <http://localhost:8080/hawkular/alerts/?statuses=OPEN&page=0>;
|
49
|
+
rel="last"
|
50
|
+
body:
|
51
|
+
encoding: UTF-8
|
52
|
+
string: '[{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1475854594696-24e7846e-589b-44ba-b8de-7c35de0b0ebf","ctime":1475854594696,"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":1475854594695,"dataTimestamp":1475854594,"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":1475854594696}]},{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90","ctime":1475854594696,"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":1475854594694,"dataTimestamp":1475854594,"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":1475854594696}]}]'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
59
|
+
- request:
|
60
|
+
method: get
|
61
|
+
uri: http://<%= username %>:<%= password %>@localhost:8080/hawkular/alerts/alert/hello-world-trigger-1475854594696-24e7846e-589b-44ba-b8de-7c35de0b0ebf
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 GMT
|
95
|
+
Connection:
|
96
|
+
- keep-alive
|
97
|
+
Content-Type:
|
98
|
+
- application/json
|
99
|
+
Content-Length:
|
100
|
+
- '1342'
|
101
|
+
body:
|
102
|
+
encoding: UTF-8
|
103
|
+
string: '{"eventType":"ALERT","tenantId":"hawkular","id":"hello-world-trigger-1475854594696-24e7846e-589b-44ba-b8de-7c35de0b0ebf","ctime":1475854594696,"dataSource":"_none_","dataId":"hello-world-trigger","category":"ALERT","text":"A
|
104
|
+
mandatory Hello World Trigger","trigger":{"tenantId":"hawkular","id":"hello-world-trigger","name":"Hello
|
105
|
+
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":1475854594695,"dataTimestamp":1475854594,"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":1475854594696}]}'
|
106
|
+
http_version:
|
107
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
108
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,59 @@
|
|
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
|
+
- Fri, 07 Oct 2016 15:36:35 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-1475854594696-24e7846e-589b-44ba-b8de-7c35de0b0ebf","ctime":1475854594696,"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":1475854594695,"dataTimestamp":1475854594,"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":1475854594696}]},{"eventType":"ALERT","tenantId":"hawkular","id":"a-trigger-1475854594696-89fe86b0-959c-434f-96c3-e627f2376e90","ctime":1475854594696,"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":1475854594694,"dataTimestamp":1475854594,"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":1475854594696}]}]'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Fri, 07 Oct 2016 15:36:35 GMT
|
59
|
+
recorded_with: VCR 3.0.3
|