hawkular-client 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.rdoc +5 -2
  3. data/lib/hawkular/hawkular_client.rb +1 -1
  4. data/lib/hawkular/inventory/inventory_api.rb +2 -1
  5. data/lib/hawkular/metrics/metric_api.rb +4 -1
  6. data/lib/hawkular/operations/operations_api.rb +7 -4
  7. data/lib/hawkular/version.rb +1 -1
  8. data/spec/integration/inventory_spec.rb +516 -466
  9. data/spec/integration/metric_spec.rb +612 -561
  10. data/spec/integration/operations_spec.rb +425 -504
  11. data/spec/spec_helper.rb +73 -19
  12. data/spec/vcr_cassettes/Inventory/{Connection → NonSecure/Connection/Templates}/Should_err_on_bad_credentials.yml +6 -4
  13. data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Explicit_Credentials.yml +13 -9
  14. data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Implicit_Credentials.yml +13 -9
  15. data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates → NonSecure/inventory_0_17}/Client_should_listen_on_various_inventory_events.json +5 -5
  16. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Client_should_listen_on_various_inventory_events.yml +21 -13
  17. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/create_url.yml +12 -10
  18. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Helpers/generate_some_events_for_websocket.yml +51 -37
  19. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/get_feeds.yml +11 -9
  20. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_List_datasources_with_no_props.yml +11 -7
  21. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed.yml +6 -4
  22. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed_again.yml +16 -10
  23. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +664 -0
  24. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource.yml +31 -19
  25. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource_with_metric.yml +77 -49
  26. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resourcetype.yml +16 -10
  27. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_and_delete_feed.yml +19 -13
  28. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
  29. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
  30. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_have_the_same_requested_metric_type_id.yml +8 -8
  31. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_URLs.yml +29 -7
  32. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys.yml +10 -8
  33. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys_with_props.yml +24 -17
  34. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_all_the_resource_types.yml +6 -4
  35. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_WildFly.yml +31 -13
  36. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_nested_resource.yml +16 -10
  37. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_feeds.yml +9 -7
  38. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_heap_metrics_for_WildFlys.yml +196 -188
  39. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_for_WildFlys.yml +72 -68
  40. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_metric_type.yml +12 -44
  41. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_resource_type.yml +63 -61
  42. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource.yml +220 -156
  43. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource_type.yml +200 -140
  44. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_recursive_children_of_WildFly.yml +30 -12
  45. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_relationships_of_WildFly.yml +129 -113
  46. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_resources_for_feed.yml +12 -10
  47. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_bad_feed.yml +6 -4
  48. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_feed.yml +7 -5
  49. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_not_find_an_unknown_resource.yml +6 -4
  50. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_nested_resource.yml +6 -4
  51. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_resource.yml +15 -10
  52. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_the_version.yml +8 -6
  53. data/spec/vcr_cassettes/Inventory/Secure/Connection/Templates/Should_err_on_bad_credentials.yml +44 -0
  54. data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +101 -0
  55. data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +101 -0
  56. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +47 -0
  57. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +207 -0
  58. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/create_url.yml +52 -0
  59. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +411 -0
  60. data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml → Secure/inventory_0_17/Templates/Helpers/get_feeds.yml} +13 -11
  61. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +133 -0
  62. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed.yml +59 -0
  63. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed_again.yml +181 -0
  64. data/spec/vcr_cassettes/Inventory/{inventory_0_17 → Secure/inventory_0_17}/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +108 -150
  65. data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates/Should_create_and_get_a_resource.yml → Secure/inventory_0_17/Templates/Should_create_a_resource.yml} +45 -87
  66. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +846 -0
  67. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +169 -0
  68. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +166 -0
  69. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
  70. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
  71. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +73 -0
  72. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_URLs.yml +90 -0
  73. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys.yml +70 -0
  74. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +138 -0
  75. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +59 -0
  76. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +333 -0
  77. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +180 -0
  78. data/spec/vcr_cassettes/{Operation/Helpers/get_feed.yml → Inventory/Secure/inventory_0_17/Templates/Should_list_feeds.yml} +13 -11
  79. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +943 -0
  80. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +361 -0
  81. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +90 -0
  82. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +294 -0
  83. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +871 -0
  84. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +740 -0
  85. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +1117 -0
  86. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +393 -0
  87. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +84 -0
  88. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +55 -0
  89. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_feed.yml +166 -0
  90. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +59 -0
  91. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +66 -0
  92. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +71 -0
  93. data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_the_version.yml +50 -0
  94. data/spec/vcr_cassettes/Inventory/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml +114 -0
  95. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Get_metric_definition_by_id.yml +10 -8
  96. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Retrieve_metric_rate_points.yml +18 -14
  97. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Availability_definition.yml +18 -14
  98. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Counter_definition.yml +18 -14
  99. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_gauge_definition.yml +18 -14
  100. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_push_metric_data_to_existing_gauge.yml +9 -7
  101. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_update_tags_for_Availability_definition.yml +28 -22
  102. data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_update_tags_for_gauge_definition.yml +28 -22
  103. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +12 -8
  104. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +14 -10
  105. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_group_contiguous_values.yml +10 -6
  106. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +19 -13
  107. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +31 -21
  108. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +14 -10
  109. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +12 -8
  110. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +28 -18
  111. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +38 -24
  112. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +32 -20
  113. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +19 -13
  114. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +14 -10
  115. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +12 -8
  116. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +32 -20
  117. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +19 -13
  118. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_return_periods.yml +10 -6
  119. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +31 -21
  120. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +48 -52
  121. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +39 -25
  122. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +36 -24
  123. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/No_Tenant/Should_fail.yml +6 -4
  124. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Simple/Should_be_Cool.yml +2 -2
  125. data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Status/Should_return_the_version.yml +5 -3
  126. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
  127. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -0
  128. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +3 -3
  129. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -0
  130. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -0
  131. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +3 -3
  132. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -0
  133. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -0
  134. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -0
  135. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -0
  136. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +3 -3
  137. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -0
  138. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -0
  139. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -0
  140. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_return_periods.yml +0 -0
  141. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -0
  142. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -0
  143. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -0
  144. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Simple/Should_be_Cool.yml +0 -0
  145. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Status/Should_return_the_version.yml +0 -0
  146. data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Tenants/Should_create_and_return_tenant.yml +0 -0
  147. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +19 -15
  148. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +21 -17
  149. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_group_contiguous_values.yml +17 -13
  150. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +29 -23
  151. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +47 -37
  152. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +21 -17
  153. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +19 -15
  154. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +44 -34
  155. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +60 -46
  156. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +51 -39
  157. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +29 -23
  158. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +21 -17
  159. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +19 -15
  160. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +51 -39
  161. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +29 -23
  162. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_periods.yml +17 -13
  163. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
  164. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +12 -10
  165. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +47 -37
  166. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +328 -0
  167. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +32 -32
  168. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +70 -74
  169. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +61 -47
  170. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +55 -43
  171. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/No_Tenant/Should_fail.yml +9 -7
  172. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Simple/Should_be_Cool.yml +3 -3
  173. data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Status/Should_return_the_version.yml +10 -8
  174. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
  175. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +51 -0
  176. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +92 -0
  177. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +101 -0
  178. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +101 -0
  179. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +101 -0
  180. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +50 -0
  181. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +146 -0
  182. data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +146 -0
  183. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
  184. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
  185. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
  186. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
  187. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
  188. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
  189. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
  190. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
  191. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
  192. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
  193. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
  194. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
  195. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
  196. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
  197. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
  198. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
  199. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
  200. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
  201. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
  202. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +285 -0
  203. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/No_Tenant/Should_fail.yml +50 -0
  204. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Simple/Should_be_Cool.yml +48 -0
  205. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Status/Should_return_the_version.yml +44 -0
  206. data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
  207. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
  208. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
  209. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
  210. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
  211. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
  212. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
  213. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
  214. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
  215. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
  216. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
  217. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
  218. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
  219. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
  220. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
  221. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
  222. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
  223. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
  224. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +51 -0
  225. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
  226. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +364 -0
  227. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
  228. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
  229. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +285 -0
  230. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/No_Tenant/Should_fail.yml +50 -0
  231. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Simple/Should_be_Cool.yml +48 -0
  232. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Status/Should_return_the_version.yml +44 -0
  233. data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
  234. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +61 -0
  235. data/spec/vcr_cassettes/Operation/{Helpers → NonSecure/Helpers/Templates}/get_tenant.yml +8 -5
  236. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
  237. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_datasource_should_be_doable.json +23 -0
  238. data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/Add_deployment_should_be_doable.json +4 -7
  239. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
  240. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
  241. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
  242. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
  243. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
  244. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
  245. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
  246. data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/should_not_be_possible_to_perform_on_closed_client.json +1 -1
  247. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
  248. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
  249. data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_bail_with_no_host.json +0 -0
  250. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established.json +9 -0
  251. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
  252. data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback.json +18 -0
  253. data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_run_into_error_callback_because_bad_hash_parameters.json +1 -1
  254. data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_feed.yml +61 -0
  255. data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_tenant.yml +55 -0
  256. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
  257. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_datasource_should_be_doable.json +23 -0
  258. data/spec/vcr_cassettes/Operation/Secure/Operation/Add_deployment_should_be_doable.json +23 -0
  259. data/spec/vcr_cassettes/Operation/Secure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
  260. data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
  261. data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
  262. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
  263. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
  264. data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
  265. data/spec/vcr_cassettes/Operation/Secure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
  266. data/spec/vcr_cassettes/Operation/Secure/Operation/should_not_be_possible_to_perform_on_closed_client.json +12 -0
  267. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
  268. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
  269. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_no_host.json +3 -0
  270. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established.json +9 -0
  271. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
  272. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback.json +18 -0
  273. data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +13 -0
  274. metadata +526 -282
  275. data/spec/vcr_cassettes/Metrics/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
  276. data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -48
  277. data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
  278. data/spec/vcr_cassettes/Operation/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -26
  279. data/spec/vcr_cassettes/Operation/Operation/Add_datasource_should_be_doable.json +0 -26
  280. data/spec/vcr_cassettes/Operation/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -26
  281. data/spec/vcr_cassettes/Operation/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -26
  282. data/spec/vcr_cassettes/Operation/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -26
  283. data/spec/vcr_cassettes/Operation/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -40
  284. data/spec/vcr_cassettes/Operation/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -26
  285. data/spec/vcr_cassettes/Operation/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -26
  286. data/spec/vcr_cassettes/Operation/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -26
  287. data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
  288. data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
  289. data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established.json +0 -9
  290. data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
  291. data/spec/vcr_cassettes/Operation/Websocket_connection/should_run_into_error_callback.json +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9395092bd67a428a2b1bf8fffa763a653e80e74
