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.
- checksums.yaml +4 -4
- data/CHANGES.rdoc +5 -2
- data/lib/hawkular/hawkular_client.rb +1 -1
- data/lib/hawkular/inventory/inventory_api.rb +2 -1
- data/lib/hawkular/metrics/metric_api.rb +4 -1
- data/lib/hawkular/operations/operations_api.rb +7 -4
- data/lib/hawkular/version.rb +1 -1
- data/spec/integration/inventory_spec.rb +516 -466
- data/spec/integration/metric_spec.rb +612 -561
- data/spec/integration/operations_spec.rb +425 -504
- data/spec/spec_helper.rb +73 -19
- data/spec/vcr_cassettes/Inventory/{Connection → NonSecure/Connection/Templates}/Should_err_on_bad_credentials.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Explicit_Credentials.yml +13 -9
- data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Implicit_Credentials.yml +13 -9
- data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates → NonSecure/inventory_0_17}/Client_should_listen_on_various_inventory_events.json +5 -5
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Client_should_listen_on_various_inventory_events.yml +21 -13
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/create_url.yml +12 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Helpers/generate_some_events_for_websocket.yml +51 -37
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/get_feeds.yml +11 -9
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_List_datasources_with_no_props.yml +11 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed_again.yml +16 -10
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +664 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource.yml +31 -19
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource_with_metric.yml +77 -49
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resourcetype.yml +16 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_and_delete_feed.yml +19 -13
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_have_the_same_requested_metric_type_id.yml +8 -8
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_URLs.yml +29 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys.yml +10 -8
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys_with_props.yml +24 -17
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_all_the_resource_types.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_WildFly.yml +31 -13
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_nested_resource.yml +16 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_feeds.yml +9 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_heap_metrics_for_WildFlys.yml +196 -188
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_for_WildFlys.yml +72 -68
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_metric_type.yml +12 -44
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_resource_type.yml +63 -61
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource.yml +220 -156
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource_type.yml +200 -140
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_recursive_children_of_WildFly.yml +30 -12
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_relationships_of_WildFly.yml +129 -113
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_resources_for_feed.yml +12 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_bad_feed.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_feed.yml +7 -5
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_not_find_an_unknown_resource.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_nested_resource.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_resource.yml +15 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_the_version.yml +8 -6
- data/spec/vcr_cassettes/Inventory/Secure/Connection/Templates/Should_err_on_bad_credentials.yml +44 -0
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +101 -0
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +101 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +47 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +207 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/create_url.yml +52 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +411 -0
- 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
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +133 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed_again.yml +181 -0
- 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
- 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
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +846 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +169 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +166 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +73 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_URLs.yml +90 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys.yml +70 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +138 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +333 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +180 -0
- data/spec/vcr_cassettes/{Operation/Helpers/get_feed.yml → Inventory/Secure/inventory_0_17/Templates/Should_list_feeds.yml} +13 -11
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +943 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +361 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +90 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +294 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +871 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +740 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +1117 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +393 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +84 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +55 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_feed.yml +166 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +66 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +71 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_the_version.yml +50 -0
- data/spec/vcr_cassettes/Inventory/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml +114 -0
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Get_metric_definition_by_id.yml +10 -8
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Retrieve_metric_rate_points.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Availability_definition.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Counter_definition.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_gauge_definition.yml +18 -14
- 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
- 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
- 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
- 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
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_group_contiguous_values.yml +10 -6
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_return_periods.yml +10 -6
- 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
- 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
- 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
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/No_Tenant/Should_fail.yml +6 -4
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Simple/Should_be_Cool.yml +2 -2
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Status/Should_return_the_version.yml +5 -3
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_return_periods.yml +0 -0
- 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
- 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
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Simple/Should_be_Cool.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Status/Should_return_the_version.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Tenants/Should_create_and_return_tenant.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_group_contiguous_values.yml +17 -13
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +47 -37
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +44 -34
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +60 -46
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +51 -39
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +51 -39
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_periods.yml +17 -13
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +12 -10
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +47 -37
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +328 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +32 -32
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +70 -74
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +61 -47
- 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
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/No_Tenant/Should_fail.yml +9 -7
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Simple/Should_be_Cool.yml +3 -3
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Status/Should_return_the_version.yml +10 -8
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +51 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +92 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +146 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +146 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
- 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
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/No_Tenant/Should_fail.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Simple/Should_be_Cool.yml +48 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Status/Should_return_the_version.yml +44 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +51 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +364 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +285 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/No_Tenant/Should_fail.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Simple/Should_be_Cool.yml +48 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Status/Should_return_the_version.yml +44 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +61 -0
- data/spec/vcr_cassettes/Operation/{Helpers → NonSecure/Helpers/Templates}/get_tenant.yml +8 -5
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_datasource_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/Add_deployment_should_be_doable.json +4 -7
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/should_not_be_possible_to_perform_on_closed_client.json +1 -1
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
- data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_bail_with_no_host.json +0 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback.json +18 -0
- data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_run_into_error_callback_because_bad_hash_parameters.json +1 -1
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_feed.yml +61 -0
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_tenant.yml +55 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_datasource_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_deployment_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/should_not_be_possible_to_perform_on_closed_client.json +12 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_no_host.json +3 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback.json +18 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +13 -0
- metadata +526 -282
- data/spec/vcr_cassettes/Metrics/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
- data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -48
- data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
- data/spec/vcr_cassettes/Operation/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Add_datasource_should_be_doable.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -40
- data/spec/vcr_cassettes/Operation/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dff0c0c4a4cf26161263ef21f06e0962f94fbf0
|
4
|
+
data.tar.gz: 665dd8784d3495ec6da84849b702ef105498ae59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
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 =
|
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,
|
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]
|
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
|
-
#
|
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")
|
data/lib/hawkular/version.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
37
|
-
|
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
|
-
|
51
|
-
|
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
|
-
|
81
|
-
|
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
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
110
|
-
|
28
|
+
describe 'Inventory Tenants' do
|
29
|
+
let(:cassette_name) do |example|
|
30
|
+
description = example.description
|
31
|
+
description
|
32
|
+
end
|
111
33
|
|
112
|
-
|
113
|
-
|
114
|
-
|
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
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
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
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
128
|
-
|
129
|
-
|
58
|
+
describe 'Inventory Connection' do
|
59
|
+
let(:cassette_name) do |example|
|
60
|
+
description = example.description
|
61
|
+
description
|
62
|
+
end
|
130
63
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
end
|
64
|
+
around(:each) do |example|
|
65
|
+
record("Inventory/#{security_context}/Connection", credentials, cassette_name, example: example)
|
66
|
+
end
|
135
67
|
|
136
|
-
|
137
|
-
|
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
|
-
|
140
|
-
|
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
|
-
|
143
|
-
|
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
|
-
|
146
|
-
|
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
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
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
|
-
|
167
|
-
|
168
|
-
|
169
|
-
expect(types.size).to be > 0
|
170
|
-
end
|
170
|
+
let(:feed_id) do
|
171
|
+
@state[:feed_uuid]
|
172
|
+
end
|
171
173
|
|
172
|
-
|
173
|
-
|
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
|
-
|
176
|
-
|
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
|
-
|
179
|
-
|
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
|
-
|
184
|
-
|
186
|
+
expect(feeds.size).to be > 0
|
187
|
+
end
|
185
188
|
|
186
|
-
|
187
|
-
|
189
|
+
it 'Should list resources for feed' do
|
190
|
+
resources = @client.list_resources_for_feed feed_id
|
188
191
|
|
189
|
-
|
190
|
-
|
192
|
+
expect(resources.size).to be(2)
|
193
|
+
end
|
191
194
|
|
192
|
-
|
193
|
-
|
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
|
-
|
196
|
-
|
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
|
-
|
201
|
-
|
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
|
-
|
205
|
-
|
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
|
-
|
208
|
-
|
209
|
-
resources = @client.list_resources_for_type(type_path.to_s)
|
212
|
+
expect(types.size).to be(0)
|
213
|
+
end
|
210
214
|
|
211
|
-
|
212
|
-
|
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
|
-
|
220
|
-
|
221
|
-
wild_fly = resources[0]
|
218
|
+
expect(resources.size).to be(1)
|
219
|
+
end
|
222
220
|
|
223
|
-
|
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
|
-
|
226
|
-
|
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
|
-
|
229
|
-
|
230
|
-
|
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
|
-
|
235
|
+
expect(resources.size).to be > 0
|
236
|
+
end
|
233
237
|
|
234
|
-
|
235
|
-
|
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
|
-
|
238
|
-
|
239
|
-
|
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
|
-
|
244
|
-
children = @client.list_child_resources(datasource.path)
|
253
|
+
metrics = @client.list_metrics_for_resource(wild_fly.path)
|
245
254
|
|
246
|
-
|
247
|
-
|
255
|
+
expect(metrics.size).to be(14)
|
256
|
+
end
|
248
257
|
|
249
|
-
|
250
|
-
|
251
|
-
|
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
|
-
|
262
|
+
children = @client.list_child_resources(wild_fly.path)
|
254
263
|
|
255
|
-
|
256
|
-
|
264
|
+
expect(children.size).to be > 10
|
265
|
+
end
|
257
266
|
|
258
|
-
|
259
|
-
|
260
|
-
|
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
|
-
|
275
|
+
expect(datasource.name).to eq('Datasource [ExampleDS]')
|
276
|
+
children = @client.list_child_resources(datasource.path)
|
263
277
|
|
264
|
-
|
265
|
-
|
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
|
-
|
273
|
-
|
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
|
-
|
276
|
-
expect(metrics.size).to be(3)
|
285
|
+
children = @client.list_child_resources(wild_fly.path, recursive: true)
|
277
286
|
|
278
|
-
|
279
|
-
|
280
|
-
end
|
287
|
+
expect(children.size).to be > 40
|
288
|
+
end
|
281
289
|
|
282
|
-
|
283
|
-
|
284
|
-
|
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
|
-
|
287
|
-
end
|
294
|
+
rels = @client.list_relationships(wild_fly.path)
|
288
295
|
|
289
|
-
|
290
|
-
|
296
|
+
expect(rels.size).to be > 40
|
297
|
+
expect(rels[0].to_h['source']).not_to be_empty
|
298
|
+
end
|
291
299
|
|
292
|
-
|
293
|
-
|
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
|
-
|
296
|
-
|
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
|
-
|
301
|
-
|
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
|
-
|
305
|
-
|
306
|
-
|
310
|
+
metrics = @client.list_metrics_for_resource(wild_fly.path, type: 'GAUGE')
|
311
|
+
expect(metrics.size).to be(8)
|
312
|
+
end
|
307
313
|
|
308
|
-
|
309
|
-
|
310
|
-
|
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
|
-
|
313
|
-
|
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
|
-
|
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
|
-
|
320
|
-
|
321
|
-
end
|
326
|
+
expect(metrics.size).to be(14)
|
327
|
+
end
|
322
328
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
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
|
-
|
336
|
+
expect(metrics.size).to be > 0
|
337
|
+
expect(metrics).to all(have_attributes(type_id: metric_type_id))
|
338
|
+
end
|
329
339
|
|
330
|
-
|
331
|
-
|
332
|
-
|
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
|
-
|
335
|
-
|
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
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
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
|
-
|
357
|
-
expect(operation_definitions).to include('JDR')
|
358
|
-
end
|
357
|
+
config = @client.get_config_data_for_resource(resource_path)
|
359
358
|
|
360
|
-
|
361
|
-
|
362
|
-
|
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
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
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
|
-
|
370
|
+
resource = @client.get_resource resource_path, true
|
374
371
|
|
375
|
-
|
376
|
-
|
377
|
-
|
372
|
+
expect(resource.properties['Username']).to eq('sa')
|
373
|
+
expect(resource.properties['Driver Name']).to eq('h2')
|
374
|
+
end
|
378
375
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
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
|
-
|
386
|
-
|
387
|
-
|
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
|
-
|
390
|
-
|
391
|
-
|
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
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
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
|
-
|
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
|
-
|
415
|
+
@client.delete_feed new_feed_id
|
405
416
|
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
end
|
417
|
+
feed_list = @client.list_feeds
|
418
|
+
expect(feed_list).not_to include(new_feed_id)
|
419
|
+
end
|
410
420
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
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
|
-
|
418
|
-
|
427
|
+
it 'Should create a resourcetype' do
|
428
|
+
new_feed_id = 'feed_may_exist'
|
429
|
+
@client.create_feed new_feed_id
|
419
430
|
|
420
|
-
|
421
|
-
|
422
|
-
|
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
|
-
|
425
|
-
|
426
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
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
|
-
|
446
|
-
|
447
|
-
|
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
|
-
|
450
|
-
|
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
|
-
|
454
|
-
|
455
|
-
|
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
|
-
|
459
|
-
|
460
|
-
|
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
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
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
|
-
|
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
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
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
|
-
|
478
|
-
|
479
|
-
|
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
|
-
|
485
|
-
|
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
|
-
|
488
|
-
|
489
|
-
|
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
|
-
|
492
|
-
|
493
|
-
|
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
|
-
|
496
|
-
|
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,
|
508
|
+
ret = @client.create_resource_type new_feed_id, 'rt-123', 'ResourceType'
|
546
509
|
type_path = ret.path
|
547
510
|
|
548
|
-
|
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.
|
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
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
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
|
-
|
568
|
-
|
531
|
+
expect { @client.create_metric_type new_feed_id, 'abc', 'FOOBaR' }.to raise_error(RuntimeError,
|
532
|
+
/Unknown type FOOBAR/)
|
533
|
+
end
|
569
534
|
|
570
|
-
|
571
|
-
|
535
|
+
let(:example) do |e|
|
536
|
+
e
|
537
|
+
end
|
572
538
|
|
573
|
-
|
574
|
-
|
575
|
-
|
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
|
-
|
580
|
-
|
581
|
-
|
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
|