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.
Files changed (340) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.rdoc +27 -0
  3. data/README.rdoc +14 -14
  4. data/lib/hawkular/alerts/alerts_api.rb +43 -7
  5. data/lib/hawkular/client_utils.rb +0 -3
  6. data/lib/hawkular/hawkular_client.rb +1 -1
  7. data/lib/hawkular/inventory/entities.rb +55 -19
  8. data/lib/hawkular/inventory/inventory_api.rb +313 -412
  9. data/lib/hawkular/metrics/metric_api.rb +5 -2
  10. data/lib/hawkular/operations/operations_api.rb +0 -8
  11. data/lib/hawkular/tokens/tokens_api.rb +0 -3
  12. data/lib/hawkular/version.rb +1 -1
  13. metadata +3 -647
  14. data/.coveralls.yml +0 -1
  15. data/.gitignore +0 -56
  16. data/.rubocop.yml +0 -32
  17. data/.travis.yml +0 -20
  18. data/.travis/start_hawkular_services.sh +0 -21
  19. data/.travis/wait_for_services.rb +0 -39
  20. data/.yardopts +0 -1
  21. data/Gemfile +0 -2
  22. data/Rakefile +0 -20
  23. data/api_breaking_changes.rdoc +0 -84
  24. data/docker-compose.yml +0 -17
  25. data/hawkularclient.gemspec +0 -43
  26. data/spec/README.rdoc +0 -62
  27. data/spec/integration/alert-resources/alerts-test-data.json +0 -40
  28. data/spec/integration/alert-resources/events-test-data.json +0 -78
  29. data/spec/integration/alert-resources/triggers-test-data.json +0 -66
  30. data/spec/integration/alerts_spec.rb +0 -774
  31. data/spec/integration/env_config_spec.rb +0 -39
  32. data/spec/integration/hawkular_client_spec.rb +0 -304
  33. data/spec/integration/hello-world-definitions.json +0 -45
  34. data/spec/integration/inventory_spec.rb +0 -680
  35. data/spec/integration/logger_spec.rb +0 -36
  36. data/spec/integration/metric_spec.rb +0 -953
  37. data/spec/integration/operations_spec.rb +0 -591
  38. data/spec/integration/tokens_spec.rb +0 -49
  39. data/spec/resources/driver.jar +0 -0
  40. data/spec/resources/sample.war +0 -0
  41. data/spec/spec_helper.rb +0 -336
  42. data/spec/unit/base_spec.rb +0 -256
  43. data/spec/unit/canonical_path_spec.rb +0 -102
  44. data/spec/unit/client_spec.rb +0 -55
  45. data/spec/unit/deprecations_spec.rb +0 -19
  46. data/spec/vcr/vcr_setup.rb +0 -16
  47. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_acknowledge_an_alert.yml +0 -205
  48. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_add_tags_to_existing_alert.yml +0 -210
  49. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_fetch_single_alert.yml +0 -108
  50. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts.yml +0 -59
  51. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts_for_trigger.yml +0 -58
  52. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_alerts_for_unknown_trigger.yml +0 -50
  53. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_list_open_alerts.yml +0 -59
  54. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_remove_tags_from_existing_alert.yml +0 -257
  55. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_resolve_an_alert.yml +0 -207
  56. data/spec/vcr_cassettes/Alert/Alerts/Templates/setup.yml +0 -255
  57. data/spec/vcr_cassettes/Alert/Alerts/Templates/setup_cleanup.yml +0 -302
  58. data/spec/vcr_cassettes/Alert/EndToEnd/Templates/Should_create_and_fire_a_trigger.yml +0 -527
  59. data/spec/vcr_cassettes/Alert/Events/Templates/Should_create_an_event.yml +0 -101
  60. data/spec/vcr_cassettes/Alert/Events/Templates/Should_delete_an_event.yml +0 -148
  61. data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events.yml +0 -91
  62. data/spec/vcr_cassettes/Alert/Events/Templates/Should_list_events_using_criteria.yml +0 -60
  63. data/spec/vcr_cassettes/Alert/Events/Templates/Should_not_list_events_using_criteria.yml +0 -50
  64. data/spec/vcr_cassettes/Alert/Events/Templates/setup.yml +0 -615
  65. data/spec/vcr_cassettes/Alert/Events/Templates/setup_cleanup.yml +0 -567
  66. data/spec/vcr_cassettes/Alert/Groups/Templates/Should_operate_a_complex_group_trigger.yml +0 -1882
  67. data/spec/vcr_cassettes/Alert/Templates/Should_return_the_version.yml +0 -42
  68. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers.yml +0 -55
  69. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_ID.yml +0 -56
  70. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tag.yml +0 -56
  71. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_List_Triggers_for_Tags.yml +0 -56
  72. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_bulk_load_triggers.yml +0 -243
  73. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_a_basic_trigger_with_action.yml +0 -386
  74. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_a_firing_ALL_ANY_trigger.yml +0 -483
  75. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_create_an_action.yml +0 -146
  76. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_a_single_Trigger_with_conditions.yml +0 -144
  77. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_a_single_metric_Trigger.yml +0 -50
  78. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_the_action_definitions.yml +0 -228
  79. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_not_create_an_action_for_unknown_plugin.yml +0 -50
  80. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_not_create_an_action_for_unknown_properties.yml +0 -100
  81. data/spec/vcr_cassettes/Alert/Triggers/Templates/setup.yml +0 -52
  82. data/spec/vcr_cassettes/Alert/Triggers/Templates/setup_cleanup.yml +0 -285
  83. data/spec/vcr_cassettes/HawkularClient/Should_err_on_bad_credentials.yml +0 -42
  84. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_create_and_delete_feed.yml +0 -317
  85. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_list_WildFlys.yml +0 -103
  86. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_both_list_types_with_bad_feed.yml +0 -103
  87. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_same_types_when_param_is_given.yml +0 -325
  88. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_the_same_feeds.yml +0 -117
  89. data/spec/vcr_cassettes/HawkularClient/and_Inventory_client/Should_list_the_same_resource_types.yml +0 -111
  90. data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_create_and_retrieve_tags_for_Availability.yml +0 -155
  91. data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_create_and_return_Availability_using_Hash_parameter.yml +0 -155
  92. data/spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_return_the_version.yml +0 -89
  93. 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
  94. data/spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_both_work_the_same_way.yml +0 -158
  95. data/spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_work_initializing_with_URI.yml +0 -48
  96. data/spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_both_work_the_same_way.json +0 -44
  97. data/spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_work_initializing_with_URI.json +0 -9
  98. data/spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI.yml +0 -169
  99. data/spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI_on_metrics_client.yml +0 -42
  100. data/spec/vcr_cassettes/Inventory/NonSecure/Connection/Templates/Should_err_on_bad_credentials.yml +0 -44
  101. data/spec/vcr_cassettes/Inventory/NonSecure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +0 -101
  102. data/spec/vcr_cassettes/Inventory/NonSecure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +0 -101
  103. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +0 -47
  104. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +0 -207
  105. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/create_url.yml +0 -52
  106. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +0 -411
  107. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Helpers/get_feeds.yml +0 -62
  108. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +0 -133
  109. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_feed.yml +0 -59
  110. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_feed_again.yml +0 -181
  111. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +0 -664
  112. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resource.yml +0 -360
  113. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +0 -846
  114. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +0 -169
  115. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +0 -166
  116. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +0 -420
  117. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
  118. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_a_consistent_behaviour_when_creating_an_already_existing_resource.yml +0 -714
  119. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +0 -73
  120. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_URLs.yml +0 -90
  121. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_WildFlys.yml +0 -70
  122. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +0 -138
  123. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +0 -59
  124. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +0 -333
  125. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +0 -180
  126. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_feeds.yml +0 -62
  127. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +0 -943
  128. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +0 -361
  129. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +0 -94
  130. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +0 -294
  131. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +0 -871
  132. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +0 -740
  133. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +0 -1117
  134. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +0 -393
  135. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +0 -84
  136. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +0 -55
  137. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_list_types_with_feed.yml +0 -166
  138. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +0 -59
  139. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +0 -66
  140. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +0 -71
  141. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_data_from_get_entity.yml +0 -230
  142. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_the_version.yml +0 -50
  143. data/spec/vcr_cassettes/Inventory/Secure/Connection/Templates/Should_err_on_bad_credentials.yml +0 -44
  144. data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +0 -101
  145. data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +0 -101
  146. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +0 -47
  147. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +0 -207
  148. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/create_url.yml +0 -52
  149. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +0 -411
  150. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/get_feeds.yml +0 -62
  151. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +0 -133
  152. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed.yml +0 -59
  153. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed_again.yml +0 -181
  154. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +0 -664
  155. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource.yml +0 -360
  156. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +0 -846
  157. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +0 -169
  158. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +0 -166
  159. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +0 -420
  160. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
  161. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +0 -73
  162. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_URLs.yml +0 -90
  163. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys.yml +0 -70
  164. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +0 -138
  165. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +0 -59
  166. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +0 -333
  167. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +0 -180
  168. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_feeds.yml +0 -62
  169. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +0 -943
  170. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +0 -361
  171. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +0 -90
  172. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +0 -294
  173. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +0 -871
  174. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +0 -740
  175. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +0 -1117
  176. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +0 -393
  177. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +0 -84
  178. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +0 -55
  179. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_feed.yml +0 -166
  180. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +0 -59
  181. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +0 -66
  182. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +0 -71
  183. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_the_version.yml +0 -50
  184. data/spec/vcr_cassettes/Inventory/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml +0 -114
  185. data/spec/vcr_cassettes/Inventory/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +0 -132
  186. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +0 -51
  187. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +0 -92
  188. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +0 -101
  189. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +0 -101
  190. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +0 -101
  191. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +0 -50
  192. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +0 -146
  193. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +0 -146
  194. data/spec/vcr_cassettes/Metrics/NonSecure/ID_with_special_characters/Templates/setup_client.yml +0 -44
  195. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -83
  196. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -83
  197. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -120
  198. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -200
  199. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -83
  200. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -83
  201. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -200
  202. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -237
  203. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -120
  204. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -83
  205. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -83
  206. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -237
  207. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -120
  208. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_return_periods.yml +0 -81
  209. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -200
  210. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -270
  211. 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
  212. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Simple/Should_be_Cool.yml +0 -82
  213. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Status/Should_return_the_version.yml +0 -42
  214. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_8_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -83
  215. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metric_tags_for_metrics_definitions.yml +0 -434
  216. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metrics_with_some_tags.yml +0 -1251
  217. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -99
  218. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
  219. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -138
  220. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -144
  221. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
  222. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Availability_metrics/setup_client.yml +0 -44
  223. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
  224. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
  225. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
  226. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +0 -328
  227. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
  228. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -144
  229. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Counter_metrics/setup_client.yml +0 -44
  230. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -99
  231. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -99
  232. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -281
  233. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -144
  234. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +0 -97
  235. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -196
  236. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +0 -197
  237. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
  238. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/setup_client.yml +0 -44
  239. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +0 -328
  240. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +0 -363
  241. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -414
  242. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
  243. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -285
  244. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/setup_client.yml +0 -44
  245. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/No_Tenant/Should_fail.yml +0 -89
  246. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Simple/Should_be_Cool.yml +0 -48
  247. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Status/Should_return_the_version.yml +0 -85
  248. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_create_string_definition_using_Hash.yml +0 -99
  249. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_create_string_definition_using_MetricDefinition.yml +0 -99
  250. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_push_metric_data_to_existing_string.yml +0 -281
  251. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/Should_push_metric_data_to_non-existing_string.yml +0 -144
  252. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/String_metrics/setup_client.yml +0 -44
  253. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tags_Metrics/setup_client.yml +0 -44
  254. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -103
  255. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/setup_client.yml +0 -44
  256. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/setup_client.yml +0 -44
  257. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +0 -51
  258. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +0 -92
  259. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +0 -101
  260. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +0 -101
  261. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +0 -101
  262. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +0 -50
  263. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +0 -146
  264. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +0 -146
  265. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -99
  266. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +0 -99
  267. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +0 -97
  268. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -144
  269. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -240
  270. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +0 -99
  271. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -99
  272. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -240
  273. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +0 -328
  274. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -281
  275. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -144
  276. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +0 -99
  277. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -99
  278. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -281
  279. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -144
  280. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +0 -97
  281. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -50
  282. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +0 -51
  283. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -240
  284. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +0 -364
  285. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +0 -373
  286. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -314
  287. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -285
  288. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/No_Tenant/Should_fail.yml +0 -50
  289. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Simple/Should_be_Cool.yml +0 -48
  290. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Status/Should_return_the_version.yml +0 -44
  291. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -99
  292. data/spec/vcr_cassettes/New_API_Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -230
  293. data/spec/vcr_cassettes/New_API_Mixed_metrics/Should_send_mixed_metric_request.yml +0 -300
  294. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/agent_properties.yml +0 -124
  295. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +0 -61
  296. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_tenant.yml +0 -55
  297. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -23
  298. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_XA_datasource_should_be_doable.json +0 -23
  299. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_deployment_should_be_doable.json +0 -23
  300. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_non-XA_datasource_should_be_doable.json +0 -23
  301. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -23
  302. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -23
  303. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -23
  304. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -32
  305. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -23
  306. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -23
  307. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -23
  308. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Update_collection_intervals_should_be_performed_and_eventually_respond_with_success.json +0 -23
  309. data/spec/vcr_cassettes/Operation/NonSecure/Operation/should_not_be_possible_to_perform_on_closed_client.json +0 -12
  310. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
  311. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
  312. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_no_host.json +0 -3
  313. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established.json +0 -9
  314. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
  315. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback.json +0 -18
  316. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +0 -13
  317. data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_feed.yml +0 -61
  318. data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_tenant.yml +0 -55
  319. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -23
  320. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_datasource_should_be_doable.json +0 -23
  321. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_deployment_should_be_doable.json +0 -23
  322. data/spec/vcr_cassettes/Operation/Secure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -23
  323. data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -23
  324. data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -23
  325. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -32
  326. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -23
  327. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -23
  328. data/spec/vcr_cassettes/Operation/Secure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -23
  329. data/spec/vcr_cassettes/Operation/Secure/Operation/should_not_be_possible_to_perform_on_closed_client.json +0 -12
  330. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
  331. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
  332. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_no_host.json +0 -3
  333. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established.json +0 -9
  334. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
  335. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback.json +0 -18
  336. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +0 -13
  337. data/spec/vcr_cassettes/Tokens/Should_be_able_to_create_a_new_token_for_an_actual_user.yml +0 -57
  338. data/spec/vcr_cassettes/Tokens/Should_be_able_to_list_the_available_tokens.yml +0 -49
  339. data/spec/vcr_cassettes/Tokens/Should_get_a_401_when_attempting_to_create_a_token_with_a_wrong_password.yml +0 -56
  340. data/spec/vcr_cassettes/Tokens/Should_get_a_401_when_attempting_to_create_a_token_without_a_password.yml +0 -55