4
- data.tar.gz: 85e58ded92c9b97c33eb37b77746a485f22ab65d
3
+ metadata.gz: 9dff0c0c4a4cf26161263ef21f06e0962f94fbf0
4
+ data.tar.gz: 665dd8784d3495ec6da84849b702ef105498ae59
5
5
  SHA512:
6
- metadata.gz: b17497312ea6c135e2e12fab9759235a993319980ed3f9e5e6cd3e1a1dfb2c19f9a54edc0bacf7a22f8f27ca9030f222132a061002e2ff19d1b8bbd379fcd8c8
7
- data.tar.gz: bb4338e14b659d5ac1ee564e85e9c7dcaed201cf7e218c8e48e96f8774d59d40a0dd9919ce9a255a83fbd664a1fae979cad9add0d7628096d1a08ca566e01f0c
6
+ metadata.gz: caa40d7fc69a01af67584e1a1f2c821043a54955c647746d176ffba1c0bf3600690fb7667b11632c5a915ac6e3b761efa8e3c47ecf35538a62c5178e60a1b43a
7
+ data.tar.gz: 2a236c3bc8117a808aa91948378f33f6fc86afb10ce889eade4b9f11ac26ed89fe1d7dc46f3115fe12f4787045faf78fdd69cf58d56cc54740b16908aa1c874f
data/CHANGES.rdoc CHANGED
@@ -3,6 +3,11 @@
3
3
  This document describes the relevant changes between releases of the
4
4
  _hawkular-client_ project.
5
5
 
6
+ === V 2.7.0
7
+
8
+ * Support for SSL connections
9
+ * Fix fetching stats to support rates
10
+
6
11
  === V 2.6.0
7
12
 
8
13
  * Fix fetching operation params in the recommended way
@@ -11,8 +16,6 @@ _hawkular-client_ project.
11
16
 
12
17
  Full list of items can be found at https://github.com/hawkular/hawkular-client-ruby/milestone/11?closed=1
13
18
 
14
-
15
-
16
19
  === V 2.5.0
17
20
 
18
21
  * Fix failure of list operations when no properties are passed - don't parse params
@@ -58,7 +58,7 @@ module Hawkular
58
58
 
59
59
  # this is in a dedicated method, because constructor opens the websocket connection to make the handshake
60
60
  def init_operations_client
61
- Operations::OperationsClient.new(entrypoint: @state[:entrypoint].to_s.sub(/^https?/, 'ws'),
61
+ Operations::OperationsClient.new(entrypoint: @state[:entrypoint],
62
62
  credentials: @state[:credentials],
63
63
  options: @state[:options])
64
64
  end
@@ -488,7 +488,8 @@ module Hawkular::Inventory
488
488
  }
489
489
  ws_options[:headers][:'Hawkular-Tenant'] = tenant_id
490
490
 
491
- url = "#{entrypoint.gsub(/https?/, 'ws')}/ws/events?tenantId=#{tenant_id}&type=#{type}&action=#{action}"
491
+ url = normalize_entrypoint_url(@entrypoint, "ws/events?tenantId=#{tenant_id}&type=#{type}&action=#{action}")
492
+ url = url_with_websocket_scheme(url)
492
493
  @ws = WebSocket::Client::Simple.connect url, ws_options do |client|
493
494
  client.on :message do |msg|
494
495
  parsed_message = JSON.parse(msg.data)
@@ -44,6 +44,7 @@ module Hawkular::Metrics
44
44
  # @param gauge_ids [Array[String]] list of gauge ids
45
45
  # @param counter_ids [Array[String]] list of counter ids
46
46
  # @param avail_ids [Array[String]] list of availability ids
47
+ # @param rates [Boolean] flag to include rates for gauges and counters metrics
47
48
  # @param starts [Integer] optional timestamp (default now - 8h)
48
49
  # @param ends [Integer] optional timestamp (default now)
49
50
  # @param bucket_duration [String] optional interval (default 3600s)
@@ -58,10 +59,12 @@ module Hawkular::Metrics
58
59
  # ends: 500,
59
60
  # bucket_duration: '150ms'
60
61
  # )
61
- def query_stats(gauge_ids: [], counter_ids: [], avail_ids: [], starts: nil, ends: nil, bucket_duration: '3600s')
62
+ def query_stats(gauge_ids: [], counter_ids: [], avail_ids: [], rates: false, starts: nil, ends: nil,
63
+ bucket_duration: '3600s')
62
64
  path = '/metrics/stats/query'
63
65
  metrics = { gauge: gauge_ids, counter: counter_ids, availability: avail_ids }
64
66
  data = { metrics: metrics, start: starts, end: ends, bucketDuration: bucket_duration }
67
+ data['types'] = %w(gauge gauge_rate counter counter_rate availability) if rates
65
68
  http_post(path, data)
66
69
  end
67
70
 
@@ -53,6 +53,8 @@ module Hawkular::Operations
53
53
  #
54
54
  # @option args [String] :entrypoint Base URL of the hawkular server e.g. http://localhost:8080.
55
55
  # @option args [String] :host base host:port pair of Hawkular - e.g localhost:8080
56
+ # @option args [Boolean] :use_secure_connection if no entrypoint is provided, determines if use a secure connection
57
+ # defaults to false
56
58
  # @option args [Hash{String=>String}] :credentials Hash of (username password) or token
57
59
  # @option args [Hash{String=>String}] :options Additional rest client options
58
60
  # @option args [Fixnum] :wait_time Time in seconds describing how long the constructor should block - handshake
@@ -60,11 +62,13 @@ module Hawkular::Operations
60
62
  # @example
61
63
  # Hawkular::Operations::OperationsClient.new(credentials: {username: 'jdoe', password: 'password'})
62
64
  def initialize(args)
65
+ args[:use_secure_connection] ||= false
63
66
  ep = args[:entrypoint]
64
67
 
65
68
  unless ep.nil?
66
- uri = URI.parse ep
67
- args[:host] ||= "#{uri.host}:#{uri.port}"
69
+ uri = URI.parse ep.to_s
70
+ args[:host] = "#{uri.host}:#{uri.port}"
71
+ args[:use_secure_connection] = %w(https wss).include?(uri.scheme) ? true : false
68
72
  end
