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
@@ -5,573 +5,494 @@ require 'securerandom'
|
|
5
5
|
include Hawkular::Inventory
|
6
6
|
include Hawkular::Operations
|
7
7
|
|
8
|
+
SKIP_SECURE_CONTEXT = ENV['SKIP_SECURE_CONTEXT'] || '1'
|
9
|
+
|
8
10
|
# examples for operations, it uses the websocket communication
|
9
11
|
module Hawkular::Operations::RSpec
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
NON_SECURE_CONTEXT = :NonSecure
|
13
|
+
SECURE_CONTEXT = :Secure
|
14
|
+
[NON_SECURE_CONTEXT, SECURE_CONTEXT].each do |security_context|
|
15
|
+
next if security_context == SECURE_CONTEXT && SKIP_SECURE_CONTEXT == '1'
|
16
|
+
if security_context == NON_SECURE_CONTEXT && ENV['SKIP_NON_SECURE_CONTEXT'] == '1'
|
17
|
+
puts 'skipping non secure context'
|
18
|
+
next
|
14
19
|
end
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
c.hook_uris = [HOST]
|
19
|
-
end
|
21
|
+
context "#{security_context}" do
|
22
|
+
alias_method :helper_host, :host
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 2,
|
24
|
-
credentials: {
|
25
|
-
username: 'jdoe',
|
26
|
-
password: 'password'
|
27
|
-
},
|
28
|
-
options: {
|
29
|
-
tenant: 'hawkular'
|
30
|
-
})
|
31
|
-
ws = client.ws
|
32
|
-
expect(ws).not_to be nil
|
33
|
-
expect(ws.open?).to be true
|
24
|
+
let(:host) do
|
25
|
+
helper_host(security_context)
|
34
26
|
end
|
35
|
-
end
|
36
27
|
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
let(:options) do
|
29
|
+
{
|
30
|
+
host: host,
|
31
|
+
wait_time: WebSocketVCR.live? ? 1.5 : 2,
|
32
|
+
use_secure_connection: security_context == SECURE_CONTEXT,
|
33
|
+
credentials: credentials,
|
34
|
+
options: {
|
35
|
+
tenant: 'hawkular'
|
36
|
+
}
|
37
|
+
}
|
40
38
|
end
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
client = OperationsClient.new(entrypoint: ep,
|
46
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 0,
|
47
|
-
credentials: {
|
48
|
-
username: 'jdoe',
|
49
|
-
password: 'password'
|
50
|
-
},
|
51
|
-
options: {
|
52
|
-
tenant: 'hawkular'
|
53
|
-
})
|
54
|
-
ws = client.ws
|
55
|
-
expect(ws).not_to be nil
|
56
|
-
expect(ws.open?).to be true
|
40
|
+
let(:example) do |e|
|
41
|
+
e
|
57
42
|
end
|
58
|
-
end
|
59
43
|
|
60
|
-
|
61
|
-
|
62
|
-
|
44
|
+
let(:cassette_name) do |example|
|
45
|
+
description = example.description
|
46
|
+
description
|
63
47
|
end
|
64
48
|
|
65
|
-
|
66
|
-
|
67
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 2,
|
68
|
-
credentials: {
|
69
|
-
username: 'jdoe',
|
70
|
-
password: 'password'
|
71
|
-
},
|
72
|
-
options: {
|
73
|
-
tenant: 'hawkular'
|
74
|
-
})
|
75
|
-
|
76
|
-
noop = { operationName: 'noop', resourcePath: '/bla' }
|
77
|
-
|
78
|
-
client.invoke_generic_operation(noop) do |on|
|
79
|
-
on.success do |_data|
|
80
|
-
fail 'This should have failed'
|
81
|
-
end
|
82
|
-
on.failure do |error|
|
83
|
-
puts 'error callback was correctly called, reason: ' + error.to_s
|
84
|
-
end
|
85
|
-
end
|
49
|
+
let(:client) do
|
50
|
+
OperationsClient.new(options)
|
86
51
|
end
|
87
|
-
end
|
88
52
|
|
89
|
-
|
90
|
-
|
91
|
-
|
53
|
+
before(:all) do
|
54
|
+
WebSocketVCR.configure do |c|
|
55
|
+
c.hook_uris = [helper_host(security_context)]
|
56
|
+
end
|
92
57
|
end
|
93
58
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
},
|
101
|
-
options: {
|
102
|
-
tenant: 'hawkular'
|
103
|
-
})
|
104
|
-
|
105
|
-
noop = { operationName: 'noop' }
|
106
|
-
|
107
|
-
client.invoke_generic_operation(noop) do |on|
|
108
|
-
on.success do |_data|
|
109
|
-
fail 'This should have failed'
|
110
|
-
end
|
111
|
-
on.failure do |_error|
|
112
|
-
end
|
59
|
+
describe 'Operation/Websocket connection' do
|
60
|
+
around(:each) do |example|
|
61
|
+
record_websocket("Operation/#{security_context}/Websocket_connection",
|
62
|
+
nil,
|
63
|
+
cassette_name,
|
64
|
+
example)
|
113
65
|
end
|
114
|
-
end
|
115
|
-
end
|
116
66
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
67
|
+
it 'should be established' do
|
68
|
+
ws = client.ws
|
69
|
+
expect(ws).not_to be nil
|
70
|
+
expect(ws.open?).to be true
|
71
|
+
end
|
121
72
|
|
122
|
-
|
123
|
-
|
124
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 2,
|
125
|
-
credentials: {
|
126
|
-
username: 'jdoe',
|
127
|
-
password: 'password'
|
128
|
-
},
|
129
|
-
options: {
|
130
|
-
tenant: 'hawkular'
|
131
|
-
})
|
132
|
-
|
133
|
-
noop = { operationName: 'noop' }
|
134
|
-
expect { client.invoke_generic_operation(noop) }.to raise_error(ArgumentError,
|
135
|
-
'You need to specify error callback')
|
136
|
-
end
|
137
|
-
end
|
73
|
+
it 'should be established via entrypoint' do
|
74
|
+
ep = host_with_scheme(host, security_context == SECURE_CONTEXT)
|
138
75
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
76
|
+
client = OperationsClient.new(options.merge entrypoint: ep, host: nil)
|
77
|
+
ws = client.ws
|
78
|
+
expect(ws).not_to be nil
|
79
|
+
expect(ws.open?).to be true
|
80
|
+
end
|
143
81
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
credentials: {
|
148
|
-
username: 'jdoe',
|
149
|
-
password: 'password'
|
150
|
-
},
|
151
|
-
options: {
|
152
|
-
tenant: 'hawkular'
|
153
|
-
})
|
154
|
-
|
155
|
-
noop = { operationName: 'noop' }
|
156
|
-
expect do
|
82
|
+
it 'should run into error callback' do
|
83
|
+
noop = { operationName: 'noop', resourcePath: '/bla' }
|
84
|
+
operation_outcome = {}
|
157
85
|
client.invoke_generic_operation(noop) do |on|
|
158
86
|
on.success do |_data|
|
159
|
-
|
87
|
+
operation_outcome[:data] = 'should run into error'
|
88
|
+
end
|
89
|
+
on.failure do |_error|
|
90
|
+
operation_outcome[:data] = 'fail'
|
160
91
|
end
|
161
92
|
end
|
162
|
-
|
163
|
-
end
|
164
|
-
end
|
165
|
-
it 'should bail with no host' do
|
166
|
-
WebSocketVCR.configure do |c|
|
167
|
-
c.hook_uris = [HOST]
|
168
|
-
end
|
169
|
-
|
170
|
-
WebSocketVCR.record(example, self) do
|
171
|
-
begin
|
172
|
-
OperationsClient.new(
|
173
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 2,
|
174
|
-
credentials: {
|
175
|
-
username: 'jdoe',
|
176
|
-
password: 'password'
|
177
|
-
},
|
178
|
-
options: {
|
179
|
-
tenant: 'hawkular'
|
180
|
-
})
|
181
|
-
rescue
|
182
|
-
puts 'We got an exception and this is good'
|
183
|
-
else
|
184
|
-
fail 'Should have failed as no host was given'
|
93
|
+
expect(wait_for(operation_outcome)).to eq 'fail'
|
185
94
|
end
|
186
|
-
end
|
187
|
-
end
|
188
|
-
end
|
189
95
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
VCR.use_cassette('Operation/Helpers/get_feed', decode_compressed_response: true) do
|
203
|
-
@feed_id = inventory_client.list_feeds[0]
|
96
|
+
it 'should run into error callback because bad hash parameters' do
|
97
|
+
noop = { operationName: 'noop' }
|
98
|
+
operation_outcome = {}
|
99
|
+
client.invoke_generic_operation(noop) do |on|
|
100
|
+
on.success do |_data|
|
101
|
+
operation_outcome[:data] = 'should run into error'
|
102
|
+
end
|
103
|
+
on.failure do |error|
|
104
|
+
operation_outcome[:data] = error
|
105
|
+
end
|
106
|
+
end
|
107
|
+
expect(wait_for(operation_outcome)).to eq 'Hash property resourcePath must be specified'
|
204
108
|
end
|
205
|
-
@random_uuid = 'random'
|
206
|
-
end
|
207
|
-
end
|
208
109
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
wait_time: WebSocketVCR.live? ? 1.5 : 0)
|
214
|
-
@ws = @client.ws
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
|
-
around(:each) do |ex|
|
219
|
-
if ex.metadata[:websocket]
|
220
|
-
WebSocketVCR.configure do |c|
|
221
|
-
c.hook_uris = [HOST]
|
222
|
-
end
|
223
|
-
WebSocketVCR.record(ex, self) do
|
224
|
-
ex.run
|
110
|
+
it 'should bail with hash property error because no callback at all' do
|
111
|
+
noop = { operationName: 'noop' }
|
112
|
+
expect { client.invoke_generic_operation(noop) }.to raise_error(ArgumentError,
|
113
|
+
'You need to specify error callback')
|
225
114
|
end
|
226
|
-
else
|
227
|
-
ex.run
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
|
-
after(:each) do |ex|
|
232
|
-
unless ex.metadata[:skip_close]
|
233
|
-
@client.close_connection!
|
234
|
-
@client = nil
|
235
|
-
@ws = nil
|
236
|
-
end
|
237
|
-
end
|
238
115
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
@client.add_jdbc_driver(resource_path: wf_path,
|
249
|
-
driver_jar_name: 'driver.jar',
|
250
|
-
driver_name: driver_name,
|
251
|
-
module_name: 'foo.bar.' + @random_uuid, # jboss module
|
252
|
-
driver_class: 'com.mysql.jdbc.Driver',
|
253
|
-
binary_content: driver_bits) do |on|
|
254
|
-
on.success do |data|
|
255
|
-
actual_data[:data] = data
|
256
|
-
end
|
257
|
-
on.failure do |error|
|
258
|
-
actual_data[:data] = {}
|
259
|
-
puts 'error callback was called, reason: ' + error.to_s
|
116
|
+
it 'should bail with hash property error because no error-callback ' do
|
117
|
+
noop = { operationName: 'noop' }
|
118
|
+
expect do
|
119
|
+
client.invoke_generic_operation(noop) do |on|
|
120
|
+
on.success do |_data|
|
121
|
+
fail 'This should have failed'
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end.to raise_error(ArgumentError, 'You need to specify error callback')
|
260
125
|
end
|
261
|
-
end
|
262
|
-
actual_data = wait_for actual_data
|
263
|
-
expect(actual_data['status']).to eq('OK')
|
264
|
-
expect(actual_data['message']).to start_with('Added JDBC Driver')
|
265
|
-
expect(actual_data['driverName']).to eq(driver_name)
|
266
|
-
end
|
267
126
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
feed_id: @feed_id,
|
273
|
-
resource_ids: [wf_server_resource_id, alerts_war_resource_id])
|
274
|
-
|
275
|
-
restart = {
|
276
|
-
resource_path: path.to_s,
|
277
|
-
deployment_name: 'hawkular-alerts-actions-email.war'
|
278
|
-
}
|
279
|
-
|
280
|
-
actual_data = {}
|
281
|
-
@client.restart_deployment(restart) do |on|
|
282
|
-
on.success do |data|
|
283
|
-
actual_data[:data] = data
|
284
|
-
end
|
285
|
-
on.failure do |error|
|
286
|
-
actual_data[:data] = {}
|
287
|
-
puts 'error callback was called, reason: ' + error.to_s
|
127
|
+
it 'should bail with no host' do
|
128
|
+
expect do
|
129
|
+
OperationsClient.new(options.merge host: nil)
|
130
|
+
end.to raise_error(StandardError, 'no parameter ":host" or ":entrypoint" given')
|
288
131
|
end
|
289
132
|
end
|
290
133
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
expect(actual_data['message']).to start_with('Performed [Restart Deployment] on')
|
296
|
-
end
|
297
|
-
|
298
|
-
it 'Restart should not be performed if resource path is wrong' do
|
299
|
-
wf_server_resource_id = 'Unknown~~'
|
300
|
-
wrong_war_resource_id = 'Unknown~%2Fdeployment%3Dnon-existent.war'
|
301
|
-
path = CanonicalPath.new(tenant_id: @tenant_id,
|
302
|
-
feed_id: @feed_id,
|
303
|
-
resource_ids: [wf_server_resource_id, wrong_war_resource_id])
|
304
|
-
|
305
|
-
restart = {
|
306
|
-
resource_path: path.to_s,
|
307
|
-
deployment_name: 'non-existent.war'
|
308
|
-
}
|
309
|
-
actual_data = {}
|
310
|
-
@client.restart_deployment(restart) do |on|
|
311
|
-
on.success do |_|
|
312
|
-
actual_data[:data] = { error: 'the operation should have failed' }
|
313
|
-
end
|
314
|
-
on.failure do |error|
|
315
|
-
actual_data[:data] = { error: error }
|
134
|
+
describe 'Operation/Operation' do
|
135
|
+
before(:all) do
|
136
|
+
@random_uuid = SecureRandom.uuid
|
137
|
+
@not_so_random_uuid = 'not_so_random_uuid'
|
316
138
|
end
|
317
|
-
end
|
318
|
-
actual_data = wait_for actual_data
|
319
|
-
expect(actual_data[:error]).to start_with('Cannot restart application: unknown resource')
|
320
|
-
end
|
321
139
|
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
140
|
+
around(:each) do |example|
|
141
|
+
record("Operation/#{security_context}/Helpers", nil, 'get_tenant') do
|
142
|
+
::RSpec::Mocks.with_temporary_scope do
|
143
|
+
mock_inventory_client
|
144
|
+
@inventory_client = InventoryClient.create(
|
145
|
+
options.merge entrypoint: host_with_scheme(host, security_context == SECURE_CONTEXT))
|
146
|
+
end
|
147
|
+
inventory_client = @inventory_client
|
148
|
+
remove_instance_variable(:@inventory_client)
|
149
|
+
@tenant_id = inventory_client.get_tenant
|
150
|
+
record("Operation/#{security_context}/Helpers", { tenant_id: @tenant_id }, 'get_feed') do
|
151
|
+
@feed_id = inventory_client.list_feeds[0]
|
152
|
+
end
|
153
|
+
end
|
154
|
+
@bindings = { random_uuid: @random_uuid, tenant_id: @tenant_id, feed_id: @feed_id }
|
155
|
+
record_websocket("Operation/#{security_context}/Operation",
|
156
|
+
@bindings,
|
157
|
+
cassette_name,
|
158
|
+
example)
|
341
159
|
end
|
342
|
-
end
|
343
|
-
actual_data = wait_for actual_data
|
344
|
-
expect(actual_data['status']).to eq('OK')
|
345
|
-
expect(actual_data['message']).to start_with('Performed [Undeploy] on')
|
346
|
-
end
|
347
160
|
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
on.success do |data|
|
377
|
-
actual_data[:data] = data
|
378
|
-
end
|
379
|
-
on.failure do |error|
|
380
|
-
actual_data[:data] = { 'status' => 'ERROR' }
|
381
|
-
puts 'error callback was called, reason: ' + error.to_s
|
161
|
+
it 'Add JDBC driver should add the driver' do
|
162
|
+
wf_server_resource_id = 'Local~~'
|
163
|
+
driver_name = 'CreatedByRubyDriver' + @not_so_random_uuid
|
164
|
+
driver_bits = IO.binread("#{File.dirname(__FILE__)}/../resources/driver.jar")
|
165
|
+
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
166
|
+
feed_id: @feed_id,
|
167
|
+
resource_ids: [wf_server_resource_id]).to_s
|
168
|
+
|
169
|
+
actual_data = {}
|
170
|
+
|
171
|
+
client.add_jdbc_driver(resource_path: wf_path,
|
172
|
+
driver_jar_name: 'driver.jar',
|
173
|
+
driver_name: driver_name,
|
174
|
+
module_name: 'foo.bar' + @not_so_random_uuid, # jboss module
|
175
|
+
driver_class: 'com.mysql.jdbc.Driver',
|
176
|
+
binary_content: driver_bits) do |on|
|
177
|
+
on.success do |data|
|
178
|
+
actual_data[:data] = data
|
179
|
+
end
|
180
|
+
on.failure do |error|
|
181
|
+
actual_data[:data] = {}
|
182
|
+
puts 'error callback was called, reason: ' + error.to_s
|
183
|
+
end
|
184
|
+
end
|
185
|
+
actual_data = wait_for actual_data
|
186
|
+
expect(actual_data['status']).to eq('OK')
|
187
|
+
expect(actual_data['message']).to start_with('Added JDBC Driver')
|
188
|
+
expect(actual_data['driverName']).to eq(driver_name)
|
382
189
|
end
|
383
|
-
end
|
384
|
-
actual_data = wait_for actual_data
|
385
|
-
expect(actual_data['status']).to eq('OK')
|
386
|
-
expect(actual_data['message']).to start_with('Added Datasource')
|
387
|
-
expect(actual_data['xaDatasource']).to be_falsey
|
388
|
-
expect(actual_data['datasourceName']).to eq(payload[:datasourceName])
|
389
|
-
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
|
390
|
-
end
|
391
190
|
|
392
|
-
|
393
|
-
|
191
|
+
it 'Restart should be performed and eventually respond with success' do
|
192
|
+
wf_server_resource_id = 'Local~~'
|
193
|
+
alerts_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-alerts-actions-email.war'
|
194
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
195
|
+
feed_id: @feed_id,
|
196
|
+
resource_ids: [wf_server_resource_id, alerts_war_resource_id])
|
197
|
+
|
198
|
+
restart = {
|
199
|
+
resource_path: path.to_s,
|
200
|
+
deployment_name: 'hawkular-alerts-actions-email.war'
|
201
|
+
}
|
202
|
+
|
203
|
+
actual_data = {}
|
204
|
+
client.restart_deployment(restart) do |on|
|
205
|
+
on.success do |data|
|
206
|
+
actual_data[:data] = data
|
207
|
+
end
|
208
|
+
on.failure do |error|
|
209
|
+
actual_data[:data] = {}
|
210
|
+
puts 'error callback was called, reason: ' + error.to_s
|
211
|
+
end
|
212
|
+
end
|
394
213
|
|
395
|
-
|
396
|
-
|
214
|
+
# expectations don't work from callbacks so waiting for the results via blocking helper `wait_for`
|
215
|
+
actual_data = wait_for actual_data
|
216
|
+
expect(actual_data['status']).to eq('OK')
|
217
|
+
expect(actual_data['resourcePath']).to eq(path.up.to_s)
|
218
|
+
expect(actual_data['message']).to start_with('Performed [Restart Deployment] on')
|
219
|
+
end
|
397
220
|
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
221
|
+
it 'Restart should not be performed if resource path is wrong' do
|
222
|
+
wf_server_resource_id = 'Unknown~~'
|
223
|
+
wrong_war_resource_id = 'Unknown~%2Fdeployment%3Dnon-existent.war'
|
224
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
225
|
+
feed_id: @feed_id,
|
226
|
+
resource_ids: [wf_server_resource_id, wrong_war_resource_id])
|
227
|
+
|
228
|
+
restart = {
|
229
|
+
resource_path: path.to_s,
|
230
|
+
deployment_name: 'non-existent.war'
|
231
|
+
}
|
232
|
+
actual_data = {}
|
233
|
+
client.restart_deployment(restart) do |on|
|
234
|
+
on.success do |_|
|
235
|
+
actual_data[:data] = { error: 'the operation should have failed' }
|
236
|
+
end
|
237
|
+
on.failure do |error|
|
238
|
+
actual_data[:data] = { error: error }
|
239
|
+
end
|
240
|
+
end
|
241
|
+
actual_data = wait_for actual_data
|
242
|
+
expect(actual_data[:error]).to start_with('Could not perform [Restart Deployment] on a [Application] given')
|
243
|
+
end
|
402
244
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
245
|
+
it 'Disable should be performed and eventually respond with success' do
|
246
|
+
wf_server_resource_id = 'Local~~'
|
247
|
+
alerts_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-alerts-actions-email.war'
|
248
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
249
|
+
feed_id: @feed_id,
|
250
|
+
resource_ids: [wf_server_resource_id, alerts_war_resource_id])
|
251
|
+
|
252
|
+
disable = {
|
253
|
+
resource_path: path.to_s,
|
254
|
+
deployment_name: 'hawkular-alerts-actions-email.war'
|
255
|
+
}
|
256
|
+
actual_data = {}
|
257
|
+
client.disable_deployment(disable) do |on|
|
258
|
+
on.success do |data|
|
259
|
+
actual_data[:data] = data
|
260
|
+
end
|
261
|
+
on.failure do |error|
|
262
|
+
actual_data[:data] = {}
|
263
|
+
puts 'error callback was called, reason: ' + error.to_s
|
264
|
+
end
|
265
|
+
end
|
266
|
+
actual_data = wait_for actual_data
|
267
|
+
expect(actual_data['status']).to eq('OK')
|
268
|
+
expect(actual_data['message']).to start_with('Performed [Disable Deployment] on')
|
269
|
+
end
|
409
270
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
271
|
+
it 'Add datasource should be doable' do
|
272
|
+
wf_server_resource_id = 'Local~~'
|
273
|
+
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
274
|
+
feed_id: @feed_id,
|
275
|
+
resource_ids: [wf_server_resource_id]).to_s
|
276
|
+
payload = {
|
277
|
+
# compulsory fields
|
278
|
+
resourcePath: wf_path,
|
279
|
+
xaDatasource: false,
|
280
|
+
datasourceName: 'CreatedByRubyDS' + @random_uuid,
|
281
|
+
jndiName: 'java:jboss/datasources/CreatedByRubyDS' + @random_uuid,
|
282
|
+
driverName: 'h2',
|
283
|
+
# this is probably a bug (driver class should be already defined in driver)
|
284
|
+
driverClass: 'org.h2.Driver',
|
285
|
+
connectionUrl: 'dbc:h2:mem:ruby;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
|
286
|
+
|
287
|
+
# optional
|
288
|
+
datasourceProperties: {
|
289
|
+
someKey: 'someValue'
|
290
|
+
},
|
291
|
+
userName: 'sa',
|
292
|
+
password: 'sa',
|
293
|
+
securityDomain: 'other'
|
294
|
+
# xaDataSourceClass: 'clazz' for xa DS
|
295
|
+
}
|
296
|
+
|
297
|
+
actual_data = {}
|
298
|
+
client.add_datasource(payload) do |on|
|
299
|
+
on.success do |data|
|
300
|
+
actual_data[:data] = data
|
301
|
+
end
|
302
|
+
on.failure do |error|
|
303
|
+
actual_data[:data] = { 'status' => 'ERROR' }
|
304
|
+
puts 'error callback was called, reason: ' + error.to_s
|
305
|
+
end
|
306
|
+
end
|
307
|
+
actual_data = wait_for actual_data
|
308
|
+
expect(actual_data['status']).to eq('OK')
|
309
|
+
expect(actual_data['message']).to start_with('Added Datasource')
|
310
|
+
expect(actual_data['xaDatasource']).to be_falsey
|
311
|
+
expect(actual_data['datasourceName']).to eq(payload[:datasourceName])
|
312
|
+
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
|
439
313
|
end
|
440
|
-
|
441
|
-
|
442
|
-
|
314
|
+
|
315
|
+
it 'should not be possible to perform on closed client' do
|
316
|
+
restart = {
|
317
|
+
resource_path: '/t;t1/f;whatever/r;something',
|
318
|
+
deployment_name: 'something.war'
|
319
|
+
}
|
320
|
+
|
321
|
+
# close the connection
|
322
|
+
client.close_connection!
|
323
|
+
expect do
|
324
|
+
client.restart_deployment(restart)
|
325
|
+
end.to raise_error(RuntimeError, /Handshake with server has not been done./)
|
443
326
|
end
|
444
|
-
end
|
445
327
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
328
|
+
it 'Restart can be run multiple times in parallel' do
|
329
|
+
wf_server_resource_id = 'Local~~'
|
330
|
+
alerts_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-alerts-actions-email.war'
|
331
|
+
console_war_resource_id = 'Local~%2Fdeployment%3Dhawkular-wildfly-agent-download.war'
|
332
|
+
path1 = CanonicalPath.new(tenant_id: @tenant_id,
|
333
|
+
feed_id: @feed_id,
|
334
|
+
resource_ids: [wf_server_resource_id, alerts_war_resource_id])
|
335
|
+
path2 = CanonicalPath.new(tenant_id: @tenant_id,
|
336
|
+
feed_id: @feed_id,
|
337
|
+
resource_ids: [wf_server_resource_id, console_war_resource_id])
|
338
|
+
|
339
|
+
restart1 = {
|
340
|
+
resource_path: path1.to_s,
|
341
|
+
deployment_name: 'hawkular-alerts-actions-email.war'
|
342
|
+
}
|
343
|
+
|
344
|
+
restart2 = {
|
345
|
+
resource_path: path2.to_s,
|
346
|
+
deployment_name: 'hawkular-wildfly-agent-download.war'
|
347
|
+
}
|
348
|
+
|
349
|
+
# run the first operation w/o registering the callback
|
350
|
+
client.restart_deployment(restart1)
|
351
|
+
|
352
|
+
actual_data = {}
|
353
|
+
# run the 2nd operation with 2 callback blocks (the happy path and the less happy path)
|
354
|
+
client.restart_deployment(restart2) do |on|
|
355
|
+
on.success do |data|
|
356
|
+
actual_data[:data] = data
|
357
|
+
end
|
358
|
+
on.failure do |error|
|
359
|
+
actual_data[:data] = {}
|
360
|
+
puts 'error callback was called, reason: ' + error.to_s
|
361
|
+
end
|
362
|
+
end
|
451
363
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
457
|
-
feed_id: @feed_id,
|
458
|
-
resource_ids: [wf_server_resource_id]).to_s
|
459
|
-
|
460
|
-
actual_data = {}
|
461
|
-
@client.add_deployment(resource_path: wf_path,
|
462
|
-
destination_file_name: app_name,
|
463
|
-
binary_content: war_file) do |on|
|
464
|
-
on.success do |data|
|
465
|
-
actual_data[:data] = data
|
364
|
+
actual_data = wait_for actual_data
|
365
|
+
expect(actual_data['status']).to eq('OK')
|
366
|
+
expect(actual_data['resourcePath']).to eq(path2.up.to_s)
|
367
|
+
expect(actual_data['message']).to start_with('Performed [Restart Deployment] on')
|
466
368
|
end
|
467
|
-
on.failure do |error|
|
468
|
-
actual_data[:data] = {}
|
469
|
-
puts 'error callback was called, reason: ' + error.to_s
|
470
|
-
end
|
471
|
-
end
|
472
|
-
actual_data = wait_for actual_data
|
473
|
-
expect(actual_data['status']).to eq('OK')
|
474
|
-
expect(actual_data['message']).to start_with('Performed [Deploy] on')
|
475
|
-
expect(actual_data['destinationFileName']).to eq(app_name)
|
476
|
-
expect(actual_data['resourcePath']).to eq(wf_path)
|
477
|
-
end
|
478
369
|
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
370
|
+
it 'Add deployment should be doable' do
|
371
|
+
wf_server_resource_id = 'Local~~'
|
372
|
+
app_name = 'sample.war'
|
373
|
+
war_file = IO.binread("#{File.dirname(__FILE__)}/../resources/#{app_name}")
|
374
|
+
wf_path = CanonicalPath.new(tenant_id: @tenant_id,
|
375
|
+
feed_id: @feed_id,
|
376
|
+
resource_ids: [wf_server_resource_id]).to_s
|
377
|
+
|
378
|
+
actual_data = {}
|
379
|
+
client.add_deployment(resource_path: wf_path,
|
380
|
+
destination_file_name: app_name,
|
381
|
+
binary_content: war_file) do |on|
|
382
|
+
on.success do |data|
|
383
|
+
actual_data[:data] = data
|
384
|
+
end
|
385
|
+
on.failure do |error|
|
386
|
+
actual_data[:data] = {}
|
387
|
+
puts 'error callback was called, reason: ' + error.to_s
|
388
|
+
end
|
389
|
+
end
|
390
|
+
actual_data = wait_for actual_data
|
391
|
+
expect(actual_data['status']).to eq('OK')
|
392
|
+
expect(actual_data['message']).to start_with('Performed [Deploy] on')
|
393
|
+
expect(actual_data['destinationFileName']).to eq(app_name)
|
394
|
+
expect(actual_data['resourcePath']).to eq(wf_path)
|
497
395
|
end
|
498
|
-
end
|
499
|
-
actual_data = wait_for actual_data
|
500
|
-
expect(actual_data['status']).to eq('OK')
|
501
|
-
expect(actual_data['message']).to start_with('Performed [Undeploy] on')
|
502
|
-
end
|
503
396
|
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
397
|
+
it 'Undeploy deployment should be performed and eventually respond with success' do
|
398
|
+
wf_server_resource_id = 'Local~~'
|
399
|
+
sample_app_resource_id = 'Local~%2Fdeployment=sample.war'
|
400
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
401
|
+
feed_id: @feed_id,
|
402
|
+
resource_ids: [wf_server_resource_id, sample_app_resource_id])
|
403
|
+
undeploy = {
|
404
|
+
resource_path: path.to_s,
|
405
|
+
deployment_name: 'sample.war'
|
406
|
+
}
|
407
|
+
actual_data = {}
|
408
|
+
client.undeploy(undeploy) do |on|
|
409
|
+
on.success do |data|
|
410
|
+
actual_data[:data] = data
|
411
|
+
end
|
412
|
+
on.failure do |error|
|
413
|
+
actual_data[:data] = { 'status' => 'ERROR' }
|
414
|
+
puts 'error callback was called, reason: ' + error.to_s
|
415
|
+
end
|
416
|
+
end
|
417
|
+
actual_data = wait_for actual_data
|
418
|
+
expect(actual_data['status']).to eq('OK')
|
419
|
+
expect(actual_data['message']).to start_with('Performed [Undeploy] on')
|
523
420
|
end
|
524
|
-
end
|
525
|
-
actual_data = wait_for actual_data
|
526
|
-
expect(actual_data['status']).to eq('OK')
|
527
|
-
expect(actual_data['message']).to start_with('Performed [Remove] on')
|
528
|
-
expect(actual_data['serverRefreshIndicator']).to eq('RELOAD-REQUIRED')
|
529
|
-
end
|
530
421
|
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
422
|
+
it 'Remove datasource should be performed and eventually respond with success' do
|
423
|
+
wf_server_resource_id = 'Local~~'
|
424
|
+
datasource_resource_id = 'Local~%2Fsubsystem%3Ddatasources%2Fdata-source%3DCreatedByRubyDS' + @random_uuid
|
425
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
426
|
+
feed_id: @feed_id,
|
427
|
+
resource_ids: [wf_server_resource_id, datasource_resource_id])
|
428
|
+
|
429
|
+
operation = {
|
430
|
+
resourcePath: path.to_s
|
431
|
+
}
|
432
|
+
|
433
|
+
actual_data = {}
|
434
|
+
client.invoke_specific_operation(operation, 'RemoveDatasource') do |on|
|
435
|
+
on.success do |data|
|
436
|
+
actual_data[:data] = data
|
437
|
+
end
|
438
|
+
on.failure do |error|
|
439
|
+
actual_data[:data] = {}
|
440
|
+
puts 'error callback was called, reason: ' + error.to_s
|
441
|
+
end
|
442
|
+
end
|
443
|
+
actual_data = wait_for actual_data
|
444
|
+
expect(actual_data['status']).to eq('OK')
|
445
|
+
expect(actual_data['message']).to start_with('Performed [Remove] on')
|
446
|
+
expect(actual_data['serverRefreshIndicator']).to eq('RELOAD-REQUIRED')
|
542
447
|
end
|
543
|
-
|
544
|
-
|
545
|
-
|
448
|
+
|
449
|
+
it 'Remove JDBC driver should be performed and eventually respond with success' do
|
450
|
+
wf_server_resource_id = 'Local~~'
|
451
|
+
driver_resource_id = 'Local~%2Fsubsystem%3Ddatasources%2Fjdbc-driver%3DCreatedByRubyDriver'
|
452
|
+
driver_resource_id << @not_so_random_uuid
|
453
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
454
|
+
feed_id: @feed_id,
|
455
|
+
resource_ids: [wf_server_resource_id, driver_resource_id]).to_s
|
456
|
+
|
457
|
+
actual_data = {}
|
458
|
+
client.invoke_specific_operation({ resourcePath: path }, 'RemoveJdbcDriver') do |on|
|
459
|
+
on.success do |data|
|
460
|
+
actual_data[:data] = data
|
461
|
+
end
|
462
|
+
on.failure do |error|
|
463
|
+
actual_data[:data] = {}
|
464
|
+
puts 'error callback was called, reason: ' + error.to_s
|
465
|
+
end
|
466
|
+
end
|
467
|
+
actual_data = wait_for actual_data
|
468
|
+
expect(actual_data['status']).to eq('OK')
|
469
|
+
expect(actual_data['resourcePath']).to eq(path)
|
470
|
+
expect(actual_data['message']).to start_with('Performed [Remove] on a [JDBC Driver]')
|
546
471
|
end
|
547
|
-
end
|
548
|
-
actual_data = wait_for actual_data
|
549
|
-
expect(actual_data['status']).to eq('OK')
|
550
|
-
expect(actual_data['resourcePath']).to eq(path)
|
551
|
-
expect(actual_data['message']).to start_with('Performed [Remove] on a [JDBC Driver]')
|
552
|
-
end
|
553
472
|
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
473
|
+
xit 'Export JDR should retrieve the zip file with the report' do
|
474
|
+
wf_server_resource_id = 'Local~~'
|
475
|
+
path = CanonicalPath.new(tenant_id: @tenant_id,
|
476
|
+
feed_id: @feed_id,
|
477
|
+
resource_ids: [wf_server_resource_id]).to_s
|
559
478
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
479
|
+
actual_data = {}
|
480
|
+
client.export_jdr(path) do |on|
|
481
|
+
on.success do |data|
|
482
|
+
actual_data[:data] = data
|
483
|
+
end
|
484
|
+
on.failure do |error|
|
485
|
+
actual_data[:data] = {}
|
486
|
+
puts 'error callback was called, reason: ' + error.to_s
|
487
|
+
end
|
488
|
+
end
|
489
|
+
actual_data = wait_for actual_data
|
490
|
+
expect(actual_data['status']).to eq('OK')
|
491
|
+
expect(actual_data['resourcePath']).to eq(path)
|
492
|
+
expect(actual_data['message']).to start_with('Performed [Export JDR] on')
|
493
|
+
expect(actual_data['fileName']).to start_with('jdr_')
|
568
494
|
end
|
569
495
|
end
|
570
|
-
actual_data = wait_for actual_data
|
571
|
-
expect(actual_data['status']).to eq('OK')
|
572
|
-
expect(actual_data['resourcePath']).to eq(path)
|
573
|
-
expect(actual_data['message']).to start_with('Performed [Export JDR] on')
|
574
|
-
expect(actual_data['fileName']).to start_with('jdr_')
|
575
496
|
end
|
576
497
|
end
|
577
498
|
end
|