@@ -1,591 +0,0 @@
1
- require_relative '../vcr/vcr_setup'
2
- require_relative '../spec_helper'
3
-
4
- require 'securerandom'
5
-
6
- include Hawkular::Inventory
7
- include Hawkular::Operations
8
-
9
- SKIP_SECURE_CONTEXT = ENV['SKIP_SECURE_CONTEXT'] || '1'
10
-
11
- # examples for operations, it uses the websocket communication
12
- module Hawkular::Operations::RSpec
13
- NON_SECURE_CONTEXT = :NonSecure
14
- SECURE_CONTEXT = :Secure
15
-
16
- [NON_SECURE_CONTEXT, SECURE_CONTEXT].each do |security_context|
17
- next if security_context == SECURE_CONTEXT && SKIP_SECURE_CONTEXT == '1'
18
- if security_context == NON_SECURE_CONTEXT && ENV['SKIP_NON_SECURE_CONTEXT'] == '1'
19
- puts 'skipping non secure context'
20
- next
21
- end
22
-
23
- context "#{security_context}" do
24
- alias_method :helper_host, :host
25
-
26
- let(:host) do
27
- helper_host(security_context)
28
- end
29
-
30
- let(:options) do
31
- {
32
- host: host,
33
- wait_time: WebSocketVCR.live? ? 1.5 : 2,
34
- use_secure_connection: security_context == SECURE_CONTEXT,
35
- credentials: credentials,
36
- options: {
37
- tenant: 'hawkular'
38
- }
39
- }
40
- end
41
-
42
- let(:example) do |e|
43
- e
44
- end
45
-
46
- let(:cassette_name) do |example|
47
- description = example.description
48
- description
49
- end
50
-
51
- let(:client) do
52
- Client.new(options)
53
- end
54
-
55
- before(:all) do
56
- WebSocketVCR.configure do |c|
57
- c.hook_uris = [helper_host(security_context)]
58
- end
59
- end
60
-
61
- describe 'Operation/Websocket connection' do
62
- around(:each) do |example|
63
- record_websocket("Operation/#{security_context}/Websocket_connection",
64
- nil,
65
- cassette_name,
66
- example)
67
- end
68
-
69
- it 'should be established' do
70
- ws = client.ws
71
- expect(ws).not_to be nil
72
- expect(ws.open?).to be true
73
- end
74
-
75
- it 'should be established via entrypoint' do
76
- ep = host_with_scheme(host, security_context == SECURE_CONTEXT)
77
-
78
- client = Client.new(options.merge entrypoint: ep, host: nil)
79
- ws = client.ws
80
- expect(ws).not_to be nil
81
- expect(ws.open?).to be true
82
- end
83
-
84
- it 'should run into error callback' do
85
- noop = { operationName: 'noop', resourcePath: '/bla' }
86
- operation_outcome = {}
87
- client.invoke_generic_operation(noop) do |on|
88
- on.success do |_data|
89
- operation_outcome[:data] = 'should run into error'
90
- end
91
- on.failure do |_error|
92
- operation_outcome[:data] = 'fail'
93
- end
94
- end
95
- expect(wait_for(operation_outcome)).to eq 'fail'
96
- end
97
-
98
- it 'should run into error callback because bad hash parameters' do
99
- noop = { operationName: 'noop' }
100
- operation_outcome = {}
101
- client.invoke_generic_operation(noop) do |on|
102
- on.success do |_data|
103
- operation_outcome[:data] = 'should run into error'
104
- end
105
- on.failure do |error|
106
- operation_outcome[:data] = error
107
- end
108
- end
109
- expect(wait_for(operation_outcome)).to eq 'Hash property resourcePath must be specified'
110
- end
111
-
112
- it 'should bail with hash property error because no callback at all' do
113
- noop = { operationName: 'noop' }
114
- expect { client.invoke_generic_operation(noop) }.to raise_error(ArgumentError,
115
- 'You need to specify error callback')
116
- end
117
-
118
- it 'should bail with hash property error because no error-callback ' do
119
- noop = { operationName: 'noop' }
120
- expect do
121
- client.invoke_generic_operation(noop) do |on|
122
- on.success do |_data|
123
- fail 'This should have failed'
124
- end
125
- end
126
- end.to raise_error(ArgumentError, 'You need to specify error callback')
127
- end
128
-
129
- it 'should bail with no host' do
130
- expect do
131
- Client.new(options.merge host: nil)
132
- end.to raise_error(StandardError, 'no parameter ":host" or ":entrypoint" given')
133
- end
134
- end
135
-
136
- describe 'Operation/Operation' do
137
- before(:all) do
138
- @random_uuid = SecureRandom.uuid
139
- @not_so_random_uuid = 'not_so_random_uuid'
140
- end
141
-
142
- around(:each) do |example|
143
- record("Operation/#{security_context}/Helpers", nil, 'get_tenant') do
144
- ::RSpec::Mocks.with_temporary_scope do
145
- mock_inventory_client
146
- @inventory_client = ::Hawkular::Inventory::Client.create(
147
- options.merge entrypoint: host_with_scheme(host, security_context == SECURE_CONTEXT))
148
- end
149
- inventory_client = @inventory_client
150
- remove_instance_variable(:@inventory_client)
151
- @tenant_id = inventory_client.get_tenant
152
- record("Operation/#{security_context}/Helpers", { tenant_id: @tenant_id }, 'get_feed') do
153
- @feed_id = inventory_client.list_feeds[0]
154
- end
155
- record("Operation/#{security_context}/Helpers", { tenant_id: @tenant_id, feed_id: @feed_id },
156
- 'agent_properties') do
157
- @wf_server_resource_id = 'Local~~'
158
- wf_path = CanonicalPath.new(tenant_id: @tenant_id,
159
- feed_id: @feed_id,
160
- resource_ids: [@wf_server_resource_id])
161
- wf_agent_path = path_for_installed_agent(wf_path)
162
- @agent_immutable = immutable(inventory_client, wf_agent_path)
163
- end
164
- end
165
- @bindings = { random_uuid: @random_uuid, tenant_id: @tenant_id, feed_id: @feed_id }
166
- record_websocket("Operation/#{security_context}/Operation",
167
- @bindings,
168
- cassette_name,
169
- example)
170
- end
171
-
172
- it 'Add JDBC driver should add the driver' do # Unless it runs in a container
173
- driver_name = 'CreatedByRubyDriver' + @not_so_random_uuid
174
- driver_bits = IO.binread("#{File.dirname(__FILE__)}/../resources/driver.jar")
175
- wf_path = CanonicalPath.new(tenant_id: @tenant_id,
176
- feed_id: @feed_id,
177
- resource_ids: [@wf_server_resource_id]).to_s
178
-
179
- actual_data = {}
180
-
181
- client.add_jdbc_driver(resource_path: wf_path,
182
- driver_jar_name: 'driver.jar',
183
- driver_name: driver_name,
184
- module_name: 'foo.bar' + @not_so_random_uuid, # jboss module
185
- driver_class: 'com.mysql.jdbc.Driver',
186
- binary_content: driver_bits) do |on|
187
- on.success do |data|
188
- actual_data[:data] = data
189
- end
190
- on.failure do |error|
191
- actual_data[:data] = error
192
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
193
- end
194
- end
195
- actual_data = wait_for actual_data
196
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
197
- expect(actual_data['message']).to start_with('Added JDBC Driver') unless @agent_immutable
198
- expect(actual_data['driverName']).to eq(driver_name) unless @agent_immutable
199
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
200
- end
201
-
202
- it 'Restart should be performed and eventually respond with success' do
203
- wf_server_resource_id = 'Local~~'
204
- status_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-status.war'
205
- path = CanonicalPath.new(tenant_id: @tenant_id,
206
- feed_id: @feed_id,
207
- resource_ids: [wf_server_resource_id, status_war_resource_id])
208
-
209
- restart = {
210
- resource_path: path.to_s,
211
- deployment_name: 'hawkular-status.war'
212
- }
213
-
214
- actual_data = {}
215
- client.restart_deployment(restart) do |on|
216
- on.success do |data|
217
- actual_data[:data] = data
218
- end
219
- on.failure do |error|
220
- actual_data[:data] = {}
221
- puts 'error callback was called, reason: ' + error.to_s
222
- end
223
- end
224
-
225
- # expectations don't work from callbacks so waiting for the results via blocking helper `wait_for`
226
- actual_data = wait_for actual_data
227
- expect(actual_data['status']).to eq('OK')
228
- expect(actual_data['resourcePath']).to eq(path.up.to_s)
229
- expect(actual_data['message']).to start_with('Performed [Restart Deployment] on')
230
- end
231
-
232
- it 'Restart should not be performed if resource path is wrong' do
233
- wf_server_resource_id = 'Unknown~~'
234
- wrong_war_resource_id = 'Unknown~%2Fdeployment%3Dnon-existent.war'
235
- path = CanonicalPath.new(tenant_id: @tenant_id,
236
- feed_id: @feed_id,
237
- resource_ids: [wf_server_resource_id, wrong_war_resource_id])
238
-
239
- restart = {
240
- resource_path: path.to_s,
241
- deployment_name: 'non-existent.war'
242
- }
243
- actual_data = {}
244
- client.restart_deployment(restart) do |on|
245
- on.success do |_|
246
- actual_data[:data] = { error: 'the operation should have failed' }
247
- end
248
- on.failure do |error|
249
- actual_data[:data] = { error: error }
250
- end
251
- end
252
- actual_data = wait_for actual_data
253
- expect(actual_data[:error]).to start_with('Could not perform [Restart Deployment] on a [Application] given')
254
- end
255
-
256
- it 'Disable should be performed and eventually respond with success' do
257
- wf_server_resource_id = 'Local~~'
258
- status_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-status.war'
259
- path = CanonicalPath.new(tenant_id: @tenant_id,
260
- feed_id: @feed_id,
261
- resource_ids: [wf_server_resource_id, status_war_resource_id])
262
-
263
- disable = {
264
- resource_path: path.to_s,
265
- deployment_name: 'hawkular-status.war'
266
- }
267
- actual_data = {}
268
- client.disable_deployment(disable) do |on|
269
- on.success do |data|
270
- actual_data[:data] = data
271
- end
272
- on.failure do |error|
273
- actual_data[:data] = error
274
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
275
- end
276
- end
277
- actual_data = wait_for actual_data
278
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
279
- expect(actual_data['message']).to start_with('Performed [Disable Deployment] on') unless @agent_immutable
280
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
281
- end
282
-
283
- it 'Add non-XA datasource should be doable' do
284
- wf_server_resource_id = 'Local~~'
285
- wf_path = CanonicalPath.new(tenant_id: @tenant_id,
286
- feed_id: @feed_id,
287
- resource_ids: [wf_server_resource_id]).to_s
288
- payload = {
289
- # compulsory fields
290
- resourcePath: wf_path,
291
- xaDatasource: false,
292
- datasourceName: 'CreatedByRubyDS' + @random_uuid,
293
- jndiName: 'java:jboss/datasources/CreatedByRubyDS' + @random_uuid,
294
- driverName: 'h2',
295
- # this is probably a bug (driver class should be already defined in driver)
296
- driverClass: 'org.h2.Driver',
297
- connectionUrl: 'dbc:h2:mem:ruby;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
298
-
299
- # optional
300
- datasourceProperties: {
301
- someKey: 'someValue'
302
- },
303
- userName: 'sa',
304
- password: 'sa',
305
- securityDomain: 'other'
306
- # xaDataSourceClass: 'clazz' for xa DS
307
- }
308
-
309
- actual_data = {}
310
- client.add_datasource(payload) do |on|
311
- on.success do |data|
312
- actual_data[:data] = data
313
- end
314
- on.failure do |error|
315
- actual_data[:data] = error
316
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
317
- end
318
- end
319
- actual_data = wait_for actual_data
320
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
321
- expect(actual_data['message']).to start_with('Added Datasource') unless @agent_immutable
322
- expect(actual_data['xaDatasource']).to be_falsey unless @agent_immutable
323
- expect(actual_data['datasourceName']).to eq(payload[:datasourceName]) unless @agent_immutable
324
- expect(actual_data['resourcePath']).to eq(payload[:resourcePath]) unless @agent_immutable
325
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
326
- end
327
-
328
- it 'Add XA datasource should be doable' do
329
- wf_server_resource_id = 'Local~~'
330
- wf_path = CanonicalPath.new(tenant_id: @tenant_id,
331
- feed_id: @feed_id,
332
- resource_ids: [wf_server_resource_id]).to_s
333
- payload = {
334
- # compulsory fields
335
- resourcePath: wf_path,
336
- xaDatasource: true,
337
- datasourceName: 'CreatedByRubyDSXA' + @random_uuid,
338
- jndiName: 'java:jboss/datasources/CreatedByRubyDSXA' + @random_uuid,
339
- driverName: 'h2',
340
- xaDataSourceClass: 'org.h2.jdbcx.JdbcDataSource',
341
- # this is probably a bug (driver class should be already defined in driver)
342
- driverClass: 'org.h2.Driver',
343
- connectionUrl: 'dbc:h2:mem:ruby;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
344
-
345
- # optional
346
- datasourceProperties: {
347
- someKey: 'someValue'
348
- },
349
- userName: 'sa',
350
- password: 'sa',
351
- securityDomain: 'other'
352
- }
353
-
354
- actual_data = {}
355
- client.add_datasource(payload) do |on|
356
- on.success do |data|
357
- actual_data[:data] = data
358
- end
359
- on.failure do |error|
360
- actual_data[:data] = error
361
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
362
- end
363
- end
364
- actual_data = wait_for actual_data
365
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
366
- expect(actual_data['message']).to start_with('Added Datasource') unless @agent_immutable
367
- expect(actual_data['xaDatasource']).to be_truthy unless @agent_immutable
368
- expect(actual_data['datasourceName']).to eq(payload[:datasourceName]) unless @agent_immutable
369
- expect(actual_data['resourcePath']).to eq(payload[:resourcePath]) unless @agent_immutable
370
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
371
- end
372
-
373
- it 'should not be possible to perform on closed client' do
374
- restart = {
375
- resource_path: '/t;t1/f;whatever/r;something',
376
- deployment_name: 'something.war'
377
- }
378
-
379
- # close the connection
380
- client.close_connection!
381
- expect do
382
- client.restart_deployment(restart)
383
- end.to raise_error(RuntimeError, /Handshake with server has not been done./)
384
- end
385
-
386
- it 'Restart can be run multiple times in parallel' do
387
- wf_server_resource_id = 'Local~~'
388
- status_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-status.war'
389
- console_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-wildfly-agent-download.war'
390
- path1 = CanonicalPath.new(tenant_id: @tenant_id,
391
- feed_id: @feed_id,
392
- resource_ids: [wf_server_resource_id, status_war_resource_id])
393
- path2 = CanonicalPath.new(tenant_id: @tenant_id,
394
- feed_id: @feed_id,
395
- resource_ids: [wf_server_resource_id, console_war_resource_id])
396
-
397
- restart1 = {
398
- resource_path: path1.to_s,
399
- deployment_name: 'hawkular-status.war'
400
- }
401
-
402
- restart2 = {
403
- resource_path: path2.to_s,
404
- deployment_name: 'hawkular-wildfly-agent-download.war'
405
- }
406
-
407
- # run the first operation w/o registering the callback
408
- client.restart_deployment(restart1)
409
-
410
- actual_data = {}
411
- # run the 2nd operation with 2 callback blocks (the happy path and the less happy path)
412
- client.restart_deployment(restart2) do |on|
413
- on.success do |data|
414
- actual_data[:data] = data
415
- end
416
- on.failure do |error|
417
- actual_data[:data] = {}
418
- puts 'error callback was called, reason: ' + error.to_s
419
- end
420
- end
421
-
422
- actual_data = wait_for actual_data
423
- expect(actual_data['status']).to eq('OK')
424
- expect(actual_data['resourcePath']).to eq(path2.up.to_s)
425
- expect(actual_data['message']).to start_with('Performed [Restart Deployment] on')
426
- end
427
-
428
- it 'Add deployment should be doable' do
429
- wf_server_resource_id = 'Local~~'
430
- app_name = 'sample.war'
431
- war_file = IO.binread("#{File.dirname(__FILE__)}/../resources/#{app_name}")
432
- wf_path = CanonicalPath.new(tenant_id: @tenant_id,
433
- feed_id: @feed_id,
434
- resource_ids: [wf_server_resource_id]).to_s
435
-
436
- actual_data = {}
437
- client.add_deployment(resource_path: wf_path,
438
- destination_file_name: app_name,
439
- binary_content: war_file) do |on|
440
- on.success do |data|
441
- actual_data[:data] = data
442
- end
443
- on.failure do |error|
444
- actual_data[:data] = error
445
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
446
- end
447
- end
448
- actual_data = wait_for actual_data
449
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
450
- expect(actual_data['message']).to start_with('Performed [Deploy] on') unless @agent_immutable
451
- expect(actual_data['destinationFileName']).to eq(app_name) unless @agent_immutable
452
- expect(actual_data['resourcePath']).to eq(wf_path) unless @agent_immutable
453
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
454
- end
455
-
456
- it 'Undeploy deployment should be performed and eventually respond with success' do
457
- wf_server_resource_id = 'Local~~'
458
- sample_app_resource_id = 'Local~%2Fdeployment=sample.war'
459
- path = CanonicalPath.new(tenant_id: @tenant_id,
460
- feed_id: @feed_id,
461
- resource_ids: [wf_server_resource_id, sample_app_resource_id])
462
- undeploy = {
463
- resource_path: path.to_s,
464
- deployment_name: 'sample.war'
465
- }
466
- actual_data = {}
467
- client.undeploy(undeploy) do |on|
468
- on.success do |data|
469
- actual_data[:data] = data
470
- end
471
- on.failure do |error|
472
- actual_data[:data] = error
473
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
474
- end
475
- end
476
- actual_data = wait_for actual_data
477
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
478
- expect(actual_data['message']).to start_with('Performed [Undeploy] on') unless @agent_immutable
479
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
480
- end
481
-
482
- it 'Remove datasource should be performed and eventually respond with success' do
483
- wf_server_resource_id = 'Local~~'
484
- datasource_resource_id = 'Local~%2Fsubsystem%3Ddatasources%2Fdata-source%3DCreatedByRubyDS' + @random_uuid
485
- path = CanonicalPath.new(tenant_id: @tenant_id,
486
- feed_id: @feed_id,
487
- resource_ids: [wf_server_resource_id, datasource_resource_id])
488
-
489
- operation = {
490
- resourcePath: path.to_s
491
- }
492
-
493
- actual_data = {}
494
- client.invoke_specific_operation(operation, 'RemoveDatasource') do |on|
495
- on.success do |data|
496
- actual_data[:data] = data
497
- end
498
- on.failure do |error|
499
- actual_data[:data] = error
500
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
501
- end
502
- end
503
- actual_data = wait_for actual_data
504
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
505
- expect(actual_data['message']).to start_with('Performed [Remove] on') unless @agent_immutable
506
- expect(actual_data['serverRefreshIndicator']).to eq('RELOAD-REQUIRED') unless @agent_immutable
507
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
508
- end
509
-
510
- it 'Remove JDBC driver should be performed and eventually respond with success' do
511
- # Unless it runs in a container
512
- driver_resource_id = 'Local~%2Fsubsystem%3Ddatasources%2Fjdbc-driver%3DCreatedByRubyDriver'
513
- driver_resource_id << @not_so_random_uuid
514
- path = CanonicalPath.new(tenant_id: @tenant_id,
515
- feed_id: @feed_id,
516
- resource_ids: [@wf_server_resource_id, driver_resource_id]).to_s
517
-
518
- actual_data = {}
519
- client.invoke_specific_operation({ resourcePath: path }, 'RemoveJdbcDriver') do |on|
520
- on.success do |data|
521
- actual_data[:data] = data
522
- end
523
- on.failure do |error|
524
- actual_data[:data] = error
525
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
526
- end
527
- end
528
- actual_data = wait_for actual_data
529
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
530
- expect(actual_data['resourcePath']).to eq(path) unless @agent_immutable
531
- expect(actual_data['message']).to start_with(
532
- 'Performed [Remove] on a [JDBC Driver]') unless @agent_immutable
533
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
534
- end
535
-
536
- xit 'Export JDR should retrieve the zip file with the report' do
537
- wf_server_resource_id = 'Local~~'
538
- path = CanonicalPath.new(tenant_id: @tenant_id,
539
- feed_id: @feed_id,
540
- resource_ids: [wf_server_resource_id]).to_s
541
-
542
- actual_data = {}
543
- client.export_jdr(path) do |on|
544
- on.success do |data|
545
- actual_data[:data] = data
546
- end
547
- on.failure do |error|
548
- actual_data[:data] = {}
549
- puts 'error callback was called, reason: ' + error.to_s
550
- end
551
- end
552
- actual_data = wait_for actual_data
553
- expect(actual_data['status']).to eq('OK')
554
- expect(actual_data['resourcePath']).to eq(path)
555
- expect(actual_data['message']).to start_with('Performed [Export JDR] on')
556
- expect(actual_data['fileName']).to start_with('jdr_')
557
- end
558
-
559
- it 'Update collection intervals should be performed and eventually respond with success' do
560
- wf_server_resource_id = 'Local~~'
561
- wf_agent_id = 'Local~%2Fsubsystem%3Dhawkular-wildfly-agent'
562
- path = CanonicalPath.new(tenant_id: @tenant_id,
563
- feed_id: @feed_id,
564
- resource_ids: [wf_server_resource_id, wf_agent_id])
565
-
566
- hash = {
567
- resourcePath: path.to_s,
568
- metricTypes: { 'WildFly Memory Metrics~Heap Max' => 77, 'Unknown~Metric' => 666 },
569
- availTypes: { 'Server Availability~Server Availability' => 77, 'Unknown~Avail' => 666 }
570
- }
571
-
572
- actual_data = {}
573
- client.update_collection_intervals(hash) do |on|
574
- on.success do |data|
575
- actual_data[:data] = data
576
- end
577
- on.failure do |error|
578
- actual_data[:data] = error
579
- puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
580
- end
581
- end
582
- actual_data = wait_for actual_data
583
- expect(actual_data['status']).to eq('OK') unless @agent_immutable
584
- expect(
585
- actual_data['message']).to start_with('Performed [Update Collection Intervals] on') unless @agent_immutable
586
- expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
587
- end
588
- end
589
- end
590
- end
591
- end