69
73
 
70
74
  fail 'no parameter ":host" or ":entrypoint" given' if args[:host].nil?
@@ -72,8 +76,7 @@ module Hawkular::Operations
72
76
  args[:options] ||= {}
73
77
  args[:wait_time] ||= 0.5
74
78
  super(args[:host], args[:credentials], args[:options])
75
- # note: if we start using the secured WS, change the protocol to wss://
76
- url = "ws://#{args[:host]}/hawkular/command-gateway/ui/ws"
79
+ url = "ws#{args[:use_secure_connection] ? 's' : ''}://#{args[:host]}/hawkular/command-gateway/ui/ws"
77
80
  ws_options = {}
78
81
  creds = args[:credentials]
79
82
  base64_creds = ["#{creds[:username]}:#{creds[:password]}"].pack('m').delete("\r\n")
@@ -4,5 +4,5 @@
4
4
  # @see https://github.com/hawkular
5
5
  module Hawkular
6
6
  # Version of the Hawkular Ruby Gem
7
- VERSION = '2.6.0'.freeze
7
+ VERSION = '2.7.0'.freeze
8
8
  end
@@ -3,582 +3,632 @@ require "#{File.dirname(__FILE__)}/../spec_helper"
3
3
  require 'securerandom'
4
4
 
5
5
  module Hawkular::Inventory::RSpec
6
- ENTRYPOINT = 'http://localhost:8080/hawkular/inventory'
7
6
  DEFAULT_VERSION = '0.17.2.Final'
8
7
  VERSION = ENV['INVENTORY_VERSION'] || DEFAULT_VERSION
9
8
 
10
- include Hawkular::Inventory
11
- describe 'Inventory/Tenants', vcr: { decode_compressed_response: true, record: :new_episodes } do
12
- it 'Should Get Tenant For Explicit Credentials' do
13
- # get the client for given endpoint for given credentials
14
- creds = { username: 'jdoe', password: 'password' }
15
- mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
16
- options = { tenant: 'hawkular' }
17
- client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT,
18
- credentials: creds,
19
- options: options)
20
- tenant = client.get_tenant(creds)
21
- expect(tenant).to eq('hawkular')
22
- end
9
+ SKIP_SECURE_CONTEXT = ENV['SKIP_SECURE_CONTEXT'] || '1'
23
10
 
24
- it 'Should Get Tenant For Implicit Credentials' do
25
- creds = { username: 'jdoe', password: 'password' }
26
- mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
27
- options = { tenant: 'hawkular' }
28
- client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT,
29
- credentials: creds,
30
- options: options)
31
- tenant = client.get_tenant(creds)
32
- expect(tenant).to eq('hawkular')
33
- end
34
- end
11
+ URL_RESOURCE = 'http://bsd.de'
35
12
 
36
- describe 'Inventory Connection' do
37
- it 'Should err on bad credentials' do
38
- VCR.use_cassette('Inventory/Connection/Should err on bad credentials') do
39
- @creds = {
40
- username: '-XX-X-jdoe-X',
41
- password: 'password'
42
- }
43
- expect do
44
- Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT, credentials: @creds)
45
- end.to raise_error(Hawkular::BaseClient::HawkularException, 'Unauthorized')
46
- end
47
- end
48
- end
13
+ NON_SECURE_CONTEXT = :NonSecure
14
+ SECURE_CONTEXT = :Secure
49
15
 
50
- describe 'Inventory' do
51
- URL_RESOURCE = 'http://bsd.de'
52
-
53
- before(:all) do
54
- @creds = {
55
- username: 'jdoe',
56
- password: 'password'
57
- }
58
-
59
- options = { decode_compressed_response: true }
60
- options[:record] = :all if ENV['VCR_UPDATE'] == '1'
61
- client_options = { tenant: 'hawkular' }
62
-
63
- if ENV['VCR_UPDATE'] == '1'
64
- VCR.turn_off!(ignore_cassettes: true)
65
- WebMock.allow_net_connect!
66
- @client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT,
67
- credentials: @creds,
68
- options: client_options)
69
- WebMock.disable_net_connect!
70
- VCR.turn_on!
71
- else
72
- ::RSpec::Mocks.with_temporary_scope do
73
- mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
74
- @client = Hawkular::Inventory::InventoryClient.create(entrypoint: ENTRYPOINT,
75
- credentials: @creds,
76
- options: client_options)
77
- end
78
- end
16
+ [NON_SECURE_CONTEXT, SECURE_CONTEXT].each do |security_context|
17
+ next if security_context == SECURE_CONTEXT && SKIP_SECURE_CONTEXT == '1'
79
18
 
80
- x, y, = @client.version
81
- VCR.use_cassette("Inventory/inventory_#{x}_#{y}/Helpers/get_feeds", options) do
82
- feeds = @client.list_feeds
83
- @state = {
84
- feed_uuid: feeds[0]
85
- }
86
- end
19
+ context "#{security_context}" do
20
+ include Hawkular::Inventory
87
21
 
88
- # create 1 URL resource and its metrics
89
- VCR.use_cassette("Inventory/inventory_#{x}_#{y}/Helpers/create_url", options) do
90
- headers = {}
91
- headers[:'Hawkular-Tenant'] = 'hawkular'
92
- rest_client = RestClient::Resource.new('http://localhost:8080/hawkular/api/urls',
93
- user: @creds[:username],
94
- password: @creds[:password],
95
- headers: headers
96
- )
97
- url_json = {
98
- url: URL_RESOURCE
99
- }.to_json
100
-
101
- begin
102
- rest_client.post(url_json, content_type: 'application/json')
103
- rescue
104
- puts 'failed to create the url'
105
- # no big deal, the url is probably already there
106
- end
22
+ alias_method :helper_entrypoint, :entrypoint
23
+
24
+ let(:entrypoint) do
25
+ helper_entrypoint(security_context, 'inventory')
107
26
  end
108
27
 
109
- sleep 2 if ENV['VCR_UPDATE'] == '1' || ENV['VCR_OFF'] == '1'
110
- end
28
+ describe 'Inventory Tenants' do
29
+ let(:cassette_name) do |example|
30
+ description = example.description
31
+ description
32
+ end
111
33
 
112
- after(:all) do
113
- require 'fileutils'
114
- x, y, = @client.version
115
- FileUtils.rm_rf "#{VCR.configuration.cassette_library_dir}/Inventory/inventory#{x}_#{y}/tmp"
116
- end
34
+ around(:each) do |example|
35
+ record("Inventory/#{security_context}/Tenants", credentials, cassette_name, example: example)
36
+ end
117
37
 
118
- let(:cassette_name) do |example|
119
- description = example.description
120
- description
121
- end
38
+ it 'Should Get Tenant For Explicit Credentials' do
39
+ # get the client for given endpoint for given credentials
40
+ creds = credentials
41
+ mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
42
+ options = { tenant: 'hawkular' }
43
+ client = setup_inventory_client entrypoint, options
44
+ tenant = client.get_tenant(creds)
45
+ expect(tenant).to eq('hawkular')
46
+ end
122
47
 
123
- let(:feed_id) do
124
- @state[:feed_uuid]
125
- end
48
+ it 'Should Get Tenant For Implicit Credentials' do
49
+ creds = credentials
50
+ mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
51
+ options = { tenant: 'hawkular' }
52
+ client = setup_inventory_client entrypoint, options
53
+ tenant = client.get_tenant(creds)
54
+ expect(tenant).to eq('hawkular')
55
+ end
56
+ end
126
57
 
127
- let(:wildfly_type) do
128
- CanonicalPath.new(feed_id: feed_id, resource_type_id: hawk_escape_id('WildFly Server'))
129
- end
58
+ describe 'Inventory Connection' do
59
+ let(:cassette_name) do |example|
60
+ description = example.description
61
+ description
62
+ end
130
63
 
131
- around(:each) do |example|
132
- major, minor, = @client.version
133
- record("Inventory/inventory_#{major}_#{minor}", @state, cassette_name, example: example)
134
- end
64
+ around(:each) do |example|
65
+ record("Inventory/#{security_context}/Connection", credentials, cassette_name, example: example)
66
+ end
135
67
 
136
- it 'Should list feeds' do
137
- feeds = @client.list_feeds
68
+ it 'Should err on bad credentials' do
69
+ @creds = credentials
70
+ @creds[:username] << @creds[:password]
71
+ VCR.eject_cassette
72
+ record("Inventory/#{security_context}/Connection", @creds, cassette_name) do
73
+ expect do
74
+ Hawkular::Inventory::InventoryClient.create(entrypoint: entrypoint, credentials: @creds)
75
+ end.to raise_error(Hawkular::BaseClient::HawkularException, 'Unauthorized')
76
+ end
77
+ end
78
+ end
138
79
 
