hawkular-client 2.9.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.rdoc +27 -0
- data/README.rdoc +14 -14
- data/lib/hawkular/alerts/alerts_api.rb +43 -7
- data/lib/hawkular/client_utils.rb +0 -3
- data/lib/hawkular/hawkular_client.rb +1 -1
- data/lib/hawkular/inventory/entities.rb +55 -19
- data/lib/hawkular/inventory/inventory_api.rb +313 -412
- data/lib/hawkular/metrics/metric_api.rb +5 -2
- data/lib/hawkular/operations/operations_api.rb +0 -8
- data/lib/hawkular/tokens/tokens_api.rb +0 -3
- data/lib/hawkular/version.rb +1 -1
- metadata +3 -647
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -56
- data/.rubocop.yml +0 -32
- data/.travis.yml +0 -20
- data/.travis/start_hawkular_services.sh +0 -21
- data/.travis/wait_for_services.rb +0 -39
- data/.yardopts +0 -1
- data/Gemfile +0 -2
- data/Rakefile +0 -20
- data/api_breaking_changes.rdoc +0 -84
- data/docker-compose.yml +0 -17
- data/hawkularclient.gemspec +0 -43
- data/spec/README.rdoc +0 -62
- data/spec/integration/alert-resources/alerts-test-data.json +0 -40
- data/spec/integration/alert-resources/events-test-data.json +0 -78
- data/spec/integration/alert-resources/triggers-test-data.json +0 -66
- data/spec/integration/alerts_spec.rb +0 -774
- data/spec/integration/env_config_spec.rb +0 -39
- data/spec/integration/hawkular_client_spec.rb +0 -304
- data/spec/integration/hello-world-definitions.json +0 -45
- data/spec/integration/inventory_spec.rb +0 -680
- data/spec/integration/logger_spec.rb +0 -36
- data/spec/integration/metric_spec.rb +0 -953
- data/spec/integration/operations_spec.rb +0 -591
- data/spec/integration/tokens_spec.rb +0 -49
- data/spec/resources/driver.jar +0 -0
- data/spec/resources/sample.war +0 -0
- data/spec/spec_helper.rb +0 -336
- data/spec/unit/base_spec.rb +0 -256
- data/spec/unit/canonical_path_spec.rb +0 -102
- data/spec/unit/client_spec.rb +0 -55
- data/spec/unit/deprecations_spec.rb +0 -19
- data/spec/vcr/vcr_setup.rb +0 -16
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_acknowledge_an_alert.yml +0 -205
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_add_tags_to_existing_alert.yml +0 -210
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_fetch_single_alert.yml +0 -108
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts.yml +0 -59
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts_for_trigger.yml +0 -58
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts_for_unknown_trigger.yml +0 -50
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_open_alerts.yml +0 -59
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_remove_tags_from_existing_alert.yml +0 -257
- data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_resolve_an_alert.yml +0 -207
- data/spec/vcr_cassettes/Alert/Alerts/Templates/setup.yml +0 -255
- data/spec/vcr_cassettes/Alert/Alerts/Templates/setup_cleanup.yml +0 -302
- data/spec/vcr_cassettes/Alert/EndToEnd/Templates/Should_create_and_fire_a_trigger.yml +0 -527
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_create_an_event.yml +0 -101
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_delete_an_event.yml +0 -148
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events.yml +0 -91
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events_using_criteria.yml +0 -60
- data/spec/vcr_cassettes/Alert/Events/Templates/Should_not_list_events_using_criteria.yml +0 -50
- data/spec/vcr_cassettes/Alert/Events/Templates/setup.yml +0 -615
- data/spec/vcr_cassettes/Alert/Events/Templates/setup_cleanup.yml +0 -567
- data/spec/vcr_cassettes/Alert/Groups/Templates/Should_operate_a_complex_group_trigger.yml +0 -1882
- data/spec/vcr_cassettes/Alert/Templates/Should_return_the_version.yml +0 -42
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers.yml +0 -55
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_ID.yml +0 -56
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tag.yml +0 -56
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tags.yml +0 -56
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_bulk_load_triggers.yml +0 -243
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_a_basic_trigger_with_action.yml +0 -386
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_a_firing_ALL_ANY_trigger.yml +0 -483
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_an_action.yml +0 -146
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_a_single_Trigger_with_conditions.yml +0 -144
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_a_single_metric_Trigger.yml +0 -50
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_the_action_definitions.yml +0 -228
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_not_create_an_action_for_unknown_plugin.yml +0 -50
- data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_not_create_an_action_for_unknown_properties.yml +0 -100
- data/spec/vcr_cassettes/Alert/Triggers/Templates/setup.yml +0 -52
- data/spec/vcr_cassettes/Alert/Triggers/Templates/setup_cleanup.yml +0 -285
- data/spec/vcr_cassettes/HawkularClient/Should_err_on_bad_credentials.yml +0 -42
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_create_and_delete_feed.yml +0 -317
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_list_WildFlys.yml +0 -103
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_list_types_with_bad_feed.yml +0 -103
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_same_types_when_param_is_given.yml +0 -325
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_the_same_feeds.yml +0 -117
- data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_the_same_resource_types.yml +0 -111
- data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_create_and_retrieve_tags_for_Availability.yml +0 -155
- data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_create_and_return_Availability_using_Hash_parameter.yml +0 -155
- data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_return_the_version.yml +0 -89
- data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_work_the_same_way_when_pushing_metric_data_to_non-existing_counter.yml +0 -114
- data/spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_both_work_the_same_way.yml +0 -158
- data/spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_work_initializing_with_URI.yml +0 -48
- data/spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_both_work_the_same_way.json +0 -44
- data/spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_work_initializing_with_URI.json +0 -9
- data/spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI.yml +0 -169
- data/spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI_on_metrics_client.yml +0 -42
- data/spec/vcr_cassettes/Inventory/NonSecure/Connection/Templates/Should_err_on_bad_credentials.yml +0 -44
- data/spec/vcr_cassettes/Inventory/NonSecure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +0 -101
- data/spec/vcr_cassettes/Inventory/NonSecure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +0 -101
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +0 -47
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +0 -207
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/create_url.yml +0 -52
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +0 -411
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/get_feeds.yml +0 -62
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +0 -133
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_feed.yml +0 -59
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_feed_again.yml +0 -181
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +0 -664
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resource.yml +0 -360
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +0 -846
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +0 -169
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +0 -166
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +0 -420
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_a_consistent_behaviour_when_creating_an_already_existing_resource.yml +0 -714
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +0 -73
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_URLs.yml +0 -90
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_WildFlys.yml +0 -70
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +0 -138
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +0 -59
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +0 -333
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +0 -180
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_feeds.yml +0 -62
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +0 -943
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +0 -361
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +0 -94
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +0 -294
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +0 -871
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +0 -740
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +0 -1117
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +0 -393
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +0 -84
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +0 -55
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_types_with_feed.yml +0 -166
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +0 -59
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +0 -66
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +0 -71
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_data_from_get_entity.yml +0 -230
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_the_version.yml +0 -50
- data/spec/vcr_cassettes/Inventory/Secure/Connection/Templates/Should_err_on_bad_credentials.yml +0 -44
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +0 -101
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +0 -101
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +0 -47
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +0 -207
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/create_url.yml +0 -52
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +0 -411
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/get_feeds.yml +0 -62
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +0 -133
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed.yml +0 -59
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed_again.yml +0 -181
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +0 -664
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource.yml +0 -360
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +0 -846
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +0 -169
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +0 -166
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +0 -420
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +0 -73
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_URLs.yml +0 -90
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys.yml +0 -70
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +0 -138
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +0 -59
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +0 -333
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +0 -180
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_feeds.yml +0 -62
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +0 -943
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +0 -361
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +0 -90
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +0 -294
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +0 -871
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +0 -740
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +0 -1117
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +0 -393
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +0 -84
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +0 -55
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_feed.yml +0 -166
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +0 -59
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +0 -66
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +0 -71
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_the_version.yml +0 -50
- data/spec/vcr_cassettes/Inventory/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml +0 -114
- data/spec/vcr_cassettes/Inventory/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +0 -51
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +0 -92
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +0 -50
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +0 -146
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +0 -146
- data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -120
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -200
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -200
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -237
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -120
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -237
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -120
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_return_periods.yml +0 -81
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -200
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -270
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -237
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Simple/Should_be_Cool.yml +0 -82
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Status/Should_return_the_version.yml +0 -42
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -83
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metric_tags_for_metrics_definitions.yml +0 -434
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metrics_with_some_tags.yml +0 -1251
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -138
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -144
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +0 -328
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -144
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -281
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -144
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +0 -97
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -196
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +0 -197
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +0 -328
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +0 -363
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -414
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -285
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/No_Tenant/Should_fail.yml +0 -89
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Simple/Should_be_Cool.yml +0 -48
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Status/Should_return_the_version.yml +0 -85
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_create_string_definition_using_Hash.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_create_string_definition_using_MetricDefinition.yml +0 -99
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_push_metric_data_to_existing_string.yml +0 -281
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_push_metric_data_to_non-existing_string.yml +0 -144
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tags_Metrics/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -103
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/setup_client.yml +0 -44
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +0 -51
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +0 -92
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +0 -101
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +0 -50
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +0 -146
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +0 -146
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -97
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -144
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +0 -328
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -144
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -99
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -281
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -144
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +0 -97
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -50
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +0 -51
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +0 -364
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -373
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -285
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/No_Tenant/Should_fail.yml +0 -50
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Simple/Should_be_Cool.yml +0 -48
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Status/Should_return_the_version.yml +0 -44
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -99
- data/spec/vcr_cassettes/New_API_Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -230
- data/spec/vcr_cassettes/New_API_Mixed_metrics/Should_send_mixed_metric_request.yml +0 -300
- data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/agent_properties.yml +0 -124
- data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +0 -61
- data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_tenant.yml +0 -55
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_XA_datasource_should_be_doable.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_deployment_should_be_doable.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_non-XA_datasource_should_be_doable.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -32
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Update_collection_intervals_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/should_not_be_possible_to_perform_on_closed_client.json +0 -12
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_no_host.json +0 -3
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established.json +0 -9
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback.json +0 -18
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +0 -13
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_feed.yml +0 -61
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_tenant.yml +0 -55
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_datasource_should_be_doable.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_deployment_should_be_doable.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -32
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -23
- data/spec/vcr_cassettes/Operation/Secure/Operation/should_not_be_possible_to_perform_on_closed_client.json +0 -12
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_no_host.json +0 -3
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established.json +0 -9
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback.json +0 -18
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +0 -13
- data/spec/vcr_cassettes/Tokens/Should_be_able_to_create_a_new_token_for_an_actual_user.yml +0 -57
- data/spec/vcr_cassettes/Tokens/Should_be_able_to_list_the_available_tokens.yml +0 -49
- data/spec/vcr_cassettes/Tokens/Should_get_a_401_when_attempting_to_create_a_token_with_a_wrong_password.yml +0 -56
- data/spec/vcr_cassettes/Tokens/Should_get_a_401_when_attempting_to_create_a_token_without_a_password.yml +0 -55
@@ -1,78 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"events": [
|
3
|
-
{
|
4
|
-
"id": "my-event-01",
|
5
|
-
"category": "general-category",
|
6
|
-
"text": "some text for this event",
|
7
|
-
"extras": {
|
8
|
-
"ctime": 2000
|
9
|
-
}
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"id": "my-event-02",
|
13
|
-
"category": "my-category-01",
|
14
|
-
"text": "some text for this event",
|
15
|
-
"extras": {}
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"id": "my-event-03",
|
19
|
-
"category": "my-category-01",
|
20
|
-
"text": "some text for this event",
|
21
|
-
"extras": {}
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"id": "my-event-04",
|
25
|
-
"category": "general-category",
|
26
|
-
"text": "some text for this event",
|
27
|
-
"extras": {}
|
28
|
-
},
|
29
|
-
{
|
30
|
-
"id": "my-event-05",
|
31
|
-
"category": "my-category-02",
|
32
|
-
"text": "some text for this event",
|
33
|
-
"extras": {}
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"id": "my-event-06",
|
37
|
-
"category": "general-category",
|
38
|
-
"text": "some text for this event",
|
39
|
-
"extras": {}
|
40
|
-
},
|
41
|
-
{
|
42
|
-
"id": "my-event-07",
|
43
|
-
"category": "my-category-01",
|
44
|
-
"text": "some text for this event",
|
45
|
-
"extras": {}
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"id": "my-event-08",
|
49
|
-
"category": "general-category",
|
50
|
-
"text": "some text for this event",
|
51
|
-
"extras": {}
|
52
|
-
},
|
53
|
-
{
|
54
|
-
"id": "my-event-09",
|
55
|
-
"category": "general-category",
|
56
|
-
"text": "some text for this event",
|
57
|
-
"extras": {}
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"id": "my-event-10",
|
61
|
-
"category": "general-category",
|
62
|
-
"text": "some text for this event",
|
63
|
-
"extras": {}
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"id": "my-event-11",
|
67
|
-
"category": "general-category",
|
68
|
-
"text": "some text for this event",
|
69
|
-
"extras": {}
|
70
|
-
},
|
71
|
-
{
|
72
|
-
"id": "my-event-12",
|
73
|
-
"category": "general-category",
|
74
|
-
"text": "some text for this event",
|
75
|
-
"extras": {}
|
76
|
-
}
|
77
|
-
]
|
78
|
-
}
|
@@ -1,66 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"triggers":[
|
3
|
-
{
|
4
|
-
"trigger": {
|
5
|
-
"id": "my-trigger-01",
|
6
|
-
"tags": {
|
7
|
-
"resourceId": "my-resource01",
|
8
|
-
"app": "MyShop"
|
9
|
-
}
|
10
|
-
},
|
11
|
-
"conditions":[
|
12
|
-
{
|
13
|
-
"triggerMode": "FIRING",
|
14
|
-
"type": "threshold",
|
15
|
-
"dataId": "data-x",
|
16
|
-
"operator": "LT",
|
17
|
-
"threshold": 5
|
18
|
-
}
|
19
|
-
],
|
20
|
-
"dampenings":[
|
21
|
-
{
|
22
|
-
"dampeningId": "my-trigger-01-my-dampening-id"
|
23
|
-
}
|
24
|
-
]
|
25
|
-
},
|
26
|
-
{
|
27
|
-
"trigger": {
|
28
|
-
"id": "my-trigger-02",
|
29
|
-
"tags": {
|
30
|
-
"resourceId": "my-resource01"
|
31
|
-
}
|
32
|
-
}
|
33
|
-
},
|
34
|
-
{
|
35
|
-
"trigger": {
|
36
|
-
"id": "my-trigger-03",
|
37
|
-
"tags": {
|
38
|
-
"app": "MyShop"
|
39
|
-
}
|
40
|
-
}
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"trigger": {
|
44
|
-
"id": "my-trigger-04",
|
45
|
-
"tags": {
|
46
|
-
"resourceId": "my-resource01",
|
47
|
-
"app": "MyShop"
|
48
|
-
}
|
49
|
-
}
|
50
|
-
},
|
51
|
-
{
|
52
|
-
"trigger": {
|
53
|
-
"id": "my-trigger-05"
|
54
|
-
}
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"trigger": {
|
58
|
-
"id": "my-trigger-06",
|
59
|
-
"tags": {
|
60
|
-
"resourceId": "my-resource01",
|
61
|
-
"app": "MyShop"
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
]
|
66
|
-
}
|
@@ -1,774 +0,0 @@
|
|
1
|
-
require_relative '../vcr/vcr_setup'
|
2
|
-
require_relative '../spec_helper'
|
3
|
-
|
4
|
-
module Hawkular::Alerts::RSpec
|
5
|
-
ALERTS_BASE = 'http://localhost:8080/hawkular/alerts'
|
6
|
-
creds = { username: 'jdoe', password: 'password' }
|
7
|
-
options = { tenant: 'hawkular' }
|
8
|
-
|
9
|
-
describe 'Alert/Triggers' do
|
10
|
-
before(:all) do
|
11
|
-
# Setup for testing
|
12
|
-
record('Alert/Triggers', credentials, 'setup') do
|
13
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
14
|
-
json = IO.read('spec/integration/alert-resources/triggers-test-data.json')
|
15
|
-
trigger_hash = JSON.parse(json)
|
16
|
-
@client.bulk_import_triggers trigger_hash
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
after(:all) do
|
21
|
-
# cleanup test values
|
22
|
-
record('Alert/Triggers', credentials, 'setup_cleanup') do
|
23
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
24
|
-
json = IO.read('spec/integration/alert-resources/triggers-test-data.json')
|
25
|
-
trigger_hash = JSON.parse(json)
|
26
|
-
trigger_hash['triggers'].each do |trigger|
|
27
|
-
@client.delete_trigger trigger['trigger']['id']
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
let(:cassette_name) do |example|
|
33
|
-
description = example.description
|
34
|
-
description
|
35
|
-
end
|
36
|
-
|
37
|
-
around(:each) do |example|
|
38
|
-
record('Alert/Triggers', credentials, cassette_name, example: example)
|
39
|
-
end
|
40
|
-
|
41
|
-
before(:each) do
|
42
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'Should List Triggers' do
|
46
|
-
triggers = @client.list_triggers
|
47
|
-
|
48
|
-
expect(triggers.size).to be(6)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'Should List Triggers for Tag' do
|
52
|
-
triggers = @client.list_triggers [],
|
53
|
-
['resourceId|my-resource01']
|
54
|
-
|
55
|
-
expect(triggers.size).to be(4)
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'Should List Triggers for Tags' do
|
59
|
-
triggers = @client.list_triggers [],
|
60
|
-
%w(resourceId|my-resource01 app|MyShop)
|
61
|
-
|
62
|
-
expect(triggers.size).to be(5)
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'Should List Triggers for ID' do
|
66
|
-
triggers = @client.list_triggers ['my-trigger-05']
|
67
|
-
|
68
|
-
expect(triggers.size).to be(1)
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'Should get a single metric Trigger' do
|
72
|
-
trigger = @client.get_single_trigger('my-trigger-01')
|
73
|
-
|
74
|
-
expect(trigger).not_to be_nil
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'Should get a single Trigger with conditions' do
|
78
|
-
trigger = @client.get_single_trigger 'my-trigger-01', true
|
79
|
-
|
80
|
-
expect(trigger).not_to be_nil
|
81
|
-
expect(trigger.conditions.size).to be(1)
|
82
|
-
expect(trigger.dampenings.size).to be(1)
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'Should bulk load triggers' do
|
86
|
-
json = IO.read('spec/integration/hello-world-definitions.json')
|
87
|
-
trigger_hash = JSON.parse(json)
|
88
|
-
|
89
|
-
@client.bulk_import_triggers trigger_hash
|
90
|
-
|
91
|
-
trigger = @client.get_single_trigger 'hello-world-trigger', true
|
92
|
-
expect(trigger).not_to be_nil
|
93
|
-
expect(trigger.conditions.size).to be(2)
|
94
|
-
expect(trigger.dampenings.size).to be(0)
|
95
|
-
|
96
|
-
@client.delete_trigger(trigger.id)
|
97
|
-
end
|
98
|
-
|
99
|
-
it 'Should create a basic trigger with action' do
|
100
|
-
@client.create_action :email, 'send-via-email', 'to' => 'joe@acme.org'
|
101
|
-
|
102
|
-
# Create the trigger
|
103
|
-
t = Hawkular::Alerts::Trigger.new({})
|
104
|
-
t.enabled = true
|
105
|
-
t.id = 'my-cool-trigger'
|
106
|
-
t.name = 'Just a trigger'
|
107
|
-
t.severity = :HIGH
|
108
|
-
t.description = 'Just a test trigger'
|
109
|
-
|
110
|
-
# Create a condition
|
111
|
-
c = Hawkular::Alerts::Trigger::Condition.new({})
|
112
|
-
c.trigger_mode = :FIRING
|
113
|
-
c.type = :THRESHOLD
|
114
|
-
c.data_id = 'my-metric-id'
|
115
|
-
c.operator = :LT
|
116
|
-
c.threshold = 5
|
117
|
-
|
118
|
-
# Reference an action definition
|
119
|
-
a = Hawkular::Alerts::Trigger::Action.new({})
|
120
|
-
a.action_plugin = :email
|
121
|
-
a.action_id = 'send-via-email'
|
122
|
-
t.actions.push a
|
123
|
-
|
124
|
-
begin
|
125
|
-
ft = @client.create_trigger t, [c], nil
|
126
|
-
|
127
|
-
expect(ft).not_to be_nil
|
128
|
-
|
129
|
-
trigger = @client.get_single_trigger t.id, true
|
130
|
-
expect(trigger).not_to be_nil
|
131
|
-
expect(trigger.conditions.size).to be(1)
|
132
|
-
expect(trigger.dampenings.size).to be(0)
|
133
|
-
ensure
|
134
|
-
# rubocop:disable Lint/HandleExceptions
|
135
|
-
begin
|
136
|
-
@client.delete_trigger(t.id)
|
137
|
-
rescue
|
138
|
-
# I am not interested
|
139
|
-
end
|
140
|
-
begin
|
141
|
-
@client.delete_action(a.action_plugin, a.action_id)
|
142
|
-
rescue
|
143
|
-
# I am not interested
|
144
|
-
end
|
145
|
-
# rubocop:enable Lint/HandleExceptions
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
it 'Should create a firing ALL_ANY trigger' do
|
150
|
-
# Create the trigger
|
151
|
-
t = Hawkular::Alerts::Trigger.new({})
|
152
|
-
t.enabled = true
|
153
|
-
t.id = 'my-cool-trigger'
|
154
|
-
t.name = 'Just a trigger'
|
155
|
-
t.severity = :HIGH
|
156
|
-
t.description = 'Just a test trigger'
|
157
|
-
|
158
|
-
begin
|
159
|
-
ft = @client.create_trigger t, [], nil
|
160
|
-
expect(ft).not_to be_nil
|
161
|
-
|
162
|
-
trigger = @client.get_single_trigger t.id, true
|
163
|
-
expect(trigger.firing_match).to eq('ALL')
|
164
|
-
expect(trigger.auto_resolve_match).to eq('ALL')
|
165
|
-
|
166
|
-
@client.delete_trigger(t.id)
|
167
|
-
|
168
|
-
t.firing_match = :ANY
|
169
|
-
t.auto_resolve_match = :ANY
|
170
|
-
|
171
|
-
ft = @client.create_trigger t, [], nil
|
172
|
-
expect(ft).not_to be_nil
|
173
|
-
|
174
|
-
trigger = @client.get_single_trigger t.id, true
|
175
|
-
expect(trigger.firing_match).to eq('ANY')
|
176
|
-
expect(trigger.auto_resolve_match).to eq('ANY')
|
177
|
-
ensure
|
178
|
-
# rubocop:disable Lint/HandleExceptions
|
179
|
-
begin
|
180
|
-
@client.delete_trigger(t.id)
|
181
|
-
rescue
|
182
|
-
# I am not interested
|
183
|
-
end
|
184
|
-
# rubocop:enable Lint/HandleExceptions
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
it 'Should get the action definitions' do
|
189
|
-
ret = @client.get_action_definition
|
190
|
-
expect(ret.size).to be > 0
|
191
|
-
expect(ret.key? 'email').to be_truthy
|
192
|
-
|
193
|
-
ret = @client.get_action_definition 'email'
|
194
|
-
expect(ret.size).to be(1)
|
195
|
-
expect(ret['email'].size).to be(8)
|
196
|
-
|
197
|
-
expect { @client.get_action_definition '-does-not-exist-' }
|
198
|
-
.to raise_error(Hawkular::BaseClient::HawkularException)
|
199
|
-
end
|
200
|
-
|
201
|
-
it 'Should create an action' do
|
202
|
-
@client.create_action 'email', 'my-id1', 'to' => 'joe@acme.org'
|
203
|
-
@client.delete_action 'email', 'my-id1'
|
204
|
-
end
|
205
|
-
|
206
|
-
it 'Should not create an action for unknown plugin' do
|
207
|
-
expect do
|
208
|
-
@client.create_action '-does-not-exist',
|
209
|
-
'my-id2',
|
210
|
-
'notify-to-admins' => 'joe@acme.org'
|
211
|
-
end.to raise_error(Hawkular::BaseClient::HawkularException)
|
212
|
-
end
|
213
|
-
|
214
|
-
it 'Should not create an action for unknown properties' do
|
215
|
-
expect do
|
216
|
-
@client.create_action :email, 'my-id3', foo: 'bar'
|
217
|
-
end.to raise_error(Hawkular::BaseClient::HawkularException)
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
describe 'Alert/Groups' do
|
222
|
-
let(:cassette_name) do |example|
|
223
|
-
description = example.description
|
224
|
-
description
|
225
|
-
end
|
226
|
-
|
227
|
-
around(:each) do |example|
|
228
|
-
record('Alert/Groups', credentials, cassette_name, example: example)
|
229
|
-
end
|
230
|
-
|
231
|
-
before(:each) do
|
232
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
233
|
-
end
|
234
|
-
|
235
|
-
it 'Should operate a complex group trigger' do
|
236
|
-
# Create a group trigger
|
237
|
-
t = Hawkular::Alerts::Trigger.new({})
|
238
|
-
t.enabled = false
|
239
|
-
t.id = 'a-group-trigger'
|
240
|
-
t.name = 'A Group Trigger'
|
241
|
-
t.severity = :HIGH
|
242
|
-
t.description = 'A Group Trigger generated from test'
|
243
|
-
|
244
|
-
# Create a condition
|
245
|
-
c = Hawkular::Alerts::Trigger::Condition.new({})
|
246
|
-
c.trigger_mode = :FIRING
|
247
|
-
c.type = :THRESHOLD
|
248
|
-
c.data_id = 'my-metric-id'
|
249
|
-
c.operator = :LT
|
250
|
-
c.threshold = 5
|
251
|
-
|
252
|
-
# Create a group condition
|
253
|
-
# no members yet
|
254
|
-
gc = Hawkular::Alerts::Trigger::GroupConditionsInfo.new([c])
|
255
|
-
|
256
|
-
# Create a member
|
257
|
-
m1 = Hawkular::Alerts::Trigger::GroupMemberInfo.new
|
258
|
-
m1.group_id = 'a-group-trigger'
|
259
|
-
m1.member_id = 'member1'
|
260
|
-
m1.member_name = 'Member One'
|
261
|
-
m1.data_id_map = { 'my-metric-id' => 'my-metric-id-member1' }
|
262
|
-
|
263
|
-
# Create a second member
|
264
|
-
m2 = Hawkular::Alerts::Trigger::GroupMemberInfo.new
|
265
|
-
m2.group_id = 'a-group-trigger'
|
266
|
-
m2.member_id = 'member2'
|
267
|
-
m2.member_name = 'Member Two'
|
268
|
-
m2.data_id_map = { 'my-metric-id' => 'my-metric-id-member2' }
|
269
|
-
|
270
|
-
# Create a dampening for the group trigger
|
271
|
-
d = Hawkular::Alerts::Trigger::Dampening.new(
|
272
|
-
'triggerId' => 'a-group-trigger',
|
273
|
-
'triggerMode' => :FIRING,
|
274
|
-
'type' => :STRICT,
|
275
|
-
'evalTrueSetting' => 2,
|
276
|
-
'evalTotalSetting' => 2
|
277
|
-
)
|
278
|
-
|
279
|
-
# Create a second condition
|
280
|
-
c2 = Hawkular::Alerts::Trigger::Condition.new({})
|
281
|
-
c2.trigger_mode = :FIRING
|
282
|
-
c2.type = :THRESHOLD
|
283
|
-
c2.data_id = 'my-metric-id2'
|
284
|
-
c2.operator = :GT
|
285
|
-
c2.threshold = 50
|
286
|
-
|
287
|
-
# Create the second group condition
|
288
|
-
# member2 is an orphan so, no need to update it into the data_id_member_map
|
289
|
-
gc2 = Hawkular::Alerts::Trigger::GroupConditionsInfo.new([c, c2])
|
290
|
-
gc2.data_id_member_map = {
|
291
|
-
'my-metric-id' => { 'member1' => 'my-metric-id-member1' },
|
292
|
-
'my-metric-id2' => { 'member1' => 'my-metric-id2-member1' }
|
293
|
-
}
|
294
|
-
|
295
|
-
# Create a third condition of type compare
|
296
|
-
c3 = Hawkular::Alerts::Trigger::Condition.new({})
|
297
|
-
c3.trigger_mode = :FIRING
|
298
|
-
c3.type = :COMPARE
|
299
|
-
c3.data_id = 'my-metric-id3'
|
300
|
-
c3.operator = :GT
|
301
|
-
c3.data2_id = 'my-metric-id4'
|
302
|
-
c3.data2_multiplier = 1
|
303
|
-
|
304
|
-
# Create the thrid group condition
|
305
|
-
# member 2 is still an orphan, no need to update it into the data_id_member_map
|
306
|
-
gc3 = Hawkular::Alerts::Trigger::GroupConditionsInfo.new([c, c2, c3])
|
307
|
-
gc3.data_id_member_map = {
|
308
|
-
'my-metric-id' => { 'member1' => 'my-metric-id-member1' },
|
309
|
-
'my-metric-id2' => { 'member1' => 'my-metric-id2-member1' },
|
310
|
-
'my-metric-id3' => { 'member1' => 'my-metric-id3-member1' },
|
311
|
-
'my-metric-id4' => { 'member1' => 'my-metric-id4-member1' }
|
312
|
-
}
|
313
|
-
|
314
|
-
begin
|
315
|
-
group_trigger = @client.create_group_trigger t
|
316
|
-
expect(group_trigger).not_to be_nil
|
317
|
-
expect(group_trigger.type).to eq('GROUP')
|
318
|
-
|
319
|
-
created_conditions = @client.set_group_conditions t.id, :FIRING, gc
|
320
|
-
expect(created_conditions.size).to be(1)
|
321
|
-
|
322
|
-
member1 = @client.create_member_trigger m1
|
323
|
-
expect(member1.type).to eq('MEMBER')
|
324
|
-
|
325
|
-
full_member1 = @client.get_single_trigger member1.id, true
|
326
|
-
expect(full_member1).not_to be_nil
|
327
|
-
expect(full_member1.id).to eq('member1')
|
328
|
-
expect(full_member1.conditions.size).to be(1)
|
329
|
-
expect(full_member1.conditions[0].data_id).to eq('my-metric-id-member1')
|
330
|
-
|
331
|
-
members = @client.list_members t.id
|
332
|
-
expect(members.size).to be(1)
|
333
|
-
|
334
|
-
member2 = @client.create_member_trigger m2
|
335
|
-
expect(member2.type).to eq('MEMBER')
|
336
|
-
|
337
|
-
full_member2 = @client.get_single_trigger member2.id, true
|
338
|
-
expect(full_member2).not_to be_nil
|
339
|
-
expect(full_member2.id).to eq('member2')
|
340
|
-
expect(full_member2.conditions.size).to be(1)
|
341
|
-
expect(full_member2.conditions[0].data_id).to eq('my-metric-id-member2')
|
342
|
-
|
343
|
-
members = @client.list_members t.id
|
344
|
-
expect(members.size).to be(2)
|
345
|
-
|
346
|
-
member2 = @client.orphan_member member2.id
|
347
|
-
expect(member2.type).to eq('ORPHAN')
|
348
|
-
|
349
|
-
members = @client.list_members t.id
|
350
|
-
expect(members.size).to be(1)
|
351
|
-
|
352
|
-
orphans = @client.list_members t.id, true
|
353
|
-
expect(orphans.size).to be(2)
|
354
|
-
|
355
|
-
group_dampening = @client.create_group_dampening d
|
356
|
-
expect(group_dampening).not_to be_nil
|
357
|
-
expect(group_dampening.type).to eq('STRICT')
|
358
|
-
|
359
|
-
full_member1 = @client.get_single_trigger member1.id, true
|
360
|
-
expect(full_member1).not_to be_nil
|
361
|
-
expect(full_member1.id).to eq('member1')
|
362
|
-
expect(full_member1.dampenings.size).to be(1)
|
363
|
-
expect(full_member1.dampenings[0].eval_true_setting).to be(2)
|
364
|
-
expect(full_member1.dampenings[0].eval_total_setting).to be(2)
|
365
|
-
|
366
|
-
group_trigger.tags = { 'group-tname' => 'group-tvalue' }
|
367
|
-
group_trigger = @client.update_group_trigger group_trigger
|
368
|
-
|
369
|
-
full_member1 = @client.get_single_trigger member1.id, false
|
370
|
-
expect(full_member1).not_to be_nil
|
371
|
-
expect(full_member1.tags['group-tname']).to eq('group-tvalue')
|
372
|
-
|
373
|
-
created_conditions = @client.set_group_conditions t.id, :FIRING, gc2
|
374
|
-
expect(created_conditions.size).to be(2)
|
375
|
-
|
376
|
-
full_member1 = @client.get_single_trigger member1.id, true
|
377
|
-
expect(full_member1).not_to be_nil
|
378
|
-
expect(full_member1.conditions.size).to be(2)
|
379
|
-
|
380
|
-
group_dampening.type = :RELAXED_COUNT
|
381
|
-
group_dampening.eval_true_setting = 2
|
382
|
-
group_dampening.eval_total_setting = 4
|
383
|
-
group_dampening = @client.update_group_dampening group_dampening
|
384
|
-
|
385
|
-
group_trigger.context = { 'alert-profiles' => 'profile1' }
|
386
|
-
@client.update_group_trigger group_trigger
|
387
|
-
|
388
|
-
@client.delete_group_dampening group_dampening.trigger_id, group_dampening.dampening_id
|
389
|
-
|
390
|
-
full_member1 = @client.get_single_trigger member1.id, true
|
391
|
-
expect(full_member1).not_to be_nil
|
392
|
-
expect(full_member1.context['alert-profiles']).to eq('profile1')
|
393
|
-
expect(full_member1.dampenings.size).to be(0)
|
394
|
-
|
395
|
-
created_conditions = @client.set_group_conditions t.id, :FIRING, gc3
|
396
|
-
expect(created_conditions.size).to be(3)
|
397
|
-
|
398
|
-
full_member1 = @client.get_single_trigger member1.id, true
|
399
|
-
expect(full_member1).not_to be_nil
|
400
|
-
expect(full_member1.conditions.size).to be(3)
|
401
|
-
ensure
|
402
|
-
# rubocop:disable Lint/HandleExceptions
|
403
|
-
begin
|
404
|
-
@client.delete_group_trigger(t.id)
|
405
|
-
rescue
|
406
|
-
# I am not interested
|
407
|
-
end
|
408
|
-
# rubocop:enable Lint/HandleExceptions
|
409
|
-
end
|
410
|
-
end
|
411
|
-
end
|
412
|
-
|
413
|
-
describe 'Alert/Alerts' do
|
414
|
-
before(:all) do
|
415
|
-
# Setup for testing
|
416
|
-
record('Alert/Alerts', credentials, 'setup') do
|
417
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
418
|
-
json = IO.read('spec/integration/alert-resources/alerts-test-data.json')
|
419
|
-
trigger_hash = JSON.parse(json)
|
420
|
-
@client.bulk_import_triggers trigger_hash
|
421
|
-
current_open_alert_count = @client.list_alerts('statuses' => 'OPEN')
|
422
|
-
@client.http_post('data', [{ id: 'data-x', timestamp: Time.new.to_i, value: 4 }])
|
423
|
-
wait_while do
|
424
|
-
current_open_alert_count == @client.list_alerts('statuses' => 'OPEN')
|
425
|
-
end
|
426
|
-
end
|
427
|
-
end
|
428
|
-
|
429
|
-
after(:all) do
|
430
|
-
# cleanup test values
|
431
|
-
record('Alert/Alerts', credentials, 'setup_cleanup') do
|
432
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
433
|
-
json = IO.read('spec/integration/alert-resources/alerts-test-data.json')
|
434
|
-
trigger_hash = JSON.parse(json)
|
435
|
-
trigger_hash['triggers'].each do |trigger|
|
436
|
-
@client.list_alerts('triggerIds' => [trigger['trigger']['id']]).each do |alert|
|
437
|
-
@client.http_delete(alert.id)
|
438
|
-
end
|
439
|
-
@client.delete_trigger trigger['trigger']['id']
|
440
|
-
end
|
441
|
-
end
|
442
|
-
end
|
443
|
-
|
444
|
-
let(:cassette_name) do |example|
|
445
|
-
description = example.description
|
446
|
-
description
|
447
|
-
end
|
448
|
-
|
449
|
-
around(:each) do |example|
|
450
|
-
record('Alert/Alerts', credentials, cassette_name, example: example)
|
451
|
-
end
|
452
|
-
|
453
|
-
before(:each) do
|
454
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
455
|
-
end
|
456
|
-
|
457
|
-
it 'Should list alerts' do
|
458
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
459
|
-
|
460
|
-
alerts = client.list_alerts
|
461
|
-
|
462
|
-
expect(alerts).to_not be_nil
|
463
|
-
expect(alerts.size).to be >= 2
|
464
|
-
end
|
465
|
-
|
466
|
-
it 'Should list open alerts' do
|
467
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
468
|
-
|
469
|
-
alerts = client.list_alerts('statuses' => 'OPEN')
|
470
|
-
|
471
|
-
expect(alerts).to_not be_nil
|
472
|
-
expect(alerts.size).to be(2)
|
473
|
-
end
|
474
|
-
|
475
|
-
it 'Should list alerts for trigger' do
|
476
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
477
|
-
|
478
|
-
alerts = client.get_alerts_for_trigger 'hello-world-trigger'
|
479
|
-
|
480
|
-
expect(alerts).to_not be_nil
|
481
|
-
expect(alerts.size).to be(1)
|
482
|
-
end
|
483
|
-
|
484
|
-
it 'Should list alerts for unknown trigger' do
|
485
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
486
|
-
|
487
|
-
alerts = client.get_alerts_for_trigger 'does-not-exist'
|
488
|
-
|
489
|
-
expect(alerts).to_not be_nil
|
490
|
-
expect(alerts.size).to be(0)
|
491
|
-
end
|
492
|
-
|
493
|
-
it 'Should fetch single alert' do
|
494
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
495
|
-
|
496
|
-
alert_id = client.list_alerts('statuses' => 'OPEN').first.id
|
497
|
-
|
498
|
-
alert = client.get_single_alert(alert_id)
|
499
|
-
|
500
|
-
expect(alert).to_not be_nil
|
501
|
-
expect(alert.id).to eql(alert_id)
|
502
|
-
end
|
503
|
-
|
504
|
-
it 'Should resolve an alert' do
|
505
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
506
|
-
|
507
|
-
alert_id = client.list_alerts('statuses' => 'OPEN').first.id
|
508
|
-
alert = client.get_single_alert alert_id
|
509
|
-
|
510
|
-
expect(alert.status).to eql('OPEN')
|
511
|
-
|
512
|
-
client.resolve_alert(alert_id, 'Heiko', 'Hello Ruby World :-)')
|
513
|
-
|
514
|
-
alert = client.get_single_alert alert_id
|
515
|
-
expect(alert.status).to eql('RESOLVED')
|
516
|
-
end
|
517
|
-
|
518
|
-
# # TODO enable when the semantics on the server side is known
|
519
|
-
# it 'Should resolve an alert2' do
|
520
|
-
# client = Hawkular::Alerts::Client.new(ALERTS_BASE,creds)
|
521
|
-
#
|
522
|
-
# alert_id = '28026b36-8fe4-4332-84c8-524e173a68bf-snert~Local_jvm_garba-1446977734134'
|
523
|
-
# client.resolve_alert alert_id
|
524
|
-
#
|
525
|
-
# end
|
526
|
-
|
527
|
-
it 'Should acknowledge an alert' do
|
528
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
529
|
-
|
530
|
-
alert_id = client.list_alerts('statuses' => 'OPEN').first.id
|
531
|
-
client.get_single_alert alert_id
|
532
|
-
|
533
|
-
client.acknowledge_alert(alert_id, 'Heiko', 'Hello Ruby World :-)')
|
534
|
-
|
535
|
-
alert = client.get_single_alert alert_id
|
536
|
-
expect(alert.ackBy).to eql('Heiko')
|
537
|
-
end
|
538
|
-
|
539
|
-
it 'Should add tags to existing alert' do
|
540
|
-
client = Hawkular::Alerts::AlertsClient.new(ALERTS_BASE, creds, options)
|
541
|
-
alert_id = client.list_alerts.first.id
|
542
|
-
alert_not_found = client.list_alerts(tags: 'new-tag-name|tag_value', thin: true).first
|
543
|
-
client.add_tags([alert_id], ['new-tag-name|tag_value', 'othertag|othervalue'])
|
544
|
-
alert_found_by_new_tag_name = client.list_alerts(tags: 'new-tag-name|tag_value', thin: true).first
|
545
|
-
|
546
|
-
expect(alert_not_found).to be_nil
|
547
|
-
expect(alert_found_by_new_tag_name).to_not be_nil
|
548
|
-
end
|
549
|
-
|
550
|
-
it 'Should remove tags from existing alert' do
|
551
|
-
client = Hawkular::Alerts::AlertsClient.new(ALERTS_BASE, creds, options)
|
552
|
-
alert_id = client.list_alerts.first.id
|
553
|
-
client.add_tags([alert_id], ['new-tag-name|tag_value', 'othertag|othervalue'])
|
554
|
-
alert_found_by_new_tag_name = client.list_alerts(tags: 'new-tag-name|tag_value', thin: true).first
|
555
|
-
client.remove_tags([alert_id], ['new-tag-name'])
|
556
|
-
alert_not_found = client.list_alerts(tags: 'new-tag-name|tag_value', thin: true).first
|
557
|
-
|
558
|
-
expect(alert_found_by_new_tag_name).to_not be_nil
|
559
|
-
expect(alert_not_found).to be_nil
|
560
|
-
end
|
561
|
-
end
|
562
|
-
|
563
|
-
describe 'Alert' do
|
564
|
-
let(:cassette_name) do |example|
|
565
|
-
description = example.description
|
566
|
-
description
|
567
|
-
end
|
568
|
-
|
569
|
-
around(:each) do |example|
|
570
|
-
record('Alert', credentials, cassette_name, example: example)
|
571
|
-
end
|
572
|
-
|
573
|
-
before(:each) do
|
574
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds)
|
575
|
-
end
|
576
|
-
|
577
|
-
it 'Should return the version' do
|
578
|
-
data = @client.fetch_version_and_status
|
579
|
-
expect(data).not_to be_nil
|
580
|
-
end
|
581
|
-
end
|
582
|
-
|
583
|
-
describe 'Alert/Events' do
|
584
|
-
before(:all) do
|
585
|
-
# Setup for testing
|
586
|
-
record('Alert/Events', credentials, 'setup') do
|
587
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
588
|
-
json = IO.read('spec/integration/alert-resources/events-test-data.json')
|
589
|
-
hash = JSON.parse(json)
|
590
|
-
hash['events'].each do |event|
|
591
|
-
@client.create_event event['id'], event['category'], event['text'], event['extras']
|
592
|
-
end
|
593
|
-
end
|
594
|
-
end
|
595
|
-
|
596
|
-
after(:all) do
|
597
|
-
# cleanup test values
|
598
|
-
record('Alert/Events', credentials, 'setup_cleanup') do
|
599
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, credentials, options)
|
600
|
-
json = IO.read('spec/integration/alert-resources/events-test-data.json')
|
601
|
-
hash = JSON.parse(json)
|
602
|
-
hash['events'].each do |event|
|
603
|
-
@client.delete_event event['id']
|
604
|
-
end
|
605
|
-
end
|
606
|
-
end
|
607
|
-
|
608
|
-
let(:cassette_name) do |example|
|
609
|
-
description = example.description
|
610
|
-
description
|
611
|
-
end
|
612
|
-
|
613
|
-
around(:each) do |example|
|
614
|
-
record('Alert/Events', credentials, cassette_name, example: example)
|
615
|
-
end
|
616
|
-
|
617
|
-
it 'Should list events' do
|
618
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
619
|
-
|
620
|
-
events = client.list_events('thin' => true)
|
621
|
-
|
622
|
-
expect(events).to_not be_nil
|
623
|
-
expect(events.size).to be >= 12
|
624
|
-
end
|
625
|
-
|
626
|
-
it 'Should list events using criteria' do
|
627
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
628
|
-
|
629
|
-
events = client.list_events('categories' => %w(my-category-01 my-category-02))
|
630
|
-
|
631
|
-
expect(events).to_not be_nil
|
632
|
-
expect(events.size).to be(4)
|
633
|
-
end
|
634
|
-
|
635
|
-
it 'Should not list events using criteria' do
|
636
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
637
|
-
|
638
|
-
events = client.list_events('startTime' => 0, 'endTime' => 1000)
|
639
|
-
|
640
|
-
expect(events).to_not be_nil
|
641
|
-
expect(events.size).to be(0)
|
642
|
-
end
|
643
|
-
|
644
|
-
it 'Should create an event' do
|
645
|
-
the_id = "test-event@#{Time.new.to_i}"
|
646
|
-
VCR.eject_cassette
|
647
|
-
record('Alert/Events', credentials.merge(id: the_id), cassette_name) do
|
648
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
649
|
-
|
650
|
-
the_event = client.create_event(the_id, 'MyCategory', 'Li la lu',
|
651
|
-
context: { message: 'This is a test' },
|
652
|
-
tags: { tag_name: 'tag-value' })
|
653
|
-
|
654
|
-
expect(the_event['id']).to eql(the_id)
|
655
|
-
expect(the_event['category']).to eql('MyCategory')
|
656
|
-
|
657
|
-
client.delete_event the_id
|
658
|
-
end
|
659
|
-
end
|
660
|
-
|
661
|
-
it 'Should delete an event' do
|
662
|
-
the_id = "test-event@#{Time.new.to_i}"
|
663
|
-
VCR.eject_cassette
|
664
|
-
record('Alert/Events', credentials.merge(id: the_id), cassette_name) do
|
665
|
-
client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
666
|
-
client.create_event(the_id, 'MyCategory', 'Li la lu',
|
667
|
-
context: { message: 'This is a test' },
|
668
|
-
tags: { tag_name: 'tag-value' })
|
669
|
-
|
670
|
-
client.delete_event the_id
|
671
|
-
the_event = client.list_events('thin' => true, 'eventIds' => [the_id]).first
|
672
|
-
expect(the_event).to be_nil
|
673
|
-
end
|
674
|
-
end
|
675
|
-
end
|
676
|
-
|
677
|
-
describe 'Alert/EndToEnd' do
|
678
|
-
let(:cassette_name) do |example|
|
679
|
-
description = example.description
|
680
|
-
description
|
681
|
-
end
|
682
|
-
|
683
|
-
around(:each) do |example|
|
684
|
-
record('Alert/EndToEnd', credentials, cassette_name, example: example)
|
685
|
-
end
|
686
|
-
|
687
|
-
before(:each) do
|
688
|
-
@client = Hawkular::Alerts::Client.new(ALERTS_BASE, creds, options)
|
689
|
-
end
|
690
|
-
|
691
|
-
it 'Should create and fire a trigger' do
|
692
|
-
email_props = { to: 'joe@acme.org',
|
693
|
-
from: 'admin@acme.org' }
|
694
|
-
begin
|
695
|
-
@client.create_action 'email', 'send-via-email',
|
696
|
-
email_props
|
697
|
-
rescue
|
698
|
-
@client.delete_action 'email', 'send-via-email'
|
699
|
-
@client.create_action 'email', 'send-via-email',
|
700
|
-
email_props
|
701
|
-
end
|
702
|
-
|
703
|
-
# Create the trigger
|
704
|
-
t = Hawkular::Alerts::Trigger.new({})
|
705
|
-
t.enabled = true
|
706
|
-
t.id = 'my-cool-email-trigger'
|
707
|
-
t.name = 'Just a trigger'
|
708
|
-
t.severity = :HIGH
|
709
|
-
t.description = 'Just a test trigger'
|
710
|
-
|
711
|
-
# Create a condition
|
712
|
-
c = Hawkular::Alerts::Trigger::Condition.new({})
|
713
|
-
c.trigger_mode = :FIRING
|
714
|
-
c.type = :THRESHOLD
|
715
|
-
c.data_id = 'my-metric-id1'
|
716
|
-
c.operator = :GT
|
717
|
-
c.threshold = 5
|
718
|
-
|
719
|
-
# Reference an action definition for email
|
720
|
-
a = Hawkular::Alerts::Trigger::Action.new({})
|
721
|
-
a.action_plugin = 'email'
|
722
|
-
a.action_id = 'send-via-email'
|
723
|
-
t.actions.push a
|
724
|
-
|
725
|
-
begin
|
726
|
-
ft = @client.create_trigger t, [c], nil
|
727
|
-
|
728
|
-
expect(ft).not_to be_nil
|
729
|
-
|
730
|
-
trigger = @client.get_single_trigger t.id, true
|
731
|
-
expect(trigger).not_to be_nil
|
732
|
-
expect(trigger.conditions.size).to be(1)
|
733
|
-
expect(trigger.dampenings.size).to be(0)
|
734
|
-
|
735
|
-
# Trigger is set up - send a metric value to trigger it.
|
736
|
-
metric_client = nil
|
737
|
-
::RSpec::Mocks.with_temporary_scope do
|
738
|
-
mock_metrics_version
|
739
|
-
metric_client = Hawkular::Metrics::Client.new('http://localhost:8080/hawkular/metrics',
|
740
|
-
creds, options)
|
741
|
-
end
|
742
|
-
|
743
|
-
data_point = { timestamp: Time.now.to_i * 1000, value: 42 }
|
744
|
-
data = [{ id: 'my-metric-id1', data: [data_point] }]
|
745
|
-
|
746
|
-
metric_client.push_data(gauges: data)
|
747
|
-
|
748
|
-
# wait for the alert engine to work if we are live
|
749
|
-
wait_while do
|
750
|
-
@client.get_alerts_for_trigger('my-cool-email-trigger').nil?
|
751
|
-
end
|
752
|
-
|
753
|
-
# see if alert has fired
|
754
|
-
alerts = @client.get_alerts_for_trigger 'my-cool-email-trigger'
|
755
|
-
expect(alerts).to_not be(nil)
|
756
|
-
alerts.each { |al| @client.resolve_alert(al.id, 'Heiko', 'Hello Ruby World :-)') }
|
757
|
-
|
758
|
-
ensure
|
759
|
-
# rubocop:disable Lint/HandleExceptions
|
760
|
-
begin
|
761
|
-
@client.delete_trigger(t.id)
|
762
|
-
rescue
|
763
|
-
# I am not interested
|
764
|
-
end
|
765
|
-
begin
|
766
|
-
@client.delete_action('email', 'send-via-email')
|
767
|
-
rescue
|
768
|
-
# I am not interested
|
769
|
-
end
|
770
|
-
# rubocop:enable Lint/HandleExceptions
|
771
|
-
end
|
772
|
-
end
|
773
|
-
end
|
774
|
-
end
|