hawkular-client 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -4
  3. data/.travis/start_hawkular_services.sh +21 -0
  4. data/.travis/wait_for_services.rb +26 -10
  5. data/CHANGES.rdoc +26 -0
  6. data/README.rdoc +12 -1
  7. data/docker-compose.yml +4 -2
  8. data/hawkularclient.gemspec +2 -0
  9. data/lib/hawkular/alerts/alerts_api.rb +22 -1
  10. data/lib/hawkular/base_client.rb +29 -24
  11. data/lib/hawkular/client_utils.rb +42 -0
  12. data/lib/hawkular/env_config.rb +15 -0
  13. data/lib/hawkular/hawkular_client.rb +33 -25
  14. data/lib/hawkular/inventory/entities.rb +9 -0
  15. data/lib/hawkular/inventory/inventory_api.rb +13 -3
  16. data/lib/hawkular/logger.rb +14 -0
  17. data/lib/hawkular/metrics/metric_api.rb +24 -8
  18. data/lib/hawkular/operations/operations_api.rb +57 -25
  19. data/lib/hawkular/tokens/tokens_api.rb +4 -1
  20. data/lib/hawkular/version.rb +1 -1
  21. data/lib/hawkularclient.rb +8 -0
  22. data/spec/integration/alerts_spec.rb +50 -27
  23. data/spec/integration/env_config_spec.rb +39 -0
  24. data/spec/integration/hawkular_client_spec.rb +10 -7
  25. data/spec/integration/inventory_spec.rb +36 -3
  26. data/spec/integration/logger_spec.rb +36 -0
  27. data/spec/integration/metric_spec.rb +62 -3
  28. data/spec/integration/operations_spec.rb +112 -63
  29. data/spec/integration/tokens_spec.rb +6 -6
  30. data/spec/spec_helper.rb +20 -6
  31. data/spec/unit/base_spec.rb +25 -3
  32. data/spec/unit/canonical_path_spec.rb +2 -1
  33. data/spec/unit/client_spec.rb +2 -1
  34. data/spec/unit/deprecations_spec.rb +19 -0
  35. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_add_tags_to_existing_alert.yml +210 -0
  36. data/spec/vcr_cassettes/Alert/Alerts/Templates/Should_remove_tags_from_existing_alert.yml +257 -0
  37. data/spec/vcr_cassettes/Alert/Triggers/Templates/Should_get_the_action_definitions.yml +59 -22
  38. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_have_a_consistent_behaviour_when_creating_an_already_existing_resource.yml +714 -0
  39. data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_return_data_from_get_entity.yml +230 -0
  40. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/All_Tags_for_metrics/Should_fetch_all_metrics_with_some_tags.yml +1251 -0
  41. data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tags_Metrics/setup_client.yml +3 -3
  42. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/agent_properties.yml +124 -0
  43. data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +7 -7
  44. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +4 -4
  45. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_deployment_should_be_doable.json +4 -4
  46. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +4 -4
  47. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +3 -3
  48. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +5 -5
  49. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +4 -4
  50. data/spec/vcr_cassettes/Operation/NonSecure/Operation/Update_collection_intervals_should_be_performed_and_eventually_respond_with_success.json +23 -0
  51. metadata +57 -7
  52. data/lib/hawkular/hawkular_client_utils.rb +0 -41
@@ -1,41 +0,0 @@
1
- module HawkularUtilsMixin
2
- # Escapes the passed url part. This is necessary,
3
- # as many ids inside Hawkular can contain characters
4
- # that are invalid for an url/uri.
5
- # The passed value is duplicated
6
- # Does not escape the = character
7
- # @param [String] url_part Part of an url to be escaped
8
- # @return [String] escaped url_part as new string
9
- def hawk_escape(url_part)
10
- return url_part.to_s if url_part.is_a?(Numeric)
11
-
12
- if url_part.is_a? Symbol
13
- sub_url = url_part.to_s
14
- else
15
- sub_url = url_part.dup
16
- end
17
- sub_url.gsub!('%', '%25')
18
- sub_url.gsub!(' ', '%20')
19
- sub_url.gsub!('[', '%5b')
20
- sub_url.gsub!(']', '%5d')
21
- sub_url.gsub!('|', '%7c')
22
- sub_url.gsub!('(', '%28')
23
- sub_url.gsub!(')', '%29')
24
- sub_url.gsub!('/', '%2f')
25
- sub_url
26
- end
27
-
28
- # Escapes the passed url part. This is necessary,
29
- # as many ids inside Hawkular can contain characters
30
- # that are invalid for an url/uri.
31
- # The passed value is duplicated
32
- # Does escape the = character
33
- # @param [String] url_part Part of an url to be escaped
34
- # @return [String] escaped url_part as new string
35
- def hawk_escape_id(url_part)
36
- sub_url = hawk_escape url_part
37
- sub_url.gsub!('=', '%3d')
38
- sub_url.gsub!(';', '%3b')
39
- sub_url
40
- end
41
- end