139
- expect(feeds.size).to be > 0
140
- end
80
+ describe 'Inventory' do
81
+ created_feeds = Set.new
82
+
83
+ before(:all) do
84
+ @creds = credentials
85
+
86
+ @state = {
87
+ super_secret_username: @creds[:username],
88
+ super_secret_password: @creds[:password]
89
+ }
90
+
91
+ client_options = { tenant: 'hawkular' }
92
+
93
+ if ENV['VCR_UPDATE'] == '1'
94
+ VCR.turn_off!(ignore_cassettes: true)
95
+ WebMock.allow_net_connect!
96
+ @client = setup_inventory_client helper_entrypoint(security_context, 'inventory'), client_options
97
+ WebMock.disable_net_connect!
98
+ VCR.turn_on!
99
+ else
100
+ ::RSpec::Mocks.with_temporary_scope do
101
+ mock_inventory_client(VERSION) unless ENV['VCR_UPDATE'] == '1'
102
+ @client = setup_inventory_client helper_entrypoint(security_context, 'inventory'), client_options
103
+ end
104
+ end
105
+
106
+ x, y, = @client.version
107
+ record("Inventory/#{security_context}/inventory_#{x}_#{y}", @state.clone, 'Helpers/get_feeds') do
108
+ feeds = @client.list_feeds
109
+ @state[:feed_uuid] = feeds[0]
110
+ end
111
+
112
+ # create 1 URL resource and its metrics
113
+ record("Inventory/#{security_context}/inventory_#{x}_#{y}", @state.clone, 'Helpers/create_url') do
114
+ headers = {}
115
+ headers[:'Hawkular-Tenant'] = client_options[:tenant]
116
+ rest_client = RestClient::Resource.new(helper_entrypoint(security_context, 'urls'),
117
+ user: credentials[:username],
118
+ password: credentials[:password],
119
+ headers: headers)
120
+ url_json = {
121
+ url: URL_RESOURCE
122
+ }.to_json
123
+
124
+ begin
125
+ rest_client.post(url_json, content_type: 'application/json')
126
+ rescue
127
+ puts 'failed to create the url, it might be already there'
128
+ # no big deal, the url is probably already there
129
+ end
130
+ end
131
+
132
+ sleep 2 if ENV['VCR_UPDATE'] == '1' || ENV['VCR_OFF'] == '1'
133
+ end
141
134
 
142
- it 'Should list resources for feed' do
143
- resources = @client.list_resources_for_feed feed_id
135
+ before(:each) do
136
+ inventory_create_feed_method = @client.method(:create_feed)
137
+ allow(@client).to receive(:create_feed) do |feed|
138
+ created_feeds << feed
139
+ inventory_create_feed_method.call(feed)
140
+ end
141
+ end
144
142
 
145
- expect(resources.size).to be(2)
146
- end
143
+ after(:all) do
144
+ require 'fileutils'
145
+ x, y, = @client.version
146
+ FileUtils.rm_rf "#{VCR.configuration.cassette_library_dir}"\
147
+ "/Inventory/#{security_context}/inventory#{x}_#{y}/tmp"
148
+
149
+ if ENV['VCR_UPDATE'] == '1' || ENV['VCR_OFF'] == '1'
150
+ VCR.turn_off!(ignore_cassettes: true)
151
+ WebMock.allow_net_connect!
152
+ created_feeds.each do |feed|
153
+ begin
154
+ @client.delete_feed feed
155
+ # rubocop:disable HandleExceptions
156
+ rescue
157
+ # rubocop:enable HandleExceptions
158
+ end
159
+ end
160
+ WebMock.disable_net_connect!
161
+ VCR.turn_on!
162
+ end
163
+ end
147
164
 
148
- it 'Should list feeds when using SSL without certificate' do
149
- # change this to the real credentials when updating the VCR
150
- @state[:super_secret_username] = 'username'
151
- @state[:super_secret_password] = 'password'
152
- creds = { username: @state[:super_secret_username],
153
- password: @state[:super_secret_password] }
154
- tori_url = 'https://hawkular.torii.gva.redhat.com/hawkular/inventory'
155
- mock_inventory_client(VERSION)
156
- client = Hawkular::Inventory::InventoryClient.create(entrypoint: tori_url,
157
- credentials: creds,
158
- options: { tenant: 'hawkular',
159
- verify_ssl: OpenSSL::SSL::VERIFY_NONE
160
- })
161
- feeds = client.list_feeds
162
-
163
- expect(feeds.size).to be(1)
164
- end
165
+ let(:cassette_name) do |example|
166
+ description = example.description
167
+ description
168
+ end
165
169
 
166
- it 'Should list all the resource types' do
167
- types = @client.list_resource_types
168
- # new API returns only the feedless types here, while the old one returned all the types
169
- expect(types.size).to be > 0
170
- end
170
+ let(:feed_id) do
171
+ @state[:feed_uuid]
172
+ end
171
173
 
172
- it 'Should list types with feed' do
173
- types = @client.list_resource_types(feed_id)
174
+ let(:wildfly_type) do
175
+ Hawkular::Inventory::CanonicalPath.new(feed_id: feed_id, resource_type_id: hawk_escape_id('WildFly Server'))
176
+ end
174
177
 
175
- expect(types.size).to be >= 18
176
- end
178
+ around(:each) do |example|
179
+ major, minor, = @client.version
180
+ record("Inventory/#{security_context}/inventory_#{major}_#{minor}", @state, cassette_name, example: example)
181
+ end
177
182
 
178
- it 'Should list types with bad feed' do
179
- type = 'does not exist'
180
- types = @client.list_resource_types(type)
181
- expect(type).to eq('does not exist')
183
+ it 'Should list feeds' do
184
+ feeds = @client.list_feeds
182
185
 
183
- expect(types.size).to be(0)
184
- end
186
+ expect(feeds.size).to be > 0
187
+ end
185
188
 
186
- it 'Should list WildFlys' do
187
- resources = @client.list_resources_for_type(wildfly_type.to_s)
189
+ it 'Should list resources for feed' do
190
+ resources = @client.list_resources_for_feed feed_id
188
191
 
189
- expect(resources.size).to be(1)
190
- end
192
+ expect(resources.size).to be(2)
193
+ end
191
194
 
192
- it 'Should list WildFlys with props' do
193
- resources = @client.list_resources_for_type(wildfly_type.to_s, fetch_properties: true)
195
+ it 'Should list all the resource types' do
196
+ types = @client.list_resource_types
197
+ # new API returns only the feedless types here, while the old one returned all the types
198
+ expect(types.size).to be > 0
199
+ end
194
200
 
195
- expect(resources.size).to be(1)
196
- wf = resources.first
197
- expect(wf.properties['Hostname']).not_to be_empty
198
- end
201
+ it 'Should list types with feed' do
202
+ types = @client.list_resource_types(feed_id)
199
203
 
200
- it 'Should List datasources with no props' do
201
- type_path = CanonicalPath.new(feed_id: feed_id, resource_type_id: hawk_escape_id('Datasource'))
202
- resources = @client.list_resources_for_type(type_path.to_s, fetch_properties: true)
204
+ expect(types.size).to be >= 18
205
+ end
203
206
 
204
- expect(resources.size).to be > 0
205
- end
207
+ it 'Should list types with bad feed' do
208
+ type = 'does not exist'
209
+ types = @client.list_resource_types(type)
210
+ expect(type).to eq('does not exist')
206
211
 
207
- it 'Should list URLs' do
208
- type_path = CanonicalPath.new(resource_type_id: hawk_escape_id('URL'))
209
- resources = @client.list_resources_for_type(type_path.to_s)
212
+ expect(types.size).to be(0)
213
+ end
210
214
 
211
- expect(resources.size).to be(1)
212
- resource = resources[0]
213
- expect(resource.instance_of? Hawkular::Inventory::Resource).to be_truthy
214
- # depends how pinger is fast
215
- expect(2..6).to cover(resource.properties.size)
216
- expect(resource.properties['url']).to eq(URL_RESOURCE)
217
- end
215
+ it 'Should list WildFlys' do
216
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
218
217
 
219
- it 'Should list metrics for WildFlys' do
220
- resources = @client.list_resources_for_type(wildfly_type.to_s)
221
- wild_fly = resources[0]
218
+ expect(resources.size).to be(1)
219
+ end
222
220
 
223
- metrics = @client.list_metrics_for_resource(wild_fly.path)
221
+ it 'Should list WildFlys with props' do
222
+ resources = @client.list_resources_for_type(wildfly_type.to_s, fetch_properties: true)
224
223
 
225
- expect(metrics.size).to be(14)
226
- end
224
+ expect(resources.size).to be(1)
225
+ wf = resources.first
226
+ expect(wf.properties['Hostname']).not_to be_empty
227
+ end
227
228
 
228
- it 'Should list children of WildFly' do
229
- resources = @client.list_resources_for_type(wildfly_type.to_s)
230
- wild_fly = resources[0]
229
+ it 'Should List datasources with no props' do
230
+ type_path = Hawkular::Inventory::CanonicalPath.new(
231
+ feed_id: feed_id,
232
+ resource_type_id: hawk_escape_id('Datasource'))
233
+ resources = @client.list_resources_for_type(type_path.to_s, fetch_properties: true)
231
234
 
232
- children = @client.list_child_resources(wild_fly.path)
235
+ expect(resources.size).to be > 0
236
+ end
233
237
 
234
- expect(children.size).to be > 10
235
- end
238
+ it 'Should list URLs' do
239
+ type_path = Hawkular::Inventory::CanonicalPath.new(resource_type_id: hawk_escape_id('URL'))
240
+ resources = @client.list_resources_for_type(type_path.to_s)
241
+ expect(resources.size).to be > 0
242
+ resource = resources[0]
243
+ expect(resource.instance_of? Hawkular::Inventory::Resource).to be_truthy
244
+ # depends how pinger is fast
245
+ expect(2..6).to cover(resource.properties.size)
246
+ expect(resource.properties['url']).to eq(URL_RESOURCE)
247
+ end
236
248
 
237
- it 'Should list children of nested resource' do
238
- wildfly_res_id = hawk_escape_id 'Local~~'
239
- datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
240
- resource_path = CanonicalPath.new(feed_id: feed_id, resource_ids: [wildfly_res_id, datasource_res_id])
241
- datasource = @client.get_resource(resource_path.to_s)
249
+ it 'Should list metrics for WildFlys' do
250
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
251
+ wild_fly = resources[0]
242
252
 
243
- expect(datasource.name).to eq('Datasource [ExampleDS]')
244
- children = @client.list_child_resources(datasource.path)
253
+ metrics = @client.list_metrics_for_resource(wild_fly.path)
245
254
 
246
- expect(children.size).to be(0)
247
- end
255
+ expect(metrics.size).to be(14)
256
+ end
248
257
 
249
- it 'Should list recursive children of WildFly' do
250
- resources = @client.list_resources_for_type(wildfly_type.to_s)
251
- wild_fly = resources[0]
258
+ it 'Should list children of WildFly' do
259
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
260
+ wild_fly = resources[0]
252
261
 
253
- children = @client.list_child_resources(wild_fly.path, recursive: true)
262
+ children = @client.list_child_resources(wild_fly.path)
254
263
 
255
- expect(children.size).to be > 40
256
- end
264
+ expect(children.size).to be > 10
265
+ end
257
266
 
258
- it 'Should list relationships of WildFly' do
259
- resources = @client.list_resources_for_type(wildfly_type.to_s)
260
- wild_fly = resources[0]
267
+ it 'Should list children of nested resource' do
268
+ wildfly_res_id = hawk_escape_id 'Local~~'
269
+ datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
270
+ resource_path = Hawkular::Inventory::CanonicalPath.new(
271
+ feed_id: feed_id,
272
+ resource_ids: [wildfly_res_id, datasource_res_id])
273
+ datasource = @client.get_resource(resource_path.to_s)
261
274
 
262
- rels = @client.list_relationships(wild_fly.path)
275
+ expect(datasource.name).to eq('Datasource [ExampleDS]')
276
+ children = @client.list_child_resources(datasource.path)
263
277
 
264
- expect(rels.size).to be > 40
265
- expect(rels[0].to_h['source']).not_to be_empty
266
- end
267
-
268
- it 'Should list heap metrics for WildFlys' do
269
- resources = @client.list_resources_for_type(wildfly_type.to_s)
270
- wild_fly = resources[0]
278
+ expect(children.size).to be(0)
279
+ end
271
280
 
272
- metrics = @client.list_metrics_for_resource(wild_fly.path, type: 'GAUGE', match: 'Metrics~Heap')
273
- expect(metrics.size).to be(3)
281
+ it 'Should list recursive children of WildFly' do
282
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
283
+ wild_fly = resources[0]
274
284
 
275
- metrics = @client.list_metrics_for_resource(wild_fly.path, match: 'Metrics~Heap')
276
- expect(metrics.size).to be(3)
285
+ children = @client.list_child_resources(wild_fly.path, recursive: true)
277
286
 
278
- metrics = @client.list_metrics_for_resource(wild_fly.path, type: 'GAUGE')
279
- expect(metrics.size).to be(8)
280
- end
287
+ expect(children.size).to be > 40
288
+ end
281
289
 
282
- it 'Should list metrics of given metric type' do
283
- type_path = CanonicalPath.new(feed_id: feed_id, metric_type_id: hawk_escape_id('Total Space'))
284
- metrics = @client.list_metrics_for_metric_type(type_path)
290
+ it 'Should list relationships of WildFly' do
291
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
292
+ wild_fly = resources[0]
285
293
 
286
- expect(metrics.size).to be >= 4
287
- end
294
+ rels = @client.list_relationships(wild_fly.path)
288
295
 
289
- it 'Should list metrics of given resource type' do
290
- metrics = @client.list_metrics_for_resource_type(wildfly_type.to_s)
296
+ expect(rels.size).to be > 40
297
+ expect(rels[0].to_h['source']).not_to be_empty
298
+ end
291
299
 
292
- expect(metrics.size).to be(14)
293
- end
300
+ it 'Should list heap metrics for WildFlys' do
301
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
302
+ wild_fly = resources[0]
294
303
 
295
- it 'Should have the same requested metric type id' do
296
- metric_type_id = 'Server Availability~Server Availability'
297
- type_path = CanonicalPath.new(feed_id: feed_id, metric_type_id: hawk_escape_id(metric_type_id))
298
- metrics = @client.list_metrics_for_metric_type(type_path)
304
+ metrics = @client.list_metrics_for_resource(wild_fly.path, type: 'GAUGE', match: 'Metrics~Heap')
305
+ expect(metrics.size).to be(3)
299
306
 
300
- expect(metrics.size).to be > 0
301
- expect(metrics).to all(have_attributes(type_id: metric_type_id))
302
- end
307
+ metrics = @client.list_metrics_for_resource(wild_fly.path, match: 'Metrics~Heap')
308
+ expect(metrics.size).to be(3)
303
309
 
304
- it 'Should return config data of given resource' do
305
- resource_path = CanonicalPath.new(feed_id: feed_id, resource_ids: [hawk_escape_id('Local~~')])
306
- config = @client.get_config_data_for_resource(resource_path)
310
+ metrics = @client.list_metrics_for_resource(wild_fly.path, type: 'GAUGE')
311
+ expect(metrics.size).to be(8)
312
+ end
307
313
 
308
- expect(config['value']['Server State']).to eq('running')
309
- # expect(config['value']['Product Name']).to eq('Hawkular')
310
- end
314
+ it 'Should list metrics of given metric type' do
315
+ type_path = Hawkular::Inventory::CanonicalPath.new(
316
+ feed_id: feed_id,
317
+ metric_type_id: hawk_escape_id('Total Space'))
318
+ metrics = @client.list_metrics_for_metric_type(type_path)
311
319
 
312
- it 'Should return config data of given nested resource' do
313
- wildfly_res_id = hawk_escape_id 'Local~~'
314
- datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
315
- resource_path = CanonicalPath.new(feed_id: feed_id, resource_ids: [wildfly_res_id, datasource_res_id])
320
+ expect(metrics.size).to be >= 2
321
+ end
316
322
 
317
- config = @client.get_config_data_for_resource(resource_path)
323
+ it 'Should list metrics of given resource type' do
324
+ metrics = @client.list_metrics_for_resource_type(wildfly_type.to_s)
318
325
 
319
- expect(config['value']['Username']).to eq('sa')
320
- expect(config['value']['Driver Name']).to eq('h2')
321
- end
326
+ expect(metrics.size).to be(14)
327
+ end
322
328
 
323
- it 'Should get resource with its configurations' do
324
- wildfly_res_id = hawk_escape_id 'Local~~'
325
- datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
326
- resource_path = CanonicalPath.new(feed_id: feed_id, resource_ids: [wildfly_res_id, datasource_res_id])
329
+ it 'Should have the same requested metric type id' do
330
+ metric_type_id = 'Server Availability~Server Availability'
331
+ type_path = Hawkular::Inventory::CanonicalPath.new(
332
+ feed_id: feed_id,
333
+ metric_type_id: hawk_escape_id(metric_type_id))
334
+ metrics = @client.list_metrics_for_metric_type(type_path)
327
335
 
328
- resource = @client.get_resource resource_path, true
336
+ expect(metrics.size).to be > 0
337
+ expect(metrics).to all(have_attributes(type_id: metric_type_id))
338
+ end
329
339
 
330
- expect(resource.properties['Username']).to eq('sa')
331
- expect(resource.properties['Driver Name']).to eq('h2')
332
- end
340
+ it 'Should return config data of given resource' do
341
+ resource_path = Hawkular::Inventory::CanonicalPath.new(
342
+ feed_id: feed_id,
343
+ resource_ids: [hawk_escape_id('Local~~')])
344
+ config = @client.get_config_data_for_resource(resource_path)
333
345
 
334
- it 'Should list operation definitions of given resource type' do
335
- operation_definitions = @client.list_operation_definitions(wildfly_type.to_s)
336
-
337
- expect(operation_definitions).not_to be_empty
338
- expect(operation_definitions).to include('JDR')
339
- expect(operation_definitions).to include('Reload')
340
- expect(operation_definitions).to include('Shutdown')
341
- expect(operation_definitions).to include('Deploy')
342
- shutdown_def = operation_definitions.fetch 'Shutdown'
343
- expect(shutdown_def.params).to include('timeout')
344
- expect(shutdown_def.params).to include('restart')
345
- restart_param = shutdown_def.params.fetch 'restart'
346
- expect(restart_param['type']).to eq('bool')
347
- resume_def = operation_definitions.fetch 'Resume'
348
- expect(resume_def.params).to be {}
349
- end
346
+ expect(config['value']['Server State']).to eq('running')
347
+ # expect(config['value']['Product Name']).to eq('Hawkular')
348
+ end
350
349
 
351
- it 'Should list operation definitions of given resource' do
352
- resources = @client.list_resources_for_type(wildfly_type.to_s)
353
- wild_fly = resources[0]
354
- operation_definitions = @client.list_operation_definitions_for_resource(wild_fly.path.to_s)
350
+ it 'Should return config data of given nested resource' do
351
+ wildfly_res_id = hawk_escape_id 'Local~~'
352
+ datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
353
+ resource_path = Hawkular::Inventory::CanonicalPath.new(
354
+ feed_id: feed_id,
355
+ resource_ids: [wildfly_res_id, datasource_res_id])
355
356
 
356
- expect(operation_definitions).not_to be_empty
357
- expect(operation_definitions).to include('JDR')
358
- end
357
+ config = @client.get_config_data_for_resource(resource_path)
359
358
 
360
- it 'Should create a feed' do
361
- new_feed_id = 'feed_1123sdncisud6237ui23hjbdscuzsad'
362
- ret = @client.create_feed new_feed_id
363
- expect(ret).to_not be_nil
364
- expect(ret['id']).to eq(new_feed_id)
365
- end
359
+ expect(config['value']['Username']).to eq('sa')
360
+ expect(config['value']['Driver Name']).to eq('h2')
361
+ end
366
362
 
367
- it 'Should create and delete feed' do
368
- new_feed_id = 'feed_1123sdn'
369
- ret = @client.create_feed new_feed_id
370
- expect(ret).to_not be_nil
371
- expect(ret['id']).to eq(new_feed_id)
363
+ it 'Should get resource with its configurations' do
364
+ wildfly_res_id = hawk_escape_id 'Local~~'
365
+ datasource_res_id = hawk_escape_id 'Local~/subsystem=datasources/data-source=ExampleDS'
366
+ resource_path = Hawkular::Inventory::CanonicalPath.new(
367
+ feed_id: feed_id,
368
+ resource_ids: [wildfly_res_id, datasource_res_id])
372
369
 
373
- @client.delete_feed new_feed_id
370
+ resource = @client.get_resource resource_path, true
374
371
 
375
- feed_list = @client.list_feeds
376
- expect(feed_list).not_to include(new_feed_id)
377
- end
372
+ expect(resource.properties['Username']).to eq('sa')
373
+ expect(resource.properties['Driver Name']).to eq('h2')
374
+ end
378
375
 
379
- it 'Should create a feed again' do
380
- new_feed_id = 'feed_1123sdncisud6237ui2378789vvgX'
381
- @client.create_feed new_feed_id
382
- @client.create_feed new_feed_id
383
- end
376
+ it 'Should list operation definitions of given resource type' do
377
+ operation_definitions = @client.list_operation_definitions(wildfly_type.to_s)
378
+
379
+ expect(operation_definitions).not_to be_empty
380
+ expect(operation_definitions).to include('JDR')
381
+ expect(operation_definitions).to include('Reload')
382
+ expect(operation_definitions).to include('Shutdown')
383
+ expect(operation_definitions).to include('Deploy')
384
+ shutdown_def = operation_definitions.fetch 'Shutdown'
385
+ expect(shutdown_def.params).to include('timeout')
386
+ expect(shutdown_def.params).to include('restart')
387
+ restart_param = shutdown_def.params.fetch 'restart'
388
+ expect(restart_param['type']).to eq('bool')
389
+ resume_def = operation_definitions.fetch 'Resume'
390
+ expect(resume_def.params).to be {}
391
+ end
384
392
 
385
- it 'Should create a resourcetype' do
386
- new_feed_id = 'feed_may_exist'
387
- @client.create_feed new_feed_id
393
+ it 'Should list operation definitions of given resource' do
394
+ resources = @client.list_resources_for_type(wildfly_type.to_s)
395
+ wild_fly = resources[0]
396
+ operation_definitions = @client.list_operation_definitions_for_resource(wild_fly.path.to_s)
388
397
 
389
- ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
390
- expect(ret.id).to eq('rt-123')
391
- expect(ret.name).to eq('ResourceType')
392
- expect(ret.path).to include('/rt;rt-123')
393
- expect(ret.path).to include('/f;feed_may_exist')
394
- end
398
+ expect(operation_definitions).not_to be_empty
399
+ expect(operation_definitions).to include('JDR')
400
+ end
395
401
 
396
- it 'Should create a resource' do
397
- new_feed_id = 'feed_may_exist'
398
- @client.create_feed new_feed_id
399
- ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
400
- type_path = ret.path
402
+ it 'Should create a feed' do
403
+ new_feed_id = 'feed_1123sdncisud6237ui23hjbdscuzsad'
404
+ ret = @client.create_feed new_feed_id
405
+ expect(ret).to_not be_nil
406
+ expect(ret['id']).to eq(new_feed_id)
407
+ end
401
408
 
402
- @client.create_resource type_path, 'r123', 'My Resource', 'version' => 1.0
409
+ it 'Should create and delete feed' do
410
+ new_feed_id = 'feed_1123sdn'
411
+ ret = @client.create_feed new_feed_id
412
+ expect(ret).to_not be_nil
413
+ expect(ret['id']).to eq(new_feed_id)
403
414
 
404
- resource_path = CanonicalPath.new(feed_id: new_feed_id, resource_ids: ['r123'])
415
+ @client.delete_feed new_feed_id
405
416
 
406
- r = @client.get_resource(resource_path, false)
407
- expect(r.id).to eq('r123')
408
- expect(r.properties).not_to be_empty
409
- end
417
+ feed_list = @client.list_feeds
418
+ expect(feed_list).not_to include(new_feed_id)
419
+ end
410
420
 
411
- it 'Should create a resource with metric' do
412
- new_feed_id = 'feed_may_exist'
413
- @client.create_feed new_feed_id
414
- ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
415
- type_path = ret.path
421
+ it 'Should create a feed again' do
422
+ new_feed_id = 'feed_1123sdncisud6237ui2378789vvgX'
423
+ @client.create_feed new_feed_id
424
+ @client.create_feed new_feed_id
425
+ end
416
426
 
417
- @client.create_resource type_path, 'r124', 'My Resource', 'version' => 1.0
418
- resource_path = CanonicalPath.new(feed_id: new_feed_id, resource_ids: ['r124'])
427
+ it 'Should create a resourcetype' do
428
+ new_feed_id = 'feed_may_exist'
429
+ @client.create_feed new_feed_id
419
430
 
420
- r = @client.get_resource(resource_path, false)
421
- expect(r.id).to eq('r124')
422
- expect(r.properties).not_to be_empty
431
+ ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
432
+ expect(ret.id).to eq('rt-123')
433
+ expect(ret.name).to eq('ResourceType')
434
+ expect(ret.path).to include('/rt;rt-123')
435
+ expect(ret.path).to include('/f;feed_may_exist')
436
+ end
423
437
 
424
- mt = @client.create_metric_type new_feed_id, 'mt-124'
425
- expect(mt).not_to be_nil
426
- expect(mt.id).to eq('mt-124')
438
+ it 'Should create a resource' do
439
+ new_feed_id = 'feed_may_exist'
440
+ @client.create_feed new_feed_id
441
+ ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
442
+ type_path = ret.path
427
443
 
428
- m = @client.create_metric_for_resource mt.path, r.path, 'm-124'
429
- expect(m).not_to be_nil
430
- expect(m.id).to eq('m-124')
431
- expect(m.name).to eq('m-124')
444
+ @client.create_resource type_path, 'r123', 'My Resource', 'version' => 1.0
432
445
 
433
- m = @client.create_metric_for_resource mt.path, r.path, 'm-124-1', 'Metric1'
434
- expect(m).not_to be_nil
435
- expect(m.id).to eq('m-124-1')
436
- expect(m.name).to eq('Metric1')
437
- end
446
+ resource_path = Hawkular::Inventory::CanonicalPath.new(feed_id: new_feed_id, resource_ids: ['r123'])
438
447
 
439
- it 'Should create a nested resource and metric on it' do
440
- new_feed_id = 'feed_may_exist'
441
- @client.create_feed new_feed_id
442
- ret = @client.create_resource_type new_feed_id, 'rt-123-1', 'ResourceType'
443
- type_path = ret.path
448
+ r = @client.get_resource(resource_path, false)
449
+ expect(r.id).to eq('r123')
450
+ expect(r.properties).not_to be_empty
451
+ end
444
452
 
445
- parent = @client.create_resource type_path, 'r124-a', 'Res-a'
446
- nested_resource = @client.create_resource_under_resource type_path, parent.path, 'r124-b', 'Res-a'
447
- expect(nested_resource.path).to include('r;r124-a/r;r124-b')
453
+ it 'Should create a resource with metric' do
454
+ new_feed_id = 'feed_may_exist'
455
+ @client.create_feed new_feed_id
456
+ ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
457
+ type_path = ret.path
448
458
 
449
- mt = @client.create_metric_type new_feed_id, 'mt-124-a'
450
- expect(mt).not_to be_nil
451
- expect(mt.id).to eq('mt-124-a')
459
+ @client.create_resource type_path, 'r124', 'My Resource', 'version' => 1.0
460
+ resource_path = Hawkular::Inventory::CanonicalPath.new(feed_id: new_feed_id, resource_ids: ['r124'])
452
461
 
453
- m_name = 'MetricUnderNestedResource'
454
- m = @client.create_metric_for_resource mt.path, nested_resource.path, 'm-124-a', m_name
455
- expect(m.id).to eq('m-124-a')
456
- expect(m.name).to eq(m_name)
462
+ r = @client.get_resource(resource_path, false)
463
+ expect(r.id).to eq('r124')
464
+ expect(r.properties).not_to be_empty
457
465
 
458
- metrics = @client.list_metrics_for_resource nested_resource.path
459
- expect(metrics.size).to eq(1)
460
- expect(metrics[0].id).to eq(m.id)
461
- end
466
+ mt = @client.create_metric_type new_feed_id, 'mt-124'
467
+ expect(mt).not_to be_nil
468
+ expect(mt.id).to eq('mt-124')
462
469
 
463
- it 'Should create and get a resource' do
464
- new_feed_id = 'feed_may_exist'
465
- @client.create_feed new_feed_id
466
- ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
467
- type_path = ret.path
470
+ m = @client.create_metric_for_resource mt.path, r.path, 'm-124'
471
+ expect(m).not_to be_nil
472
+ expect(m.id).to eq('m-124')
473
+ expect(m.name).to eq('m-124')
468
474
 
469
- r1 = @client.create_resource type_path, 'r125', 'My Resource', 'version' => 1.0
475
+ m = @client.create_metric_for_resource mt.path, r.path, 'm-124-1', 'Metric1'
476
+ expect(m).not_to be_nil
477
+ expect(m.id).to eq('m-124-1')
478
+ expect(m.name).to eq('Metric1')
479
+ end
470
480
 
471
- r2 = @client.get_resource(r1.path, true)
472
- expect(r2.id).to eq('r125')
473
- expect(r1.id).to eq(r2.id)
474
- expect(r2.properties).not_to be_empty
475
- end
481
+ it 'Should create a nested resource and metric on it' do
482
+ new_feed_id = "#{security_context}_feed_may_exist"
483
+ @client.create_feed new_feed_id
484
+ ret = @client.create_resource_type new_feed_id, 'rt-123-1', 'ResourceType'
485
+ type_path = ret.path
476
486
 
477
- it 'Should not find an unknown resource' do
478
- new_feed_id = 'feed_may_exist'
479
- path = CanonicalPath.new(feed_id: new_feed_id, resource_ids: [hawk_escape_id('*bla does not exist*')])
480
- expect { @client.get_resource(path) }
481
- .to raise_error(Hawkular::BaseClient::HawkularException, /No Resource found/)
482
- end
487
+ parent = @client.create_resource type_path, 'r124-a', 'Res-a'
488
+ nested_resource = @client.create_resource_under_resource type_path, parent.path, 'r124-b', 'Res-a'
489
+ expect(nested_resource.path).to include('r;r124-a/r;r124-b')
483
490
 
484
- it 'Should reject unknown metric type' do
485
- new_feed_id = 'feed_may_exist'
491
+ mt = @client.create_metric_type new_feed_id, 'mt-124-a'
492
+ expect(mt).not_to be_nil
493
+ expect(mt.id).to eq('mt-124-a')
486
494
 
487
- expect { @client.create_metric_type new_feed_id, 'abc', 'FOOBaR' }.to raise_error(RuntimeError,
488
- /Unknown type FOOBAR/)
489
- end
495
+ m_name = 'MetricUnderNestedResource'
496
+ m = @client.create_metric_for_resource mt.path, nested_resource.path, 'm-124-a', m_name
497
+ expect(m.id).to eq('m-124-a')
498
+ expect(m.name).to eq(m_name)
490
499
 
491
- let(:example) do |e|
492
- e
493
- end
500
+ metrics = @client.list_metrics_for_resource nested_resource.path
501
+ expect(metrics.size).to eq(1)
502
+ expect(metrics[0].id).to eq(m.id)
503
+ end
494
504
 
495
- it 'Client should listen on various inventory events', :websocket do
496
- WebSocketVCR.configure do |c|
497
- c.hook_uris = ['localhost:8080']
498
- end
499
- uuid_prefix = SecureRandom.uuid
500
- vcr_options = {
501
- decode_compressed_response: true,
502
- erb: {
503
- uuid_prefix: uuid_prefix
504
- },
505
- reverse_substitution: true
506
- }
507
- vcr_options[:record] = :all if ENV['VCR_UPDATE'] == '1'
508
- x, y, = @client.version
509
- cassette_name = "Inventory/inventory_#{x}_#{y}/Templates/Client_should_listen_on_various_inventory_events"
510
- WebSocketVCR.use_cassette(cassette_name, vcr_options) do
511
- id_1 = uuid_prefix + '-r126'
512
- id_2 = uuid_prefix + '-r127'
513
- id_3 = uuid_prefix + '-r128'
514
-
515
- new_resource_events = {}
516
- resources_closable = @client.events do |resource|
517
- new_resource_events[resource.id] = resource
518
- end
519
-
520
- deleted_feed_events = {}
521
- feed_deleted_closable = @client.events('feed', 'deleted') do |feed|
522
- deleted_feed_events[feed.id] = feed
523
- end
524
-
525
- new_resource_types_events = {}
526
- # another breaking change in the new inventory api
527
- interest = 'resourceType'
528
- resource_type_closable = @client.events(interest) do |resource_type|
529
- new_resource_types_events[resource_type.id] = resource_type
530
- end
531
-
532
- registered_feed_events = {}
533
- feeds_closable = @client.events('feed', 'created') do |feed|
534
- registered_feed_events[feed.id] = feed
535
- end
536
-
537
- new_feed_id = uuid_prefix + '-feed'
538
- resource_type_id = uuid_prefix + '-rt-123'
539
- resource_type_name = 'ResourceType'
540
-
541
- record("Inventory/inventory_#{x}_#{y}",
542
- { uuid_prefix: uuid_prefix },
543
- 'Helpers/generate_some_events_for_websocket') do
505
+ it 'Should create and get a resource' do
506
+ new_feed_id = "#{security_context}_feed_may_exist"
544
507
  @client.create_feed new_feed_id
545
- ret = @client.create_resource_type new_feed_id, resource_type_id, resource_type_name
508
+ ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
546
509
  type_path = ret.path
547
510
 
548
- # create 3 resources
549
- @client.create_resource type_path, id_1, 'My Resource 1', 'version' => 1.0
550
- @client.create_resource type_path, id_2, 'My Resource 2', 'version' => 1.1
551
- resources_closable.close
552
- @client.create_resource type_path, id_3, 'My Resource 3', 'version' => 1.2
511
+ r1 = @client.create_resource type_path, 'r125', 'My Resource', 'version' => 1.0
553
512
 
554
- @client.delete_feed new_feed_id
513
+ r2 = @client.get_resource(r1.path, true)
514
+ expect(r2.id).to eq('r125')
515
+ expect(r1.id).to eq(r2.id)
516
+ expect(r2.properties).not_to be_empty
555
517
  end
556
518
 
557
- # wait for the data
558
- sleep 2 if !WebSocketVCR.cassette || WebSocketVCR.cassette.recording?
559
- [feed_deleted_closable, resource_type_closable, feeds_closable].each(&:close)
560
- expect(new_resource_events[id_1]).not_to be_nil
561
- expect(new_resource_events[id_1].properties['version']).to eq(1.0)
562
- expect(new_resource_events[id_2]).not_to be_nil
563
- expect(new_resource_events[id_2].properties['version']).to eq(1.1)
564
- # resource with id_3 should not be among events, because we stopped listening before creating the 3rd one
565
- expect(new_resource_events[id_3]).to be_nil
519
+ it 'Should not find an unknown resource' do
520
+ new_feed_id = 'feed_may_exist'
521
+ path = Hawkular::Inventory::CanonicalPath.new(
522
+ feed_id: new_feed_id,
523
+ resource_ids: [hawk_escape_id('*bla does not exist*')])
524
+ expect { @client.get_resource(path) }
525
+ .to raise_error(Hawkular::BaseClient::HawkularException, /No Resource found/)
526
+ end
527
+
528
+ it 'Should reject unknown metric type' do
529
+ new_feed_id = 'feed_may_exist'
566
530
 
567
- expect(registered_feed_events[new_feed_id]).not_to be_nil
568
- expect(registered_feed_events[new_feed_id].id).to eq(new_feed_id)
531
+ expect { @client.create_metric_type new_feed_id, 'abc', 'FOOBaR' }.to raise_error(RuntimeError,
532
+ /Unknown type FOOBAR/)
533
+ end
569
534
 
570
- expect(deleted_feed_events[new_feed_id]).not_to be_nil
571
- expect(deleted_feed_events[new_feed_id].id).to eq(new_feed_id)
535
+ let(:example) do |e|
536
+ e
537
+ end
572
538
 
573
- expect(new_resource_types_events[resource_type_id]).not_to be_nil
574
- expect(new_resource_types_events[resource_type_id].id).to eq(resource_type_id)
575
- expect(new_resource_types_events[resource_type_id].name).to eq(resource_type_name)
539
+ it 'Client should listen on various inventory events' do
540
+ WebSocketVCR.configure do |c|
541
+ c.hook_uris = [host(security_context)]
542
+ end
543
+ uuid_prefix = SecureRandom.uuid
544
+ x, y, = @client.version
545
+ record_websocket("Inventory/#{security_context}/inventory_#{x}_#{y}",
546
+ { uuid_prefix: uuid_prefix },
547
+ 'Client_should_listen_on_various_inventory_events') do
548
+ id_1 = uuid_prefix + '-r126'
549
+ id_2 = uuid_prefix + '-r127'
550
+ id_3 = uuid_prefix + '-r128'
551
+
552
+ new_resource_events = {}
553
+ resources_closable = @client.events do |resource|
554
+ new_resource_events[resource.id] = resource
555
+ end
556
+
557
+ deleted_feed_events = {}
558
+ feed_deleted_closable = @client.events('feed', 'deleted') do |feed|
559
+ deleted_feed_events[feed.id] = feed
560
+ end
561
+
562
+ new_resource_types_events = {}
563
+ # another breaking change in the new inventory api
564
+ interest = 'resourceType'
565
+ resource_type_closable = @client.events(interest) do |resource_type|
566
+ new_resource_types_events[resource_type.id] = resource_type
567
+ end
568
+
569
+ registered_feed_events = {}
570
+ feeds_closable = @client.events('feed', 'created') do |feed|
571
+ registered_feed_events[feed.id] = feed
572
+ end
573
+
574
+ new_feed_id = uuid_prefix + '-feed'
575
+ resource_type_id = uuid_prefix + '-rt-123'
576
+ resource_type_name = 'ResourceType'
577
+
578
+ record("Inventory/#{security_context}/inventory_#{x}_#{y}",
579
+ { uuid_prefix: uuid_prefix }.merge(credentials),
580
+ 'Helpers/generate_some_events_for_websocket') do
581
+ @client.create_feed new_feed_id
582
+ ret = @client.create_resource_type new_feed_id, resource_type_id, resource_type_name
583
+ type_path = ret.path
584
+
585
+ # create 3 resources
586
+ @client.create_resource type_path, id_1, 'My Resource 1', 'version' => 1.0
587
+ @client.create_resource type_path, id_2, 'My Resource 2', 'version' => 1.1
588
+ resources_closable.close
589
+ @client.create_resource type_path, id_3, 'My Resource 3', 'version' => 1.2
590
+
591
+ @client.delete_feed new_feed_id
592
+ end
593
+
594
+ # wait for the data
595
+ sleep 5 if !WebSocketVCR.cassette || WebSocketVCR.cassette.recording?
596
+ [feed_deleted_closable, resource_type_closable, feeds_closable].each(&:close)
597
+ expect(new_resource_events[id_1]).not_to be_nil
598
+ expect(new_resource_events[id_1].properties['version']).to eq(1.0)
599
+ expect(new_resource_events[id_2]).not_to be_nil
600
+ expect(new_resource_events[id_2].properties['version']).to eq(1.1)
601
+ # resource with id_3 should not be among events, because we stopped listening before creating the 3rd one
602
+ expect(new_resource_events[id_3]).to be_nil
603
+
604
+ expect(registered_feed_events[new_feed_id]).not_to be_nil
605
+ expect(registered_feed_events[new_feed_id].id).to eq(new_feed_id)
606
+
607
+ expect(deleted_feed_events[new_feed_id]).not_to be_nil
608
+ expect(deleted_feed_events[new_feed_id].id).to eq(new_feed_id)
609
+
610
+ expect(new_resource_types_events[resource_type_id]).not_to be_nil
611
+ expect(new_resource_types_events[resource_type_id].id).to eq(resource_type_id)
612
+ expect(new_resource_types_events[resource_type_id].name).to eq(resource_type_name)
613
+ end
614
+ end
615
+
616
+ it 'Should return the version' do
617
+ data = @client.fetch_version_and_status
618
+ expect(data).not_to be_nil
619
+ end
576
620
  end
577
621
  end
622
+ end
578
623
 
579
- it 'Should return the version' do
580
- data = @client.fetch_version_and_status
581
- expect(data).not_to be_nil
624
+ describe 'Inventory' do
625
+ it 'Should list feeds when using SSL without certificate, disabling the verify' do
626
+ tori_url = 'https://hawkular.torii.gva.redhat.com/hawkular/inventory'
627
+ record 'Inventory', credentials, 'Should list feeds when using SSL without certificate' do
628
+ client = setup_inventory_client tori_url, tenant: 'hawkular', verify_ssl: OpenSSL::SSL::VERIFY_NONE
629
+ feeds = client.list_feeds
630
+ expect(feeds.size).to be(1)
631
+ end
582
632
  end
583
633
  end
584
634
  end